Skip to content

rom-dem/the2euro-back

Repository files navigation

The 2 Euro Collection API REST

Maintainability Rating Coverage Technical Debt Lines of Code Code Smells

The 2 Euro Collection is an API REST built with Node.js and Express.js that connects to a MongoDB database. The API contains information about coins and users, allowing CRUD operations to be performed on coins and user authentication with JWT.

Endpoints

Coins

  • Get all coins

    • GET /coins
    • Returns an array with all coins in the database.
  • Get one coin

    • GET /coins/:id
    • Returns a specific coin based on the ID passed in the URL parameter.
  • Create a coin

    • POST /coins/create
    • Creates a new coin with the information provided in the request body.
  • Delete a coin

    • DELETE /coins/delete/:id
    • Deletes a specific coin based on the ID passed in the URL parameter.

Users

  • Login user
    • POST /users/login
    • Authenticates a user by comparing the email and password provided in the request body with the information stored in the database. If the authentication is successful, returns a JWT token that can be used for future requests that require authentication.

Tech Stack

NodeJS Express Typescript Express validation Jest Supertest MongoDB JSON Web Token

Getting Started

Run npm install to install dependencies. Create a .env file based on the .env.example file and set the necessary environment variables. Run npm start to start the server.

Clone the repository and install all the needed dependencies. npm install

To run the build use npm run build

To start the server use npm start

Testing

To run the testing suites use npm test

Frontend

This is a full stack project, you can find the frontend code here

Production: Go to The2Euro

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages