Welcome to the Bank Backend built with Go Lang using the Gin-Gonic framework and a PostgreSQL database. This backend serves as the foundation for a banking application, providing essential functionality for managing accounts, transactions, and user data. This README provides a guide on setting up and using the backend.
- User Management: Create, update, and delete user accounts.
- Account Management: Add, view, and manage bank accounts for users.
- Transaction Handling: Record and manage transactions between accounts.
- Security: Protect sensitive data with encryption and authentication.
Before setting up the Bank Backend, ensure you have the following prerequisites installed:
- Go Lang: Go programming language.
- PostgreSQL: PostgreSQL database server.
- Git: Version control tool.
-
Clone this repository:
git clone https://github.com/kingsleyocran/go-bank-backend.git cd bank-backend
-
Create a PostgreSQL database for the application. You can use the PostgreSQL command line or a GUI tool like pgAdmin to create a database and user with appropriate privileges.
-
Set up environment variables. Create a
.env
file in the root directory with the following content:
DB_DRIVER=postgres DB_SOURCE=postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable SERVER_ADDRESS=0.0.0.0:8080
Replace the placeholders with your database and secret key information.
4. Install required Go packages:
```bash
go mod tidy
-
Start the application:
go run main.go
The server should now be running at
http://localhost:8080
. -
Access the API endpoints using an API client like Postman or curl. Refer to the API documentation for available endpoints and request formats.
The Bank Backend provides a comprehensive API for managing user accounts, bank accounts, and transactions. You can access the API documentation by navigating to http://localhost:8080/swagger/index.html
when the application is running.
main.go
: Application entry point.db
: Database interaction logic, models and schemas.api
: API routes and middleware.utils
: Utility functions and helper methods.
Contributions to this project are welcome. Feel free to open issues and pull requests to help improve the Bank Backend.
This Bank Backend is open-source software released under the MIT License.