This repository contains an API designed to simulate various banking actions, including:
- Money Transfers: Transfer funds between accounts.
- Deposits: Add money to an account.
- Withdrawals: Take money out of an account.
The API also includes a robust authentication system using JWT (JSON Web Tokens) and a login feature to manage user sessions securely.
- Banking Operations: Perform transactions like deposits, withdrawals, and money transfers.
- User Authentication: Secure login system with JWT for authentication and session management.
- Database Integration: Leverages a database for storing user and transaction data.
-
Clone the repository:
git clone https://github.com/Babiel09/Bank-API.git
-
Navigate to the project directory:
cd Bank-API/src -
Install dependencies:
npm install
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add the following variables:
PORT=4857 JWT_SECRET=your_jwt_secret DB_URL=your_database_uri
- Create a
-
Start the server:
npm start
-
The API will be available at
http://localhost:4857.
-
POST /transfer/v1/deposit: Deposit money into an account. -
POST /transfer/v1/withdraw: Withdraw money from an account. -
POST /transfer/v1/transfer: Transfer money to another account. -
GET /user/v1: Get all users. -
GET /user/v1/search: Search from one user in the DB. -
GET /user/v1/:id: Get one specified user for the id. -
GET /user/v3/login: Try to made the user login. -
POST /user/v1: Post a new user. -
PUT /user/v1/:id: Updated a user with the specified id. -
DELETE /user/v2/:id: Delte one user with a specified id.
Feel free to submit issues or pull requests for improvements or bug fixes.