An API that simulates Fintech processes for educational purposes.
Developed initially to advance my understanding of Node.js, Express, and MongoDB, it is now freely accessible for anybody to build their own front-end applications (web or mobile).
- Git
- Node.js
- MongoDB
- SendGrid account (for email notifications)
- Twilio account (for SMS notifications)
If you want to test it locally, you can follow the following steps to install and run it successfully.
-
Clone the repository
git clone https://github.com/oredotjs/Exchequer -
Install the dependencies
npm install -
Run the server
npm start -
Test the API using Postman or any other API testing tool
This API is public and hosted by Heroku for education purposes. So if you are interested in testing it without cloning and running locally, it is also hosted online, feel free to play around referring to the Documentation. The API is a RESTful API that allows you to perform the following operations:
- Create a new account
- Create a new account for a user
- Get unique account tag
- Withdraw from an account
- Transfer from one account to another
- Get all transactions for a user
- Get all transactions for an account
- Get all transactions for a user's account
- Deposit to an account
- BASE_URL: http://localhost:3000/api/v1
- URL: '/'
- HTTP Method: GET
- Params: None
- Headers: None- URL: '/user/signUp',
- HTTP Method: POST,
- Params: None,
- Headers: None,
- Body: {
email: "test@gmail.com",
phone: "1234567890",
password: "test",
passwordConfirm: "test",
verificationMethod : Enum('email', 'phone'),
firstName : "Oreoluwa",
lastName : "Oreoluwa",
}// Response
{
"status": "success",
data: {
user: "test@gmail.com",
message: `Please check your Email / Phone for your OTP`,
},
}- URL: '/user/verifyOtp',
- HTTP Method: POST,
- Params: None,
- Headers: None,
- Body: {
email: "test@gmail.com", || phone: "1234567890",
verificationCode: "123456",
verificationMethod : Enum('email', 'phone'),
}// Response
{
"status": "success",
data: {
message: 'Account Verified! Pls Login',
},
}- URL: '/user/resendOtp',
- HTTP Method: POST,
- Params: None,
- Headers: None,
- Body: {
email: "
verificationMethod : Enum('email', 'phone'),
}// ResponseresendOtp
{
"status": "success",
data: {
user: "test@gmail.com",
message: `Please check your Email / Phone for your OTP`,
},
}- URL: '/user/login'
- HTTP Method: POST
- Params: None
- Headers: None
- Body: {
email: "test@gmail.com",
password: "test"",
} // Response
{
"status": "success",
data: {
user: "test@gmail.com",
message: `Login Successful`,
},
}- URL: '/user/getTag'
- HTTP Method: GET
- Params: None
- Headers: {
Authorization: 'Bearer <token>'
}
- Body: {
tag: "test",
}// Response
{
"status": "success",
data: {
User Object
},
}- URL: '/user/getAccountDetails'
- HTTP Method: GET
- Params: None
- Headers: {
Authorization: 'Bearer <token>'
} // Response
{
"status": "success",
data: {
User Object
},
}| Methods | Rotas | Admin | Action | Expected response | Status Code |
|---|---|---|---|---|---|
| GET | /account/getBalance | Get Account Balance | Bank account Balance | 200 | |
| GET | /account/getMyTransactions | Get all transactions from your account | Array of transactions | 200 | |
| GET | account/getMyTransactions/:id | Get a specific transaction from your account | Transaction object | 200 | |
| POST | /account/deposit | Deposit a value to the account informed | Transcation Details | 200 | |
| POST | /account/withdraw | Withdraw a value of an account informed | Transcation Details | 200 | |
| PUT | /account/transfer | Transfer a value between accounts informed | Transcation Details | 200 | |
| GET | /account/getAllTransactions | โ๏ธ | Get all transactions from all accounts | Array of transactions | 200 |
| DELETE | /bank/delete | โ๏ธ | Delete an bank account | Bank Account deleted | 202 |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Emmanuel Oreoluwa - @oreoluwadnd - awuloero13@gmail.com