GithubHelp home page GithubHelp logo

emzm17 / splitpay-backend Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 156 KB

Splitpay is a collaborative finance management application designed to streamline the process of splitting and settling expenses among a group of users. The platform allows users to create groups, add expenses, and keep track of who owes whom.

JavaScript 99.20% HTML 0.80%
bycryptjs docker docker-compose epxressjs javascript mysql nodejs redis

splitpay-backend's Introduction

Splitpay Backend Application

Splitpay is a collaborative finance management application designed to streamline the process of splitting and settling expenses among a group of users. The platform allows users to create groups, add expenses, and keep track of who owes whom.

Table of Contents

Project Highlights

  1. Node.js
  2. Express.js
  3. Mysql
  4. Redis
  5. Docker
  6. JWT
  7. Bcrypt.js

Install

git clone https://github.com/emzm17/splitpay-backend.git
cd splitpay-backend/

Run the app

docker-compose build
docker-compose up

API

/users

  • GET : Get all Users.

/users/signup

  • POST : Create new user.

/users/signin

  • POST : Login as User.

/users/user-involved-groups

  • GET : Get all groups current user member.

/users/send-friend-request

  • POST : send friend request.

/users/accept-friend-request

  • POST : accept friend request.

/users/friend-request

  • GET : list down friend-request user.

/users/friend

  • GET : list down friends user.

/groups/:id

  • GET : Get expense of that group.

/expenses

  • GET : Get all Expenses.

/expenses/:id

  • GET : Get all expense of that group.

/expenses/create

  • POST : Create expense.

/settlement/:id

  • GET : Get settle the expenses.

Database Schema

Users Table

Column Data Type Constraints
user_id INT PRIMARY KEY, AUTO_INCREMENT
name VARCHAR(255) NOT NULL
email VARCHAR(255) NOT NULL
password VARCHAR(255) NOT NULL
totalAmount DECIMAL(10,2)
totalOwe DECIMAL(10,2)
totalOwed DECIMAL(10,2)
friend_list JSON

Group Table

Column Data Type Constraints
id INT PRIMARY KEY, AUTO_INCREMENT
name VARCHAR(255) NOT NULL
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
users_id JSON NOT NULL
created_by INT NOT NULL
FOREIGN KEY (created_by) REFERENCES users(user_id)

Expense Table

Column Data Type Constraints
expense_id INT PRIMARY KEY, AUTO_INCREMENT
amount DECIMAL(10,2) NOT NULL
description VARCHAR(255) NOT NULL
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
payer_id INT NOT NULL
group_id INT NOT NULL
FOREIGN KEY (payer_id) REFERENCES users(user_id)
FOREIGN KEY (group_id) REFERENCES group_s(id)

Friendship Table

Column Data Type Constraints
friendship_id INT PRIMARY KEY, AUTO_INCREMENT
user1_id INT NOT NULL, FOREIGN KEY (user1_id) REFERENCES users(user_id)
user2_id INT NOT NULL, FOREIGN KEY (user2_id) REFERENCES users(user_id)

splitpay-backend's People

Contributors

emzm17 avatar

Stargazers

 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.