Skip to content

BackEnd API Developed using Mongodb Expressjs Nodejs - You can build teams, create users, modify teams, testing and production environment databases separated.

License

zvdy/pokeapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokemon API

API to manage our pokemon team using Express & MongoDB database to store our data.

👨‍💻 MEN Stack

  • MongoDB
  • Express
  • NodeJS

🔨Actions to do

  • Identify ourselves
  • Add Pokemon to our team
  • Remove Pokemon from our team
  • Switch Pokemon order on our team
  • See our team

📄REST API Design

  • Credentials System

  • Add Pokemon to out team (POST /team/pokemon)

  • Remove Pokemon from our team (DELETE /team/pokemon/:id)

  • Switch Pokemon order on our team (PUT /team)

  • See our team (GET /team)

  • Authentication (POST /auth/login)

  • Express to create the server npm install express

  • Mocha and Chai for testing npm install -D mocha chai then modify package.json to add the following scripts:

"scripts": {
    "test": "NODE_ENV=test ./node_modules/.bin/mocha **/**/*.test.js"

  }
  • bcrypt to encrypt the password npm install bcrypt

  • uuid to generate unique ids npm install uuid

  • Passport for authentication in JWT npm install passport passport-local passport-http-bearer use jwt debugger to debug the token and see the payload

  • Mongoose for MongoDB npm install mongoose and npm install -D @types/mongoose to use typescript

  • Body-parser to parse the body of the request npm install body-parser

  • Axios to make http requests npm install axios

Use Postman Desktop to test the API

Or use curl in the terminal

🔮Installation

npm install

Run

npm start

Test

npm run test

Execute production server

node app.js

📚Documentation

📨 MongoDBAtlas example

alt

👨‍🏭 TODO

  • Add a Frontend (React, MERN Stack)
  • Add a Dockerfile to run the app in a container
  • Add a docker-compose.yml to run the app with a MongoDB container
  • Add a CI/CD pipeline

📝License

This project is under the MIT license. See the LICENSE file for more details.

About

BackEnd API Developed using Mongodb Expressjs Nodejs - You can build teams, create users, modify teams, testing and production environment databases separated.

Resources

License

Stars

Watchers

Forks