/digital-bank-api

Digital Bank API with Node.js and Express.js

Primary LanguageJavaScriptMIT LicenseMIT

Idioma: bandeira do brasil

Digital Bank API

GitHub language count Repository size GitHub last commit License

๐Ÿ’ป About the Project

This project, part of a challenge proposed by Cubos Academy, aims to create an API for a digital bank with various banking functionalities, such as account opening, transactions, and balance inquiries.


๐Ÿ›ฃ๏ธ How to Run the Project

Follow these instructions to run the project in your local environment.

๐Ÿš€ Pre-requisites

  • You'll need Git and Node.js installed on your computer to build this app.
  • Additionally, having an editor like VSCode for coding is quite advantageous.

๐ŸŽฒ Building

# Clone the project and access the folder
$ git clone https://github.com/hamomgs/digital-bank-api.git
$ cd digital-bank-api

# Install the dependencies
$ npm install

# Run the application in development mode.
$ npm run dev

# The application will be accessible on port:3000 via http://localhost:3000.

Run in Insomnia


๐Ÿ“š API Reference

Base URL

http://localhost:3000/api

๐Ÿงฉ Endpoits

Accounts

  • GET /contas?senha_banco=Cubos123Bank: List all accounts.
  • POST /contas/: Create a new account.
  • PUT /contas/:numeroConta/usuario: Update account information.
  • DELETE /contas/:numeroConta: Delete an account.
  • GET /contas/saldo?numero_conta=123&senha=123: Get account balance.
  • GET /contas/extrato?numero_conta=123&senha=123: Get account statement.

Transactions

  • POST /transacoes/depositar: Make a deposit.
  • POST /transacoes/sacar: Make a transfer.
  • POST /transacoes/transferir: Make a withdrawal.

๐Ÿ“‚ Directory Structure

digital-bank/
โ”œโ”€โ”€ node_modules/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ controllers/
โ”‚   โ”‚   โ”œโ”€โ”€ accountsController.js
โ”‚   โ”‚   โ””โ”€โ”€ transactionsController.js
โ”‚   โ”œโ”€โ”€ middlewares/
โ”‚   โ”‚   โ””โ”€โ”€ validatePassword.js
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ accountsRoutes.js
โ”‚   โ”‚   โ”œโ”€โ”€ index.js
โ”‚   โ”‚   โ””โ”€โ”€ transactionsRoutes.js
โ”‚   โ”œโ”€โ”€ database.js
โ”‚   โ””โ”€โ”€ index.js
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ LICENCE
โ”œโ”€โ”€ package-lock.json
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ›  Technologies

๐Ÿ“ License

This project is under the license MIT.

Made with ๐Ÿงก by Hamom Silva ๐Ÿ‘‹๐Ÿฝ Get in Touch!