alirezakiaee / bvbsolution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mern Todo API

A MERN-stack API to handle To Do lists. Uses bryptjs and JWT for authentication.

Requirements

  • MongoDB (quick install: install Homebrew and run brew update && brew tap mongodb/brew && brew install mongodb-community@4.2)
    • brew update
    • brew tap mongodb/brew
    • brew install mongodb-community@4.2

Setup

NOTE: A SendGrid API key is required for email notifications.

$ git clone git@github.com:wyncode/todo-mern-api.git
$ cd todo-mern-api
$ yarn
$ cp .env.sample .env

You will then need to fill in your environment variables in your .env file.

To reset and seed your database:

$ yarn db:reset

To run your API in a local environment:

$ yarn dev

To run the endpoint testing suites (using jest and supertest)

$ yarn test

To format your code

$ yarn prettier

Add collection to your Postman account for more in-depth API documentation: Run in Postman


Deployment

$ heroku create

# replace value strings with your own values
$ heroku config:set JWT_SECRET=neverstoplearning
$ heroku config:set MONGODB_URL=yourconnectionstring
$ heroku config:set SENDGRID_API_KEY=yourapikey
$ git push heroku master

About


Languages

Language:JavaScript 96.8%Language:HTML 3.2%Language:CSS 0.1%