A secure and scalable banking backend system built with Go (Golang). This project is open-source and designed for learning, extension, and real-world use. It uses PostgreSQL as the main database and integrates with a locally hosted instance of the Frankfurter API for real-time currency exchange rates.
- User registration and authentication
- Bank account creation and management
- Deposits, withdrawals, and balance tracking
- Money transfers between accounts
- Multi-currency support
- Real-time currency conversion (Frankfurter API)
- PostgreSQL for persistent storage
- RESTful API architecture
- Modular and clean folder structure
| Component | Technology |
|---|---|
| Language | Go (Golang) |
| Database | PostgreSQL |
| Currency Rates | Frankfurter API (self-hosted) |
| API Style | REST |
| Dependency Mgmt | Go Modules |
| Environment Vars | .env file |
go-banking-backend/
├── account/
│ └── account.go
├── auth/
│ ├── auth.go
│ ├── errors.go
│ ├── helpers.go
│ ├── logger.go
│ ├── ratelimiter.go
│ ├── responses.go
│ └── validation.go
├── currency/
│ └── currency.go
├── db/
│ └── init.sql
├── transactions/
│ ├── deposit.go
│ └── transaction.go
├── .env.template
├── .gitignore
├── docker-compose.yml
├── Dockerfile
├── go.mod
├── go.sum
├── LICENSE
├── main.go
└── README.md
git clone https://github.com/ELadrimonos/go-banking-backend.git
cd go-banking-backendCreate a .env file from the .env.template template:
POSTGRES_USER=user
POSTGRES_PASSWORD=password
POSTGRES_DB=bankingdocker-compose up --build| Method | Endpoint | Description |
|---|---|---|
| POST | /signup |
Register a new user |
| POST | /login |
User login |
| POST | /change-password |
Change user password |
| GET | /accounts |
Get user accounts |
| POST | /create-account |
Create a new bank account |
| POST | /deposit |
Deposit money into an account |
| GET | /convert?from=USD&to=EUR&amount=100 |
Convert an amount from one currency to another |
The system communicates with a locally hosted Frankfurter API for currency conversion. Example request:
GET http://localhost:8081/latest?amount=100&from=USD&to=EUR
This project is open-source under the MIT License.
- Fork the repository
- Create a feature branch (
git checkout -b feature-name) - Commit your changes
- Open a Pull Request