Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monicule/express-bank
Bank accounts. Homework. Learning expressjs.
https://github.com/monicule/express-bank
expressjs homework student-project
Last synced: about 2 months ago
JSON representation
Bank accounts. Homework. Learning expressjs.
- Host: GitHub
- URL: https://github.com/monicule/express-bank
- Owner: monicule
- Created: 2024-08-27T06:34:10.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-02T07:53:33.000Z (4 months ago)
- Last Synced: 2024-10-11T04:21:27.880Z (3 months ago)
- Topics: expressjs, homework, student-project
- Language: JavaScript
- Homepage: https://monicule.github.io/express-bank/
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Bank
_API project_
## 🌟 About
This project is for educational purposes only. Pull request are welcome, but priority for project authors! Thank you for your cooperation!
## 🎯 Project features/goals
- API
- Express.js## 🧰 Getting Started
### 💻 Prerequisites
Node.js - _download and install_
```
https://nodejs.org
```Git - _download and install_
```
https://git-scm.com
```Insomnia (or other equivalents) - _download and install_
```
https://insomnia.rest/download
```### 🏃 Run locally
Would like to run this project locally? Open terminal and follow these steps:
1. Clone the repo to your selected folder
```sh
git clone https://github.com/monicule/express-bank.git
```
2. Install NPM packages
```sh
npm i
```
3. Run the server
```sh
npm run dev
```## 📝 API Endpoints
### /api/account
> POST
```
/api/account
```- Creates a new account
- HTTP method - POSTData example:
```
{
"name": "John",
"surname": "Doe",
"dob": "2000-01-01"
}
```Requirements:
- Account can be created just by adults (from 18 years).
- Name and surname combination must be unique.> GET
```
/api/account/{name}-{surname}
```- Returns account owners name, surname, and date of birth.
- HTTP method - GETResponse example:
```
{
"name": "John",
"surname": "Doe",
"dob": "2000-01-01"
}
```> DELETE
```
/api/account/name-surname
```- Deletes account
- HTTP method - DELETERequirements:
- Deletes an account if the balance is zero.
> PUT
```
/api/account/name-surname
```- Updates the account details (name, surname, and date of birth).
- HTTP method - PUTData to send:
- name
- surname
- day of birth (YYYY-MM-DD)### /api/account/name
> GET
```
/api/account/john-doe/name
```Retrieves the first name of the account holder.
> PUT
```
/api/account/john-doe/name
```Updates the first name of the account holder.
### /api/account/surname
> GET
```
/api/account/john-doe/surname
```Retrieves the surname of the account holder.
> PUT
```
/api/account/john-doe/surname
```Updates the surname of the account holder.
### /api/account/dob
> GET
```
/api/account/john-doe/dob
```Retrieves the day of birth of the account holder.
> PUT
```
/api/account/john-doe/dob
```Updates the day of birth of the account holder.
### /api/withdrawal
> POST
Data to send:
- amount of money
- name
- surnameWithdraws the money form account.
### /api/deposit
> POST
Data to send:
- amount of money
- name
- surnameDeposits money to the account.
### /api/transfer
> POST
Data to send:
- sender: name
- sender: surname
- receiver: name
- receiver: surname
- amount of moneyTransfers money between accounts
## 👀 Authors
Monika: [Github](https://github.com/monicule)
## ⚠️ License
Distributed under the MIT License. See LICENSE.txt for more information.
## 🔗 Other resources
No other resources.