Skip to content

tguelcan/backend

Repository files navigation

Node.js CI Quality Gate Status


Logo

NODEJS Backend Starter

NODEJS Backend starter is a highly customizable REST backend.

Report Bug · Request Feature

Table of Contents

About The Project

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.

Built With

Getting Started

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.

Prerequisites

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"

Installation

  1. Clone the repo
git clone [email protected]:tguelcan/backend.git
  1. Install dependencies
yarn
  1. Enter your variables in .env.example and rename the file to .env

Usage

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

Adding routes and plugins

Adding routes

/src/api/[resource-name]

Create a folder in /api and create a index.js file

  1. Define RBAC in /api/resource-name/rbac.js
  2. Define model in /api/resource-name/model.js
  3. Write tests in /tests/api/resoure-name.test.js
  4. Add middleware in /api/resource-name/index.js
  5. Implement controllers in /api/resource-name/controller.js

Plugins

  1. Create your new plugin in a separate folder in src/plugins
  2. Import it when necessary with ~/plugins/yourplugin

Deployment

Heroku MongoDB Atlas = 👁👄👁

  1. Create a new heroku app
  2. Enter the needed environment variables:
JWT_SECRET=
MONGODB_URI=

You can get a free mongoDB database from MongoDB Atlas.

  1. heroku git:remote -a <your-app-name>
  2. git push heroku master
  3. Your API should now be online and accessible under: https://<your-app-name>.herokuapp.com/ 🥳

Roadmap

See the open issues for a list of proposed features (and known issues)

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Tayfun Gülcan - @Tayfuuu

Acknowledgements

Code of Conduct

👋 Be nice. See our code of conduct

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published