The backend for the Payments App is a robust server-side application built with Node.js and Express.js. It provides APIs for user authentication, account management, and transaction processing. This document serves as a guide to understanding, setting up, and contributing to the backend component.
- Authentication: Secure signup, signin, and token-based authentication using JWT.
- User Management: APIs to manage user details and credentials.
- Balance Management: Retrieve balance and process money transfers.
- Transaction History: Store and retrieve transaction logs.
To run the backend, ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/yourusername/paymentapp.git cd paymentapp/backend -
Install dependencies:
npm install
-
Configure environment variables:
Create a
.envfile in thebackenddirectory with the following variables:DATABASE_URL=your_database_connection_string JWT_SECRET=your_jwt_secret
-
Start the server:
npm start
-
The backend server will start and listen on
http://localhost:3000by default. -
API Endpoints:
Method Endpoint Description POST /auth/signup Register a new user POST /auth/signin Login a user GET /users/:id Retrieve user details PATCH /users/:id Update user credentials GET /balance Get user balance POST /transfer Transfer money to another user
-
Postman/Insomnia: Test API endpoints manually.
-
Automated Testing: Run test cases with:
npm test
backend/
├── controllers/ # Business logic for each route
├── models/ # Database models
├── routes/ # API route definitions
├── middlewares/ # Middleware functions (e.g., authentication)
├── utils/ # Utility functions
├── tests/ # Unit and integration tests
├── app.js # Main application file
├── package.json # Dependency and script configuration
└── README.md # Documentation
We welcome contributions to improve the backend. Please:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m "Add feature"). - Push to the branch (
git push origin feature-name). - Open a pull request.
This project is licensed under the MIT License.
For inquiries or assistance, reach out to:
- Email: shivam.chem21@iitg.ac.in
- GitHub: Shivam
Thank you for contributing to the Payments App Backend!