A Sails application.
This boilerplate is under construction. It needs several critical stuffs for being a real hard boilerplate.
The main goal is building modern web app over Sails. This boilerplate is made for web developpers.
The main features will be :
- Real time BO (in progress)
- User system (with Passport) (done)
- Simple CMS (blog style) (in progress)
- Simple Chat (in progress)
- Charts and reports (in progress)
- Modern front end, responsive and real time (with bootstrap 3) (done)
- SEO
- Analytics (done)
- ...
The important purpose is to build something nice and reusable over the time.
Tests made with sails 0.10.5.
The Heroku deployment : https://backyard-project.herokuapp.com
How to start :
git clone https://github.com/julienfroidefond/backyardProject.git
cd backyardProject
npm install
sails lift
NB : you may have also to do :
npm install -g sails
Main techs Front End : bootstrap3, Ractivejs, HighCharts, sails.io
Main techs Back End : Sails, Bower, grunt, jade
- Include bower in grunt task
- bootstrap less and jquery min with bower. Done on 'sails lift' with grunt. Cf tasks > bower.js and bower.json
- Jade templating
- Include bootstrap 3.0.0 in the default importer.less
- resolve asset problems : reordering in layout doesn't work. : Suppression of //scripts in layout.jade
- include https://www.npmjs.org/package/sails-generate-auth to generate passport auth
- Passport Inclusion
- User system
- Resolve bug : if a view is called not by a controller passport doesn't work because no user in session ; we don't pass by the policy.
- Admin user automatically creates at sails lift (cf bootstrap.js and userUtilities)
- Generate a file at the root to see the admin identifiers (adminIdentifiers.md)
- user and groups
- menu in a partial template for page style normal (not homepage)
- set toc in config, consumate both in mainmenu and homepage. Jade : - var tocEntries = sails.config.toc.getTocEntries(req, res);. It construct a menu differently if you're home page and/or logged in.
- MainController for pages globals. If or not accessible logged is action : hasToBeAuth or global.
- moving toc from config to service
- Testing generators
- run policy on https://sails_0_10-c9-julienfroidefond.c9.io/chat. Try to access non logged and you'll see 403 by policy.
- including file js front chat when needed only
- Chat app : cf https://github.com/balderdashy/sailsChat
- Chat app : list of connected user become only connected instead of all users
- Chat app : leave room on socket disconnect
- Building admin page with another UI
- Admin page : users : simple listing
- Inclusion of http://vitalets.github.io/x-editable/ for users editing compatible with REST Sails api. Wow.
- Destroy User
- Create user
- Update user
- backyard-bo-boCrudHandler.js -> js generic for cruding any object. Have to respect a certain markup format
- CRUD groups
- Super admin protection : group and user
- Errors handling for humans
- ractive for mvvm + websockets for realtime
- The config object from bdd is available by res.backyardConfig. It's a policy claimed on all pages.
- Analytics. Code generated only if config is on and on the front end pages. Modularity ???
- The production env files are pointing on mongoDb; without log.
- Heroku's site is in production with Procfile to start with : node app.js --prod.
- Caution, the password of the mongodb is in clear; so don't test it on your localhost please to let the mongodb for Heroku production
- Auto reloading for backend stuff : see balderdashy/sails#614. Use forever or nodemon.
- Admin page : complete all TODOs
- Users : avatar ?
- Profile
- Reports
- Overview
- Settings
- Protect REST actions with policy isAdmin (otherwise anyone can add users and groups and see the models)
- CMS system
- Blog style with live refresh and live editing
- Building pages
- Quid about production environment : Websockets protection ?
- Using i18n for translations
- remember me in login page?
- Study generator to do major parts Apps like modules (sails generate chatApp, adminApp, ...)
- Bad front end to change by an MVVM system with Ractive on Chat app. (review the architecture)
- Test passport for the providers non local; but it requires key and I think it's working with no extra needs
- SEO ?
App with Mongodb. Caution, could be down on a bad deployment. https://backyard-project.herokuapp.com
I use both brackets and sublime text2 for development on Mac Osx. Brackets with Theseus for debugging.
npm install -g node-inspector
node-debug app.js
https://github.com/julienfroidefond/backyardProject
Rappels :
- git add .
- git commit -m 'MyComment'
- git push
- https://sails_0_10-c9-julienfroidefond.c9.io
- Run with backyardProject/app.js
- Run in a terminal grunt watch (app.js don't do it unlike sails lift)
#License
Backyard project is under MIT license :
Copyright (c) 2014 Julien Froidefond
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.