Boilerplate for quick-start your REST API. Db, auth, push updates via sockets, interactive API documentation (Swagger) and unittests are already included! This project is based on Angular FullStack Generator project https://github.com/angular-fullstack/generator-angular-fullstack
You are developing a new REST API on Node.js. And you want a quick start. You need a database to store data, authentication and user management, API documentation and some other base functionality. If so, then this project is for you. And it's free!
Interactive REST API documentation Demo frontend which works with the REST API
Opening the link will probably take several seconds, because I am using a free account and the deployed application is sleeping.
You can use nodemon instead of node to run the app. It can be useful if you want to change the server's code. In the development mode local MongoDB is used.
In the production mode remote MongoDB is used (mlab.com). It can be configured in config/environment/production.js
For this you need to examine the source code in this repository. For base API URLs see routes.js. For API example endpoints examine api sub-folder. For auth look at the auth sub-folder. For sockets look at config/socketio.js file.
IMPORTANT Also I have prepared the example frontend application (React.js) which works with this backend. You saw that frontend application by the demo link above. Its source code can be found here: https://github.com/azakharo/react-starter.git This is a very good example of how to work with this server. Just examine or copy the code.
You can easily add a frontend application to this server. Just put your static content into public subdirectory. Replace the current content. As an example I put my demo frontend application there (mentioned above).
First, read the docs:
After the reading and some preparations like registering on heroku.com, the deployment is easy as:
After every application change for deployment you will do git push heroku master
This application was created with the help of Angular FullStack Generator
IMPORTANT! The generator's version I used was 3.6.1.
The generator may be only required for development. For example, to generate a new REST endpoint.
To install the generator use the following command: npm install -g [email protected]
After that read the generator's docs.