From d86d02867807f5cf1f73f18bf92ca017a71ebaa8 Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Fri, 7 Jul 2023 17:47:56 -0700 Subject: [PATCH 1/2] added user, walled and modified schema --- README.md | 115 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 93 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 5490274..d37a7d7 100644 --- a/README.md +++ b/README.md @@ -7,89 +7,160 @@ - [Backend](#backend) - [API Documentation](#api-documentation) - - ## About -Welcome to our personal finance app! Our app is designed to help you manage your finances and achieve your financial goals. We understand that managing your money can be stressful, time-consuming, and confusing, but we believe that it doesn't have to be. Our app provides a simple, user-friendly interface that makes it easy to track your income, expenses, and savings, so you can get a clear picture of your financial health. +Welcome to our personal finance app! Our app is designed to help you manage your finances and achieve your financial goals. We understand that managing your money can be stressful, time-consuming, and confusing, but we believe that it doesn't have to be. Our app provides a simple, user-friendly interface that makes it easy to track your income, expenses, and savings, so you can get a clear picture of your financial health. ## Installation + Run + ```bash git clone https://github.com/BinniesLite/finance_app.git ``` To start the project from the root of the project using Docker Compose, run the command `docker compose up` in your terminal. -Make sure you have Docker and docker compose installed on your machine. +Make sure you have Docker and docker compose installed on your machine. For front-end navigate to **localhost:80** and for back-end navigate to **localhost:5000** When adding a new package to the project, delete all images and dockerfile and run `docker compose up --build` to rebuild the images. - -## Backend +## Backend This is the backend of the project. It is a RESTful API built with Node.js and Express.js. It is connected to a PostgreSQL database using Docker. ### API Documentation -#### Transactions -##### Get all transactions +#### User + +##### Get all users + ```http -GET /api/transactions +GET /api/user ``` -##### Get transaction by id +##### Get transaction by email + +```http +GET /api/user/email +``` + +##### Create user + +```http +POST /api/user/create +``` + +##### Update user + ```http -GET /api/transactions/${id} +PUT /api/user/email +``` + +##### Delete user + +```http +DELETE /api/user/email +``` + +#### Wallet + +##### Get all wallets + +```http +GET /api/wallet +``` + +##### Get wallet by id + +```http +GET /api/wallet/${id} ``` ##### Create transaction + ```http -POST /api/transactions +POST /api/wallet/create ``` ##### Update transaction + ```http -PUT /api/transactions/${id} +PUT /api/wallet/${id} ``` ##### Delete transaction + ```http -DELETE /api/transactions/${id} +DELETE /api/wallet/${id} ``` +#### Transaction +##### Get all transactions +```http +GET /api/transaction +``` +##### Get transaction by id + +```http +GET /api/transaction/${id} +``` + +##### Create transaction + +```http +POST /api/transaction/create +``` + +##### Update transaction + +```http +PUT /api/transaction/${id} +``` + +##### Delete transaction + +```http +DELETE /api/transaction/${id} +``` + +#### Schema -### Schema ```mermaid erDiagram - wallet ||--o{ transactions: has + user ||--o{ wallet: has + wallet ||--o{ transaction: has + + user { + string email PK + string password + } wallet { int ID PK + string user_email FK string name float balance date created_at string payment_type - + } - transactions { + transaction { int ID PK int wallet_id FK string name float amount - date created_at + date created_at } ``` - - - ## Issues + If you have any issues with the project, please feel free to open an issue on the repo. From b0d7481c695dd39e2c941a5ed1b554008f5b0ea6 Mon Sep 17 00:00:00 2001 From: Trang Vu <89886131+tranguv@users.noreply.github.com> Date: Sat, 8 Jul 2023 23:43:20 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d37a7d7..cac82ed 100644 --- a/README.md +++ b/README.md @@ -79,19 +79,19 @@ GET /api/wallet GET /api/wallet/${id} ``` -##### Create transaction +##### Create wallet ```http POST /api/wallet/create ``` -##### Update transaction +##### Update wallet ```http PUT /api/wallet/${id} ``` -##### Delete transaction +##### Delete wallet ```http DELETE /api/wallet/${id}