Chirper is a minimal yet production-oriented Twitter clone backend written in Go. It aims to demonstrate building a scalable microblogging REST API using modern best-practices: clean architecture, JWT auth, PostgreSQL for persistence, Redis for caching, background workers for notifications, Dockerized deployment, and CI pipelines. Ideal as a portfolio project and interview demo.
- User signup/login with JWT (access + refresh)
- Create/read tweets, like tweets
- Follow / unfollow relationships
- Timeline generation (fan-out/fan-in options)
- Redis caching for hot timelines
- Docker Compose
Before starting, make sure you have installed on your system:
- Go 1.24+
- Docker
git clone https://github.com/mohammadvaladbiegi2/mini-twitter-go.git
cd mini-twitter-go- Install Go dependencies
go mod tidy- Start services with Docker This project includes PostgreSQL, Redis, MinIO, and pgAdmin via Docker Compose.
docker compose up -d- Prepare the database schema A ready schema.sql file is provided in the project root. Import it into the database (twitter_clone by default):
docker exec -i postgres_db psql -U admin -d twitter_clone < schema.sqlThis will create all tables, relations, and indexes.
- Run the backend API After containers are running and the schema is imported, run the API:
go run cmd/api/main.go- Explore the API with Swagger Open your browser at:
👉 http://localhost:7080/swagger/index.html
Here you can see all endpoints, request/response formats, and try out the APIs interactively.
🛠 Tech Stack Language: Go (1.24+)
Database: PostgreSQL
Cache: Redis
Object Storage: MinIO (S3-compatible)
Auth: JWT (access + refresh tokens)
Docs: Swagger (OpenAPI)
📌 Notes The .env file is included with all necessary configuration (no extra setup needed).
schema.sql ensures database structure is consistent — no need to run migrations manually.
Default services (Postgres, Redis, MinIO, pgAdmin) are all handled with Docker Compose.