israelmuca / api-starter-express-node-mongo-jwt-i18n

An API starter, made with Express, Node, Mongo, JWT & i18n

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Starter

Kickstart your API Development.

After having to write several variations of this code for several different projects, I decided to create a base repo to accelerate future developments.
Leaving it Open Source to give back to the community!

Features:

🎫 - JSON Web Tokens for auth
⚖️ - Data validation with express-validator
🗺️ - i18n error messages (en_US & es_MX) with node-polyglot
📬 - Sendgrid mailer for forgot-password emails
🔐 - Basic security with Helmet
🗒️ - Requests logging with Morgan
☕ - Testing with chai
⏮️ - Babel transpilation: ES6 => ES5 (ready for Heroku deployment!)
🌿 - Seeder starter with mongo-seeding
🗣️ - Custom error logs

Getting started

Check out guide for a more thorough reading, or jump straight ahead for more concise instructions.

Run the code locally

Clone the repo, then install dependencies:

git clone https://github.com/israelmuca/api-starter-node-jwt-mongo.git myproject
cd myproject
npm i

Then, change the .env.example to .env. Also, make sure you're running mongod.

Run the API:

npm run dev

Now, you can try the automated testing; On another terminal execute:

npm run test

This will run the seeder and the tests.

Extending this code

The code is well documented, and a more thorough blog post will be made shortly. In the mean time, if you have any questions, don't hesitate and create a GitHub issue or send me a tweet.

About

An API starter, made with Express, Node, Mongo, JWT & i18n

License:MIT License


Languages

Language:JavaScript 100.0%