mkvasconcelos / mywallet-back

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backend My Wallet

About

This is a backend project for a web application. Its purpose is to provide a REST API for managing data and perfoming business logic.

Tech-StackArchitectureInstallationAPI ReferenceDeployAuthor

Tech-Stack

  • Node.js
  • Express.js
  • MongoDB
  • Joi
  • Uuid
  • Bcrypt

Architecture

The backend project is structured as a REST API with the following components:

  • Controllers: Handles incoming HTTP requests and calls the appropriate service functions.
  • Middlewares: Handles authentication and request validation.
  • Schemas: Defines the MongoDB schemas.
  • Routes: Implements the business logic for the API.

Installation

  1. Clone the repository to your local machine.
  2. Run npm install to install all dependencies.
  3. Start MongoDB locally or connect to a remote database.
  4. Create a .env file and set the DATABASE_URL.
  5. Run npm start to start the server.

API Reference

Authentication:

  • POST /sign-in -> headers:{email}, payload: {pwd}
  • POST /sign-up -> headers:{email}, payload: {name, pwd, repeatPwd}

Users:

  • GET /users -> headers: {token, email}
  • PUT /users -> headers: {token, email}, payload: {name, oldPwd, newPwd, repeatNewPwd}

Expenses:

  • GET /expenses -> headers: {token, email}
  • POST /expenses -> headers: {token, email}, payload:{value, description, status, date}
  • DELETE /expenses/:id -> headers: {token, email}, payload:{}
  • PUT /expenses/:id -> headers: {token, email}, payload:{value, description, status, date}

Deploy

The API is available on Render:

Author



About


Languages

Language:JavaScript 99.8%Language:Shell 0.2%