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.
- Node.js
- Express.js
- Mysql
- Redis
- Docker
- JWT
- Bcrypt.js
git clone https://github.com/emzm17/splitpay-backend.git
cd splitpay-backend/
docker-compose build
docker-compose up
GET
: Get all Users.
POST
: Create new user.
POST
: Login as User.
GET
: Get all groups current user member.
POST
: send friend request.
POST
: accept friend request.
GET
: list down friend-request user.
GET
: list down friends user.
GET
: Get expense of that group.
GET
: Get all Expenses.
GET
: Get all expense of that group.
POST
: Create expense.
GET
: Get settle the expenses.
Column | Data Type | Constraints |
---|---|---|
user_id | INT | PRIMARY KEY, AUTO_INCREMENT |
name | VARCHAR(255) | NOT NULL |
VARCHAR(255) | NOT NULL | |
password | VARCHAR(255) | NOT NULL |
totalAmount | DECIMAL(10,2) | |
totalOwe | DECIMAL(10,2) | |
totalOwed | DECIMAL(10,2) | |
friend_list | JSON |
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) |
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) |
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) |