{"id":26715090,"url":"https://github.com/tarlepp/angular-sailsjs-boilerplate","last_synced_at":"2025-07-03T17:03:02.117Z","repository":{"id":17386107,"uuid":"20158227","full_name":"tarlepp/angular-sailsjs-boilerplate","owner":"tarlepp","description":"'Boilerplate' for AngularJS + Sails.js","archived":false,"fork":false,"pushed_at":"2016-07-27T16:53:26.000Z","size":739,"stargazers_count":306,"open_issues_count":30,"forks_count":87,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-03-27T13:51:53.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarlepp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-25T15:44:21.000Z","updated_at":"2024-11-07T23:12:35.000Z","dependencies_parsed_at":"2022-09-24T15:53:54.036Z","dependency_job_id":null,"html_url":"https://github.com/tarlepp/angular-sailsjs-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarlepp%2Fangular-sailsjs-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarlepp%2Fangular-sailsjs-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarlepp%2Fangular-sailsjs-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarlepp%2Fangular-sailsjs-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarlepp","download_url":"https://codeload.github.com/tarlepp/angular-sailsjs-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767358,"owners_count":20992577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-27T13:51:58.728Z","updated_at":"2025-04-08T03:20:32.517Z","avatar_url":"https://github.com/tarlepp.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 'Boilerplate' for AngularJS + Sails.js\n\n### Why?\nModern web applications has separated front- and backend sides to use. This 'boilerplate' present one way to make\n\u003cem\u003eyour\u003c/em\u003e application which have fully separated back- and frontend sides. And really this is more than just a\nboilerplate, proper term would be 'example application'.\n\n### Main goals of this boilerplate\n* Separate back- and frontend development\n* Authenticate with backend (possible multiple ways: local, ~~github, twitter,~~ etc.)\n* Power of AngularJS + WebSockets\n* Simple examples how to use these\n* Provide real start point of new applications\n\n### Directory structure\n* ```backend``` = Sails.js server, just API nothing else [repository](https://github.com/tarlepp/angular-sailsjs-boilerplate-backend)\n* ```frontend``` = Angular SPA, just frontend side [repository](https://github.com/tarlepp/angular-sailsjs-boilerplate-frontend)\n\nAlso note that these 'directories' are just submodules to another repos\n\n#### Backend\n[![GitHub version](https://badge.fury.io/gh/tarlepp%2Fangular-sailsjs-boilerplate-backend.svg)](https://badge.fury.io/gh/tarlepp%2Fangular-sailsjs-boilerplate-backend)\n[![Build Status](https://travis-ci.org/tarlepp/angular-sailsjs-boilerplate-backend.png?branch=master)](https://travis-ci.org/tarlepp/angular-sailsjs-boilerplate-backend)\n[![Dependency Status](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-backend.svg)](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-backend)\n[![devDependency Status](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-backend/dev-status.svg)](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-backend#info=devDependencies)\n\nFor backend side this boilerplate uses Sails.js (imho awesome). See more info at https://github.com/balderdashy/sails\nI have just done some small tweaks to generic workflow of sails nothing else. Backend side of this 'boilerplate' is\nserved on separate repository https://github.com/tarlepp/angular-sailsjs-boilerplate-backend\n\n#### Frontend\n[![GitHub version](https://badge.fury.io/gh/tarlepp%2Fangular-sailsjs-boilerplate-frontend.svg)](https://badge.fury.io/gh/tarlepp%2Fangular-sailsjs-boilerplate-frontend)\n[![Build Status](https://travis-ci.org/tarlepp/angular-sailsjs-boilerplate-frontend.png?branch=master)](https://travis-ci.org/tarlepp/angular-sailsjs-boilerplate-frontend)\n[![Dependency Status](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-frontend.svg)](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-frontend)\n[![devDependency Status](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-frontend/dev-status.svg)](https://david-dm.org/tarlepp/angular-sailsjs-boilerplate-frontend#info=devDependencies)\n\nBoilerplate uses slush-angular for frontend (AngularJS using Google Angular App Structure Recommendations).\nSee more info at https://github.com/slushjs/slush-angular This library is awesome to distribute frontend. Frontend side\nof this 'boilerplate' is served on separate repository https://github.com/tarlepp/angular-sailsjs-boilerplate-frontend\n\n### Used libraries, guides, etc.\n* Sails.js, http://sailsjs.org/\n* slush-angular, https://github.com/slushjs/slush-angular\n* AngularJS, https://angularjs.org/\n* Bootstrap, http://getbootstrap.com/\n* Techniques for authentication in AngularJS applications, https://medium.com/opinionated-angularjs/7bbf0346acec\n* Json Web Tokens, http://angular-tips.com/blog/2014/05/json-web-tokens-examples/\n\n### Installation\nFirst of all you have to install \u003ccode\u003enpm\u003c/code\u003e and \u003ccode\u003enode.js\u003c/code\u003e to your box. Installation instructions can\nbe found [here](http://sailsjs.org/#/getStarted?q=what-os-do-i-need).\n\nAfter that you need to install \u003ccode\u003ebower\u003c/code\u003e, \u003ccode\u003egulp\u003c/code\u003e and \u003ccode\u003esails\u003c/code\u003e main packages to make all\nthings to happen. These can be installed with following commands on your *nix box.\n\u003cpre\u003e\nsudo npm install bower gulp sails -g\n\u003c/pre\u003e\n\nAfter that you need to download codes of this project to your computer, please follow instructions below.\n\n#### Back- and frontend installation\nNavigate yourself to directory where you downloaded or cloned this repo and run following command on shell:\n\u003cpre\u003e\nnpm install\n\u003c/pre\u003e\n\nThat will install all needed packages for back- and frontend. If this won't work you could try first to initialize\nback- and frontend submodules with following command:\n\n\u003cpre\u003e\ngit submodule update --init --recursive\n\u003c/pre\u003e\n\nAlso you might need to run ```npm install``` command on each of those directories (\u003ccode\u003ebackend\u003c/code\u003e and\n\u003ccode\u003efrontend\u003c/code\u003e).\n\n#### Configuration\nYou can configure your \u003ccode\u003ebackend\u003c/code\u003e and \u003ccode\u003efrontend\u003c/code\u003e applications to use your environment specified\nsettings. Basically by default you don't need to make any configurations at all. With default configuration backend will\nbe run on http://localhost:1337 and frontend on http://localhost:3001 (development) http://localhost:3000 (production).\n\n##### Backend\nThere is an example of backend configuration file on following path.\n\n\u003cpre\u003e\n/backend/config/local_example.js\n\u003c/pre\u003e\n\nJust copy this to \u003ccode\u003e/backend/config/local.js\u003c/code\u003e and make necessary changes to it. Note that this\n\u003ccode\u003elocal.js\u003c/code\u003e file is in .gitignore so it won't go to VCS at any point.\n\n##### Frontend\nThere is an example of front configuration file on following path.\n\n\u003cpre\u003e\n/frontend/config/config_example.json\n\u003c/pre\u003e\n\nJust copy this to \u003ccode\u003e/frontend/config/config.json\u003c/code\u003e and make necessary changes to it. Note that this\n\u003ccode\u003econfig.json\u003c/code\u003e file is in .gitignore so it won't go to VCS at any point.\n\n##### Notes\nIf you're changing your backend API url to another than \u003ccode\u003ehttp://localhost:1337\u003c/code\u003e you need to make\n\u003ccode\u003efrontend/config/config.json\u003c/code\u003e with proper content on it. Use that example file as start.\n\n### Running of this project\nYou have to start both \u003ccode\u003ebackend\u003c/code\u003e and \u003ccode\u003efrontend\u003c/code\u003e servers to run this project. You can do this\nby running following command on your project root directory:\n\n\u003cpre\u003e\nnpm start\n\u003c/pre\u003e\n\nThis will start back- and frontend applications for you. And if you need to start those separately see following docs\nabout that.\n\n#### Backend\n\u003cpre\u003e\ncd backend\nsails lift\n\u003c/pre\u003e\n\nThis will start sails.js server on defined port. By default this is accessible from http://localhost:1337 url. If you\ntry that with your browser you should only see page that contains \u003ccode\u003eNot Found\u003c/code\u003e message on it. This means that\neverything is ok.\n\n#### Frontend\n\n##### Development #####\n\u003cpre\u003e\ncd frontend\ngulp serve\n\u003c/pre\u003e\n\nThis will start simple web server that you can use within developing frontend side. By default this is accessible from\nhttp://localhost:3001 url. You should be see login page if you try that url with your browser.\n\n##### Deployment #####\nAs in production\n\u003cpre\u003e\ncd frontend\ngulp dist\n\u003c/pre\u003e\n\nThis will create a deployment code to ```frontend/dist``` folder. After that you can serve those static HTML, CSS,\nJavascript and asset files by any web server you like (Apache, nginx, IIS, etc.). For testing this production ready code\nyou can also use ```gulp production``` command which will serve those dist files. By default this is accessible from\nhttp://localhost:3000 url.\n\n### Possible failures\nBelow is small list of possible failures that can occur while trying this POC.\n\n\u003col\u003e\n    \u003cli\u003eSails won't lift and you get error message like: \u003ccode\u003eFatal error: watch ENOSPC\u003c/code\u003e\n        \u003cul\u003e\n            \u003cli\u003ehttp://stackoverflow.com/questions/16748737/grunt-watch-error-waiting-fatal-error-watch-enospc\u003c/li\u003e\n            \u003cli\u003etl;dr just run \u003ccode\u003enpm dedupe\u003c/code\u003e\n        \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003eFrontend side is missing some 3rd party libraries. eg. browser console is full of some errors.\n        \u003cul\u003e\n            \u003cli\u003eTry to install bower packages manually by command \u003ccode\u003ebower install\u003c/code\u003e in \u003ccode\u003efrontend\u003c/code\u003e directory.\n        \u003c/ul\u003e        \n    \u003c/li\u003e\n    \u003cli\u003eWhen running gulp serve from the frontend directory an error of 'scss-lint' is not recognized.\n        \u003cul\u003e\n            \u003cli\u003eTry running gem install scss-lint from the frontend directory.\n        \u003c/ul\u003e        \n    \u003c/li\u003e\n\u003c/ol\u003e\n\n## Demo\nThis might be up and running... or not. http://wunder.sytes.net:3000/\n\n## Who is using this?\n* All in my own sails.js projects, @tarlepp\n* [Hackday 2015 - infoTV](https://github.com/ProtaconSolutions/hackday-2015)\n* [Liukko-POC](https://github.com/ProtaconSolutions/Liukko-POC)\n* [switch168](https://github.com/switch168)\n* [home-dashboard](https://github.com/Hekku2/home-dashboard)\n\nIf you're using this please make PR and add your project to this list.\n\n## Author\nTarmo Leppänen\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) 2015 Tarmo Leppänen\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarlepp%2Fangular-sailsjs-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarlepp%2Fangular-sailsjs-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarlepp%2Fangular-sailsjs-boilerplate/lists"}