NODEJS Backend starter is a highly customizable REST backend.
Report Bug
·
Request Feature
- About the Project
- Getting Started
- Usage
- Deployment
- Roadmap
- Contributing
- License
- Contact
- Acknowledgements
BACKEND is a highly customizable REST backend starter.
Here's why this is some cool shit:
- Your time should be focused on creating amazing features, not thinking about authentication, user management and project structure.
- You shouldn't have to implement simple CRUD operations over and over again.
Of course, no template will serve all projects since your needs may be different. So we made it easy to add your own mongoose plugins, services and middleware.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
The easiest way to install mongoDB is with docker. A simple docker-compose file would look like this:
version: "3.8"
services:
mongo:
image: mongo:4.2.5
ports:
- "27017:27017"
- Clone the repo
git clone git@github.com:tguelcan/backend.git
- Install dependencies
yarn
- Enter your variables in
.env.example
and rename the file to.env
Start the server with:
yarn run dev
If it succesfully started, the output should look like this: ![yarn run dev screenshot][yarn-run-dev-screenshot]
You should now be able to see the Documentation
You can run tests with:
yarn run test
/src/api/[resource-name]
Create a folder in /api and create a index.js file
- Define RBAC in /api/resource-name/rbac.js
- Define model in /api/resource-name/model.js
- Write tests in /tests/api/resoure-name.test.js
- Add middleware in /api/resource-name/index.js
- Implement controllers in /api/resource-name/controller.js
- Create your new plugin in a separate folder in
src/plugins
- Import it when necessary with
~/plugins/yourplugin
- Create a new heroku app
- Enter the needed environment variables:
JWT_SECRET=
MONGODB_URI=
You can get a free mongoDB database from MongoDB Atlas.
heroku git:remote -a <your-app-name>
git push heroku master
- Your API should now be online and accessible under: https://<your-app-name>.herokuapp.com/ 🥳
See the open issues for a list of proposed features (and known issues)
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Tayfun Gülcan - @Tayfuuu
👋 Be nice. See our code of conduct