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-Stack • Architecture • Installation • API Reference • Deploy • Author
- Node.js
- Express.js
- MongoDB
- Joi
- Uuid
- Bcrypt
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.
- Clone the repository to your local machine.
- Run
npm install
to install all dependencies. - Start MongoDB locally or connect to a remote database.
- Create a
.env
file and set theDATABASE_URL
. - Run
npm start
to start the server.
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}
The API is available on Render: