Giter Club home page Giter Club logo

notejam's Introduction

Notejam

The easy way to learn web frameworks

Do you know framework X and want to try framework Y? The easy way to start with a new framework is to compare it with frameworks you already know. The goal of the project is to help developers easily learn new frameworks by examples.

Notejam is a unified sample web application (more than just "Hello World") implemented using different server-side frameworks. Currently python, php, ruby and javascript frameworks are supported.

Supported frameworks

Python

PHP

Ruby

Java

Javascript (node.js)

In progress

Scala

  • Play

Clojure

  • Compojure

... and more frameworks are coming soon.

Application overview

Notejam is a web application which offers user to sign up/in/out and create/view/edit/delete notes. Notes are grouped in pads.

Screenshots

Sign in All notes New note

See more screenshots for look and feel.

See detailed overview.

Typical application covers following topics:

  • Request/Response handling
  • Routing
  • Templates
  • Configuration
  • Authentication
  • Forms
  • Error handling
  • Database/ORM
  • Mailing
  • Functional/unit testing

How to launch

All implementations are SQLite based and quickly launchable by built-in web servers. Each implementation has instruction describing easy steps to install environment, launch and run tests.

Contribution

Contribution is more than welcome! Contribute improvements to existing applications to help them follow best practices or provide new implementation for unsupported framework.

Do you want to improve one of the existing implementations?

Each implementation has its own README with contribution details.

Do you want to add new framework?

Read contribution guide for details.

Contacts

License

MIT © Serhii Komar.

See license.

notejam's People

Contributors

aminemat avatar bkittelmann avatar chrispecoraro avatar eyupatis avatar fasouto avatar fixe avatar fprochazka avatar githubjeka avatar honzalilak avatar jackunion avatar jamesking56 avatar kevgathuku avatar klimesf avatar komarserjio avatar malkusch avatar nadavge avatar olegkovalenko avatar samdark avatar scrubmx avatar seleznev-nvkz avatar spuder avatar williamn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

notejam's Issues

Request: web2py

In my exploration of the python web frameworks, web2py seems to be the only major one missing.
Is it possible to add an example in this framework?

Thanks even if you can't, these examples are great.

Replace Forgot password with django's forgot password view.

Currently in the Forgot Password view:

class ForgotPasswordView(FormView):
form_class = ForgotPasswordForm
template_name = 'forgot_password.html'
success_url = reverse_lazy('signin')
success_message = 'New password is sent in your email inbox'
def form_valid(self, form):
m = md5.new()
m.update(
"{email}{secret}{date}".format(
email=form.cleaned_data['email'],
secret=settings.SECRET_KEY,
date=str(datetime.today())
)
)
new_password = m.hexdigest()[:8]
user = User.objects.get(email=form.cleaned_data['email'])
user.set_password(new_password)
user.save()
send_mail(
'Notejam password reset',
'Hi, {}. Your new password is {}.'.format(
form.cleaned_data['email'],
new_password
),
'[email protected]',
[form.cleaned_data['email']],
fail_silently=False
)
messages.success(self.request, self.success_message)
return super(ForgotPasswordView, self).form_valid(form)

It's been assigned a new random password for recovery, this is certainly a security issue and very susceptible to abuse.

Django auth views has common views for recover password, change password, login, logout, and many others.

By including the django.contrib.auth urls you will just need to customize the templates and defaults settings. This would be more suitable for security and better practices as the community put a lot of effort on maintaining well implemented user operations in the django.contrib.auth app. And will certainly be less code to maintain.

urlpatterns = patterns('',
    # user relates urls
    url(r'^accounts/',  include('django.contrib.auth.urls'))
    # notes
    url(r'^notes/', include('notes.urls')),
    # pads
    url(r'^pads/', include('pads.urls')),

    url(r'^$', login_required(NoteListView.as_view()), name='home'),
)

Request: Silex

As Silex tends to be less "code by configuration" than full blown Symfony2, it'd be nice to see that as well. Of course it would require other extensions since Silex is relatively simple.

Improve laravel code quality

I'm at work right now, so I'll keep it short. The Laravel example is really terrible, when I finish work I'm going to clean it up. I just wanted to post this here to let people know that I'm going to clean it up.

Padrino (ruby) fails on bundle install

Use ruby 2.3.0 installed using RVM on mac

$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching rake 10.3.2
Installing rake 10.3.2
Fetching i18n 0.6.9
Installing i18n 0.6.9
Fetching json 1.8.1
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/sowen/.rvm/gems/ruby-2.3.0/gems/json-1.8.1/ext/json/ext/generator
/Users/sowen/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20180207-17793-moicv3.rb extconf.rb
creating Makefile

current directory: /Users/sowen/.rvm/gems/ruby-2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /Users/sowen/.rvm/gems/ruby-2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                              ^
/Users/sowen/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/intern.h:797:9: note: macro 'rb_str_new' defined here
#define rb_str_new(str, len) __extension__ (    \
        ^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka
'unsigned long') with an expression of type 'VALUE (const char *, long)' (aka 'unsigned long (const char *, long)')
[-Wint-conversion]
    VALUE result = rb_str_new(FBUFFER_PAIR(fb));
          ^        ~~~~~~~~~~
1 warning and 1 error generated.
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/sowen/.rvm/gems/ruby-2.3.0/gems/json-1.8.1 for inspection.
Results logged to /Users/sowen/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-17/2.3.0/json-1.8.1/gem_make.out

An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

In Gemfile:
  padrino was resolved to 0.12.2, which depends on
    padrino-admin was resolved to 0.12.2, which depends on
      padrino-core was resolved to 0.12.2, which depends on
        padrino-support was resolved to 0.12.2, which depends on
          activesupport was resolved to 4.1.1, which depends on
            json
$ ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin17]

Review all texts

Review all texts (titles, breadcrumbs, buttons) to be consistent across applications.

Symfony: rewrite

The Symfony app is outdated and needs to be rewritten according to the best practices and using the latest LTS version 2.8.

I can give it a go if you like.

Add CakePHP (in progress)

Any plans on adding CakePHP?
Either 2.x or the new 3.x version maybe?

I think as one of the oldest (first ever, 10+ years) and most major frameworks out there it should most definitely be in that list.

Interested in CodeIgniter version?

This repository is really useful. Thanks for your work!

I was thinking to propose a CodeIgniter version, however I don't know if it would be useful as the framework usage is slowly decreasing. Do you think it would be interesting?

Improve static layouts and stylesheets

Improve static layouts and stylesheets.
For now html layouts do not cover all pages and different css files (minor differences, but anyway) used in applications. This should be fixed.
Reduce css files if possible.

Symfony: Add authorization constraints on entities

Currently users can view, edit and delete entities of other users:

  1. Login as User-1
  2. Create pad and remember id of that pad from URI.
  3. Login as User-2
  4. With the pad id from 2. you can view and edit the pad.

Deleting the pad doesn't work, but unfortunately deleting the note of another user does.

The authenticated user should be checked against the owner of entities.

Java/Spring implementation

I'd volunteer for a Spring (Java) implementation. Just give a feedback if this would be accepted here.

Padrino Install / Start Error

No idea what's wrong. I got through the readme to bundle install, then I get the error
from the terminal:

"Gem files will remain installed in /var/lib/gems/1.9.1/gems/do_sqlite3-0.10.14 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/do_sqlite3-0.10.14/ext/do_sqlite3/gem_make.out
root@zee-HP-Pavilion-Notebook-PC: /var/www/html/padrino/notejam# padrino start
padrino: command not found"

Zend Framework

READMe page mention Zend (Framework) is in progress but it do not mention if it is ZF1 or ZF2.

If it is ZF2, I'd like to suggest (or even contribute) ZF1.

It might seems ZF2 is more preferred but ZF is used for enterprise applications. Although ZF2 is preferred for any new project, ZF1 projects could not be migrated to ZF2 without major rewriting, therefore are lot of ZF1 enterprise projects and I'm still working on one. If current ZF project is ZF2 project, I'd like to contribute to ZF1 branch.

/static/css/style.css 404

Hi,
I'm trying to run the Django app
I can confirm that /static/css/style.css is being served when running the app using ./manage.py runserver
but I've tried to run the app using Gunicorn and Nginx but it always gives me 404 and display the web app without any CSS/static content.
I've also tried uWSGI but still the same

Any thoughts?

Migrate to a Github organization

How about migrating to a GitHub Organization (e.g. notejam)? Each implementation would have an own repository. There could still be a master project e.g. notejam/notejam which aggregates all implementations by e.g. git submodules.

Benefits:

  • Removes branch and commit noise.
  • Allows easily to have separate owner/collaborators for each implementation.
  • The repositories could be tagged (e.g. against the respective framework versions).
  • Implement CI (e.g. travis) for each project.

Flask: app factory

@komarserjio so, adding app factory will require some changes in flask-notejam structure.

I've tried a couple of things and it turned out that:

  • it is probably better to leave things as they are now (I would, however, fix issues caused by outdated packages and brush up requirements.txt). App factories are definitely considered to be the best practice, but on the other hand flask-notejam is not that complex to use all of the best practices in it.
  • in order to implement factory function there should be implemented a Blueprint as well, which will be registered on the app inside factory function later. More about Blueprints here.

Cheers,
Jack.

P.S. sorry for grammatical mistakes if there are any, I'm a bit sleepy : ]

I've failed to import schema.sql into MySQL DB

I'm using MySQL 5.6.19.

I tried to import schema.sql but I failed with message below.

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AUTOINCREMENT NOT NULL,
    email VARCHAR(75) NOT NULL,
    password VARCHAR(128' at line 2

After I edit three of AUTOINCREMENT in schema.sql file to AUTO_INCREMENT, I was able to import it.

Laravel 5

Hey! Great repo btw!

Laravel 5 is apparently launching end of this year and has a completely new directory structure and many new features.

Should we create a Laravel 5 version when that launches? I can help you with that as I have Laravel experience.

POST should be used for signout

In contribute.rst the action for signing out of the application is described as GET /signout/. The verb here should be POST! Some browser/addons prefetch all GET links on a given page which leads to a signed out user on every request if signout is reachable via GET.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.