https://github.com/morepriyam/payments-app
Peer to Peer Transactions
https://github.com/morepriyam/payments-app
bycrypt docker expressjs javascript jwt-authentication mongo mongoose node reactjs recoil tailwindcss zod
Last synced: about 2 months ago
JSON representation
Peer to Peer Transactions
- Host: GitHub
- URL: https://github.com/morepriyam/payments-app
- Owner: morepriyam
- License: mit
- Created: 2024-02-11T15:23:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T08:56:17.000Z (about 2 years ago)
- Last Synced: 2026-01-03T12:23:13.677Z (5 months ago)
- Topics: bycrypt, docker, expressjs, javascript, jwt-authentication, mongo, mongoose, node, reactjs, recoil, tailwindcss, zod
- Language: JavaScript
- Homepage: https://paymentsapp.in
- Size: 829 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Payments-App
#### Seamlessly manage transactions, transfer funds securely, and connect with friends effortlessly in one intuitive platform.
#### [paymentsapp-priyam.vercel.app](https://paymentsapp-priyam.vercel.app)
##### Configure .env in /backend
### Database 
```bash
cd Payments-App
docker build ./ -t mongodb:4.7-replset
docker volume create mongodbdata
docker run --name mongodb-replset -p 27017:27017 -v mongodbdata:/data/db -d mongodb:4.7-replset
```
### Run Backend - Express 
```bash
cd backend
npm i
node --watch index.js
```
### Run Frontend - React - 
```bash
cd frontend
npm i
npm run dev
```
### Backend Routes
### /api/v1/user
- `/signup`:
- Allows users to sign up by providing required information such as username, email, password, first name, last name, etc.
- Checks for uniqueness of username, email, and phone number.
- Hashes the user's password using bcrypt before saving it to the database.
- Generates a JWT token upon successful signup for authentication.
- `/signin`:
- Allows users to sign in by providing either their username or email along with their password, or their phone number and password.
- Verifies the credentials provided against the stored user data.
- If the credentials are valid, generates a JWT token for authentication.
- `/update`:
- Allows authenticated users to update their profile information.
- Validates the input against a schema to ensure correct data types and format.
- Updates the user's information in the database.
- `/bulk`:
- Retrieves a list of users based on a filter provided in the query parameter.
- Searches for users whose first name, last name, or username matches the provided filter using regex.
- Returns an array of user objects containing their username, first name, last name, image url and user ID.
- `/addfriend`:
- Allows authenticated users to add other users as friends.
- Adds the specified user to the current user's list of friends if the user exists.
- Returns a success message upon successfully adding the friend.
- `/friends`: test-p
- Retrieves a list of friends for the authenticated user.
- Retrieves the friends' information from the database and filters out unnecessary fields.
- If both friends have added each other, displays their email and phone number.
- Otherwise, displays only basic information such as username, first name, last name, and image URL.
- `/receivedfriendrequests`:
- Allows authenticated users to receive friend requests
### /api/v1/account
- `/balance`:
- Retrieves the account balance for the authenticated user.
- Queries the database to find the account associated with the user ID.
- Returns the balance if the account exists, otherwise returns a 404 error.
- `/transfer`:
- Allows authenticated users to transfer funds to another account.
- Initiates a transaction using MongoDB session.
- Verifies if the user has sufficient balance for the transfer.
- Updates the balances of both the sender and the recipient accounts.
- Commits the transaction if successful, otherwise aborts it and returns an error message.
- `/deposit`:
- Allows authenticated users to add funds to their account.
### /api/v1/transactions
- `/`:
- Allowed authenticated users to see their past transactions.
- Added appropriate schema.
- New transaction on signup and transfers and deposit endpoint.
### Pending Features
- `Landing Page needs to me more preety`:Pending
- `My friends component`:Pending
- `More Money Related Features`: Pending
- `Friends can message each other` 🫂: Pending - Postponed
- Allow authenticated friends to text each other.
- Message Notifications
### Frontend
- `SignUp,SignIn and Landing Page`✅
- `Transactions Page`✅
- `SendMoney Page`✅
- `Dashboard Page`✅
- `Friends Page` ✅
- `Profile Page` ✅
### Optimization
- `Performance` 💯
- `Accessibility` 💯
- `Best Practices` 💯
- `SEO` 💯
- `Progressive Web App` 💯