https://github.com/fr13nd230/gobank
This project is way simple just to get hands on golang in backend development and familiarize my self with its echo systems and best practices. Feel free to contribute to this at any time or feel inspired.
https://github.com/fr13nd230/gobank
backend banking caching fiber graphql hands-on migration postgresql practice public redis
Last synced: 12 months ago
JSON representation
This project is way simple just to get hands on golang in backend development and familiarize my self with its echo systems and best practices. Feel free to contribute to this at any time or feel inspired.
- Host: GitHub
- URL: https://github.com/fr13nd230/gobank
- Owner: fr13nd230
- License: mit
- Created: 2025-06-01T14:31:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-09T20:06:03.000Z (about 1 year ago)
- Last Synced: 2025-06-09T21:19:54.419Z (about 1 year ago)
- Topics: backend, banking, caching, fiber, graphql, hands-on, migration, postgresql, practice, public, redis
- Language: Go
- Homepage:
- Size: 7.45 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฆ GoBank
> *"The only way to make sense out of change is to plunge into it, move with it, and join the dance."* - Alan Watts
Welcome to **GoBank** - where your money is safer than a squirrel's nuts in winter! ๐ฟ๏ธ This is my personal playground for mastering Go backend development, because let's face it, someone's gotta keep those zeros and ones in line.
[](https://golang.org/)
[](https://opensource.org/licenses/MIT)
[](https://www.postgresql.org/)
[](https://www.docker.com/)
[](https://gofiber.io/)
[](https://github.com/fr13nd230/gobank)
## ๐ฏ What's This All About?
GoBank is my humble attempt at building a banking system in Go - think of it as a digital piggy bank, but with more code and fewer coins rattling around. The main goal? To get cozy with the **Fiber framework** and prove that Go can handle financial shenanigans better than my actual bank handles my overdraft fees! ๐ธ
*"Code is like humor. When you have to explain it, it's bad."* - Cory House
## ๐ ๏ธ Tech Stack
- **Go 1.24.2** - Because life's too short for slow languages
- **Fiber Framework** - Fast, Express-inspired web framework (coming soon to a codebase near you!)
- **PostgreSQL** - Where your data lives rent-free
- **Docker** - Containerization magic โจ
- **SQLC** - Type-safe SQL generation
- **golang-migrate** - Database migration wizardry
## ๐ฆ Dependencies
```go
// The usual suspects
github.com/google/uuid v1.6.0 // For unique IDs (like snowflakes, but digital)
github.com/jackc/pgx/v5 v5.7.5 // PostgreSQL driver that actually works
github.com/joho/godotenv v1.5.1 // Because hardcoding secrets is for amateurs
github.com/stretchr/testify v1.10.0 // Testing made bearable
```
**Note:** Fiber framework will join the party once I stop procrastinating and actually install it! ๐
## ๐ Getting Started
### Prerequisites
Make sure you have these installed, or this journey ends before it begins:
- **Go 1.24.2+** - [Download here](https://golang.org/dl/)
- **Docker & Docker Compose** - [Get Docker](https://www.docker.com/get-started)
- **golang-migrate** - Install with: `go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest`
### Installation
1. **Clone this masterpiece:**
```bash
git clone https://github.com/fr13nd230/gobank.git
cd gobank
```
2. **Set up your environment:**
```bash
cp .env.example .env
# Edit .env with your database credentials (no, 'password123' is not secure)
```
3. **Fire up the containers:**
```bash
make cmp-up
```
4. **Run migrations:**
```bash
make migrate-up
```
5. **Start the server:**
```bash
make run
```
*"It's not a bug, it's a feature!"* - Every developer ever
## ๐ฎ Available Commands
Our Makefile is like a Swiss Army knife, but for code:
| Command | Description | Fun Factor |
|---------|-------------|------------|
| `make build` | Build the application | ๐จ Hammer time! |
| `make test` | Run tests with coverage | ๐งช Science! |
| `make run` | Start the server | ๐ Blast off! |
| `make cmp-up` | Start Docker containers | ๐ณ Wake the whale! |
| `make cmp-down` | Stop Docker containers | ๐ด Nap time! |
| `make createdb` | Create database | ๐๏ธ Birth of data |
| `make dropdb` | Drop database | ๐ฅ Digital demolition |
| `make connectdb` | Connect to database | ๐ Phone home |
| `make migrate-up` | Run migrations up | โฌ๏ธ Leveling up |
| `make migrate-down` | Run migrations down | โฌ๏ธ Going backward |
| `make fixdirty` | Fix dirty migrations | ๐งน Spring cleaning |
| `make gensqlc` | Generate SQLC code | ๐ญ Code magic |
## ๐ค Contributing
Contributing to GoBank is easier than explaining why you need another banking app:
### Branch Naming Convention
- `feature/awesome-new-thing` - For new features that'll blow minds
- `fix/that-annoying-bug` - For squashing bugs like a pro
- `config/environment-setup` - For configuration changes
- `test/unit-coverage` - For test improvements
### Commit Message Format
Follow this pattern or face the wrath of inconsistent git history:
```
GB | purpose(scope): Your brilliant message here
Examples:
GB | feat(auth): Add user authentication with JWT tokens
GB | fix(database): Resolve connection pool leak issue
GB | test(unit): Creating unit tests for account service
GB | config(docker): Update PostgreSQL version in compose file
```
### The Sacred Rules
1. **Always open a Pull Request** - No direct pushes to main (we're civilized here)
2. **Unit Tests are MANDATORY** - If it's not tested, it doesn't exist
3. **Minimum 90% test coverage** - Because 89% is for quitters
4. **Code reviews are your friend** - Two pairs of eyes are better than one
*"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."* - Martin Fowler
## ๐งช Testing
We take testing seriously here (unlike my diet):
```bash
make test
```
This will run all tests with coverage reporting. If you're not hitting 90% coverage, you're not trying hard enough! ๐
## ๐ณ Docker Support
Because "it works on my machine" is not a valid deployment strategy:
- **Development**: `make cmp-up`
- **Cleanup**: `make cmp-down`
## ๐๏ธ Database
PostgreSQL is our database of choice because:
- It's reliable (unlike my sleep schedule)
- It handles complex queries (unlike my brain on Monday mornings)
- It's open source (like my admiration for good code)
## ๐ License
This project is licensed under the MIT License - because sharing is caring, and lawyers are expensive.
## ๐ฏ Final Words
*"The best time to plant a tree was 20 years ago. The second best time is now."* - Chinese Proverb
The same goes for learning Go - start now, thank yourself later!
---
**Built with โค๏ธ and probably too much coffee by [fr13nd230](https://github.com/fr13nd230)**
*Remember: In code we trust, but we test everything else!* ๐