Gomoni is a barebones banking API built from scratch in Go, emphasizing minimal dependencies and raw implementation.
- User authentication with JWT
- Account Management
- Money transfer between accounts
- PostgreSQL database integration
- Comprehensive unit tests
- Go 1.16 or higher
- PostgreSQL database (Can also just use a Docker Image for Postgres)
-
Clone the repository:
git clone https://github.com/abdealijaroli/gomoni.git cd gomoni -
Install dependencies:
go mod tidy -
Set up your PostgreSQL database and update the
.envfile with your database URL:DB_URL=postgres://username:password@localhost:5432/dbname?sslmode=disable -
Set your JWT secret in the
.envfile:JWT_SECRET=your_jwt_secret_here
-
Run the server:
go run *.go -
The API will be available at
http://localhost:8008
POST /login: User loginGET /account: Get all accounts (requires authentication)POST /account: Create a new account (requires authentication)GET /account/{id}: Get account by ID (requires authentication)DELETE /account/{id}: Delete an account (requires authentication)POST /transfer: Transfer money between accounts (requires authentication)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.