A simple banking system built with Go, featuring user authentication, account management, and RESTful APIs.
- User registration and login with JWT authentication
- Account creation, retrieval, update, and deletion
- Secure password handling
- PostgreSQL database integration
- RESTful API endpoints
Banking-system/
├── Bank/
│ ├── Authantication/ # JWT and user login logic
│ ├── config/ # Configuration loader
│ ├── controllers/ # API server and handlers
│ ├── db/ # Database connection and storage logic
│ ├── models/ # Data models
│ ├── go.mod, go.sum # Go dependencies
│ └── main.go # Application entry point
└── README.md
- Go 1.18 or higher
- PostgreSQL database
- Clone the repository:
git clone <repo-url> cd Banking-system/Bank
- Configure your environment variables in a
.envfile:POSTGRES_URL=postgres://user:password@localhost:5432/dbname?sslmode=disable JWT_KEY=your_jwt_secret
- Install dependencies:
go mod tidy
- Run the application:
Or build and run:
go run main.go
go build -o gobank ./gobank
POST /register- Register a new userPOST /login- User loginPOST /accounts- Create accountGET /accounts/{id}- Get account by IDDELETE /accounts/{id}- Delete accountPOST /transfer- Transfer between accounts
MIT