Giter VIP home page Giter VIP logo

expenses-be's Introduction

Personal Expenses API

This API provides endpoints for managing personal expenses, including authentication, expense management, requests, sessions, and documentation using Swagger.

Features

  • User authentication and authorization (only using access code, no username or password).
  • Multi-role with role-based access control.
  • CRUD operations for managing expenses.
  • Handling access requests and approvals.
  • Managing active and revoked user sessions.
  • Comprehensive API documentation with Swagger.

Technologies Used

  • Node.js 20.15
  • Express.js 4.19
  • MongoDB (or PostgreSQL)
  • Swagger (for API documentation)
  • Helmet (for HTTP headers security)
  • Express Rate Limit (for rate limiting requests)
  • CORS (for handling Cross-Origin Resource Sharing)

Getting Started

To get started with this project, follow these steps:

Prerequisites

Installation

  • Clone the repository:
git clone https://github.com/Sam7Man/expenses-be.git
cd expenses-be-main
  • Install dependencies:
npm install
  • Set up environment variables:

Run this command to create .env file :

cp .env.example .env

or create new .env file by running this command:

touch .env

Customize the existing .env file as needed.

  • User creation:

Create default user by running this command:

npm run createUser

This will create you 3 users with 3 different roles (admin, family, and viewer).

  • Start the server:
npm start

The server will run on port 3000 (or the port defined in your .env file).

API Reference

Explore the API endpoints using Swagger documentation:

Endpoint

  • Auth

  POST /api/auth/login
Parameter Type Description
account string Required. Your account code

Response:

Status Type Body
200 OK json {"token":"string"}
   POST /api/auth/logout
Parameter Type Description
- - Invalidate token

Screenshots

App Screenshot

Contributing

Contributions are welcome! Feel free to open issues or pull requests for any improvements or features you'd like to see added.

License

This project is licensed under the MIT License.

expenses-be's People

Contributors

sam7man avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.