https://github.com/umutdeveloper/instagram-light
A lightweight, open-source Instagram clone built with Go (Fiber), Next.js, and PostgreSQL โ designed for performance, simplicity, and modular scalability. Includes basic features like user authentication, posts, likes, comments, and real-time notifications.
https://github.com/umutdeveloper/instagram-light
Last synced: 5 months ago
JSON representation
A lightweight, open-source Instagram clone built with Go (Fiber), Next.js, and PostgreSQL โ designed for performance, simplicity, and modular scalability. Includes basic features like user authentication, posts, likes, comments, and real-time notifications.
- Host: GitHub
- URL: https://github.com/umutdeveloper/instagram-light
- Owner: umutdeveloper
- License: mit
- Created: 2025-11-02T04:56:34.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-11-02T06:46:26.000Z (8 months ago)
- Last Synced: 2025-11-02T07:03:56.182Z (8 months ago)
- Language: Dockerfile
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐
Instagram Light
> A lightweight, open-source Instagram clone built with **Go (Fiber)**, **Next.js**, and **PostgreSQL** โ optimized for simplicity, speed, and modular scalability.
---
## ๐งญ Overview
**Instagram Light** is a minimal, fast, and modern re-implementation of Instagramโs core features โ built for learning, prototyping, and small-scale deployment.
The goal is to create a **clean, modular architecture** with production-ready patterns: authentication, database management, API design, and frontend integration โ all within a single monorepo.
---
## ๐งฑ Architecture
```
instagram-light/
โโโ backend/ # Go (Fiber) API Server
โ โโโ api/ # Route handlers
โ โโโ db/ # DB connection & migrations
โ โโโ models/ # GORM models
โ โโโ utils/ # Helpers, JWT, password hashing, etc.
โ โโโ main.go
โ
โโโ frontend/ # Next.js web app
โ โโโ app/ # App router (Next.js 14+)
โ โโโ components/
โ โโโ pages/
โ โโโ styles/
โ โโโ ...
โ
โโโ shared/ # Shared constants, types, assets
โ
โโโ infra/ # Docker, CI/CD, configs
โ โโโ docker-compose.yml
โ โโโ Dockerfile.backend
โ โโโ Dockerfile.frontend
โ โโโ ...
โ
โโโ README.md
```
---
## โ๏ธ Tech Stack
| Layer | Technology | Description |
|-------|-------------|-------------|
| **Backend** | Go (Fiber), GORM, JWT, Bcrypt | REST API, Auth, ORM |
| **Frontend** | Next.js (14+), TailwindCSS | SSR frontend & UI |
| **Database** | PostgreSQL | User/Post/Like tables |
| **Realtime** | WebSocket (Fiber) | Notifications & chat |
| **Storage** | Local โ S3 (later) | Media uploads |
| **Deployment** | Docker + Fly.io / Render / Railway | Easy cloud deploy |
| **Logging/Monitoring** | Zap or Logrus (Go) | Structured logging |
---
## ๐ช Getting Started
### 1๏ธโฃ Prerequisites
Ensure you have:
- **Go 1.22+**
- **Node.js 18+**
- **Docker & Docker Compose**
- **Git**
---
### 2๏ธโฃ Clone the Repository
```bash
git clone https://github.com//instagram-light.git
cd instagram-light
```
---
### 3๏ธโฃ Environment Variables
Create `.env` files in both `/backend` and `/frontend`.
#### `/backend/.env`
```
PORT=8080
DB_URL=postgres://postgres:password@db:5432/instagram_light?sslmode=disable
JWT_SECRET=supersecret
MEDIA_PATH=./media
```
#### `/frontend/.env.local`
```
NEXT_PUBLIC_API_URL=http://localhost:8080
```
---
### 4๏ธโฃ Docker Setup
Run everything via Docker Compose:
```bash
docker-compose up --build
```
It will:
- Start PostgreSQL
- Start Go backend (Fiber)
- Start Next.js frontend
Access:
- Frontend โ [http://localhost:3000](http://localhost:3000)
- Backend โ [http://localhost:8080/health](http://localhost:8080/health)
---
## ๐งฉ Core Features (MVP)
| Feature | Status | Description |
|----------|---------|-------------|
| ๐ค User Auth | โ
| JWT login/register/logout |
| ๐ผ๏ธ Post CRUD | ๐ | Upload & view posts |
| โค๏ธ Likes | ๐ | Like/unlike posts |
| ๐ฌ Comments | ๐ | Add/view comments |
| ๐ Notifications | ๐ง | Real-time with WebSocket |
| ๐ซ Moderation | ๐ง | Basic NSFW/keyword filter |
| ๐งฎ Analytics | ๐ | Future (optional module) |
---
## ๐งช API Example
### Health Check
```bash
GET /health
Response: { "status": "ok" }
```
### Register
```bash
POST /api/auth/register
{
"username": "testuser",
"email": "test@example.com",
"password": "123456"
}
```
---
## ๐งฐ Developer Tips
- Run backend locally without Docker:
```bash
cd backend
go run main.go
```
- Run frontend locally:
```bash
cd frontend
npm run dev
```
- Database migrations (planned via `golang-migrate`)
---
## ๐งช Testing
- **Backend tests:** `go test ./...`
- **Frontend tests:** `npm run test`
- **CI/CD:** GitHub Actions (workflow in `.github/workflows/ci.yml`)
---
## ๐ Deployment
You can deploy using:
- **Fly.io**
- **Render**
- **Railway**
- **Docker Hub + VPS**
Example:
```bash
docker-compose -f docker-compose.prod.yml up -d
```
---
## ๐ Roadmap
| Phase | Goal | Status |
|-------|------|---------|
| **Phase 1** | Basic auth, posts, likes | โ
|
| **Phase 2** | Realtime notifications | ๐ง |
| **Phase 3** | Image CDN & moderation | ๐ |
| **Phase 4** | Analytics & Admin Dashboard | ๐ |
---
## ๐งโ๐ป Contributors
| Name | Role | Contact |
|------|------|----------|
| You | Creator / Lead Dev | [GitHub](https://github.com/your-username) |
---
## ๐ชช License
This project is licensed under the **MIT License** โ free to use and modify.
```
MIT License ยฉ 2025 Umut รAKIR
```
---
## ๐ Support
If you like this project:
- โญ Star it on GitHub
- ๐ Open issues for bugs or ideas
- ๐ฌ Contribute with pull requests
---
Made with โค๏ธ using Go + Next.js