Bank Transactions is a Node.js application that provides an API for managing bank accounts and transactions. This project uses Express for routing, Knex for database operations with PostgreSQL, and TypeScript for type safety.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Clone the repository
git clone https://github.com/yourusername/bank-transactions.git
cd bank-transactions
- Install dependencies
npm install
Create a .env file in the root of the project and add your database configuration:
DATABASE_HOST=localhost DATABASE_USER=yourusername DATABASE_PASSWORD=yourpassword DATABASE_NAME=bank DATABASE_PORT=5432
- Create the database:
npm run db:create
- Run Database migrations to set up the necessary tables:
npm run db:migrate
- Start the application in development mode:
npm run dev
The application should now be running at http://localhost:3000.
- GET /account Retrieve all accounts.
- GET /account/:id: Retrieve a single account by ID.
- POST /account Create a new account.
- DELETE /account/:id: Delete an account by ID.
- GET /transaction/ Retrieve all transactions.
- GET /transaction/:id Retrieve a single transaction by ID.
- POST /transaction Create a new transaction.