Skip to content
 
 

Latest commit

 

History

180 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Network - Facebook-like App

Docker
Go
Next.js

A fullstack Facebook-like social network with followers, profiles, posts, groups, notifications, and chats. Built with Go (backend), Next.js (frontend), SQLite, and Docker Compose.


🚀 Features

  • Authentication: Registration, login, sessions & cookies, optional avatar, nickname, about me.
  • Profile: Public/private profiles, posts feed, followers/following.
  • Posts: Create posts/comments with images/GIFs, configurable privacy.
  • Followers: Follow/unfollow, request system for private profiles.
  • Groups: Create/join groups, invite/accept requests, group posts, events.
  • Chat: Private and group chats with WebSockets and emojis.
  • Notifications: Follow requests, group invites, events, real-time alerts.

🗂 Project Structure

backend/
├── cmd/main.go
├── Dockerfile
├── internal/
│   ├── db/
│   │   ├── migrations/sqlite
│   │   ├── followersQuery/
│   │   ├── notificationQuery/
│   │   ├── profileQuery/
│   │   ├── query/
│   │   ├── sqlite/
│   │   └── uploads/
│   ├── handlers/
│   ├── models/
│   └── utils/
└── server/
    ├── middleware.go
    └── server.go

frontend/
├── package.json
├── Dockerfile
└── pages/

SQLite database: backend/internal/db/sqlite/data_base.db
Migrations: backend/internal/db/migrations/sqlite


🐳 Running with Docker Compose

1️⃣ Build and run

docker-compose up --build

2️⃣ Access the application

3️⃣ Volumes

  • uploads_data → stores uploaded files
  • db_data → stores SQLite database

4️⃣ Network

  • All services run on app-network for internal communication

💻 Frontend (Next.js)

  • Fully responsive UI
  • Communicates with backend via NEXT_PUBLIC_BACKEND_URL
  • Development:
cd frontend
npm install
npm run dev

🔧 Backend (Go)

  • Handles API requests, database operations, and WebSockets
  • Auto-applies migrations on startup via sqlite.go
  • Run locally:
cd backend
go run cmd/main.go

🔒 Security

  • Passwords hashed with bcrypt
  • Session & cookie authentication
  • Input validation for all endpoints

📦 Packages Used

  • Go standard packages
  • Gorilla Websocket
  • golang-migrate / sql-migration
  • SQLite3
  • bcrypt
  • UUID

🌟 Learning Outcomes

  • Fullstack development (Next.js + Go)
  • Authentication with sessions & cookies
  • Docker Compose for multi-container apps
  • Real-time communication with WebSockets
  • SQL database management & migrations

📄 License

MIT License


💡 Tip: Your docker-compose.yml is already configured to run both backend and frontend together. Just run:

docker-compose up --build

Frontend will automatically connect to backend at http://backend:8080 inside the Docker network.

About

Facebook-like social network

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages