This codebase constitutes a straightforward bank backend implemented in Golang. It enables you to perform various operations, including user creation, account creation, and money transfers between accounts. All services are exposed in a RESTful API format, ensuring easy accessibility. Furthermore, this repository incorporates JSON Web Token (JWT) and Paseto to secure the claims exchanged between endpoints. The project encompasses CRUD functionality for SQL and adheres to the ACID rules for the transaction service. Enjoy exploring and experimenting with this codebase!
- Start Postgres container
make postgres
- Generate CRUD SQL
make sqlc
- Generate Mock code for test
make mock
- Migrate DB
make migrateup
make migratedown
Before running the server, must run postgres server on port 5432 and migrate the DB!
make server
Command for test
make test
This repository draws inspiration from the project. However, certain sections of the code were outdated due to updates in some packages. Consequently, I've made the following modifications:
JWT Package: The original package has been deprecated, and in version 5, a different architecture for claims is utilized. I've implemented the JWT token maker for version 5, and it has successfully passed the unit tests.
Docker Compose File: In the original repository, a third-party package was employed to monitor the status of the Postgres container. However, a new feature called healthy check status is now available, and I have incorporated it into my version. If you're interested, you can find more details in the link.