https://github.com/abdealijaroli/gomoni
Production-grade JSON REST API with Auth for Fintech Ventures
https://github.com/abdealijaroli/gomoni
api docker go golang jwt postgres rest
Last synced: about 1 year ago
JSON representation
Production-grade JSON REST API with Auth for Fintech Ventures
- Host: GitHub
- URL: https://github.com/abdealijaroli/gomoni
- Owner: abdealijaroli
- Created: 2024-06-14T07:02:27.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-11T15:02:31.000Z (almost 2 years ago)
- Last Synced: 2025-04-07T13:06:04.857Z (about 1 year ago)
- Topics: api, docker, go, golang, jwt, postgres, rest
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gomoni
Gomoni is a barebones banking API built from scratch in Go, emphasizing minimal dependencies and raw implementation.
## Features
- User authentication with JWT
- Account Management
- Money transfer between accounts
- PostgreSQL database integration
- Comprehensive unit tests
## Prerequisites
- Go 1.16 or higher
- PostgreSQL database (Can also just use a Docker Image for Postgres)
## Installation
1. Clone the repository:
```
git clone https://github.com/abdealijaroli/gomoni.git
cd gomoni
```
2. Install dependencies:
```
go mod tidy
```
3. Set up your PostgreSQL database and update the `.env` file with your database URL:
```
DB_URL=postgres://username:password@localhost:5432/dbname?sslmode=disable
```
4. Set your JWT secret in the `.env` file:
```
JWT_SECRET=your_jwt_secret_here
```
## Usage
1. Run the server:
```
go run *.go
```
2. The API will be available at `http://localhost:8008`
## API Endpoints
- `POST /login`: User login
- `GET /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)
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License.