A full-stack Social Network Application built with a Go backend and a Next.js frontend. The project demonstrates modern web development practices including clean architecture, database migrations, real-time communication, authentication, and containerization with Docker.
- User registration & login with sessions and cookies
- Profile pages (public or private)
- Ability to update profile info (avatar, nickname, about me, etc.)
- Follow/unfollow functionality with support for follow requests on private accounts
- Create posts (with images/GIFs) and comments
- Control post privacy: public, followers only, or custom private
- Group creation with invitations and join requests
- Group posts, comments, and group chat
- Group events with RSVP options (Going / Not Going)
- Private chat between users (via WebSockets)
- Group chat for all members
- Notifications system for:
- Follow requests
- Group invitations
- Group join requests
- Group event creation
- Client-side rendering and routing
- Group routing for organized navigation
- Private routes to protect authenticated pages
- Clean and responsive UI
- Three-layer architecture:
- Repository β database access
- Service β business logic
- Handler β HTTP handlers
- Database migrations with
golang-migrate - SQLite database integration
- WebSockets for chat and notifications
- Goroutines & Channels for concurrency (chat & notifications)
- Data race handling to ensure safe concurrent access
- Dockerized backend & frontend
- Separate containers for frontend and backend
- Ready for deployment with exposed ports and environment configs
frontend
βββ app
β βββ _actions
β β βββ group.js
β β βββ groupPosts.js
β β βββ posts.js
β β βββ user.js
β βββ (auth)
β β βββ login
β β β βββ loginForm.jsx
β β β βββ page.jsx
β β βββ register
β β βββ page.jsx
β β βββ registerForm.jsx
β βββ _components
β β βββ button.jsx
β β βββ components.css
β β βββ logo.jsx
β β βββ subimtButton.jsx
β βββ global.css
β βββ _hooks
β β βββ useDebouncedCallback.js
β β βββ useDebounce.js
β β βββ useInfiniteScroll.js
β βββ layout.jsx
β βββ (main)
β β βββ chat
β β β βββ chat.css
β β β βββ _components
β β β β βββ chat_components.css
β β β β βββ fetchMessages.jsx
β β β β βββ group_list.jsx
β β β β βββ userList.jsx
β β β βββ page.jsx
β β βββ _components
β β β βββ avatar.jsx
β β β βββ comments
β β β β βββ commentsCard.jsx
β β β β βββ commentsContainer.jsx
β β β β βββ comments.css
β β β β βββ commentsFooter.jsx
β β β β βββ comments.jsx
β β β βββ components.css
β β β βββ error.jsx
β β β βββ header.jsx
β β β βββ loader.jsx
β β β βββ modal
β β β β βββ modal.css
β β β β βββ modal.jsx
β β β βββ navigation.jsx
β β β βββ notifications
β β β β βββ NotificationsContainer.jsx
β β β β βββ styles.css
β β β βββ posts
β β β β βββ createPost.jsx
β β β β βββ postCard.jsx
β β β β βββ postCardList.jsx
β β β β βββ postsContainer.jsx
β β β β βββ style.css
β β β βββ tab
β β β β βββ style.css
β β β β βββ tabContent.jsx
β β β β βββ tab.jsx
β β β β βββ tabs.jsx
β β β βββ tag.jsx
β β βββ _context
β β β βββ ModalContext.js
β β β βββ NotificationContext.jsx
β β β βββ userContext.js
β β βββ groups
β β β βββ _components
β β β β βββ createEventForm.jsx
β β β β βββ createGroupForm.jsx
β β β β βββ createPostForm.jsx
β β β β βββ groupCard.jsx
β β β β βββ groupCardList.jsx
β β β β βββ groupEventCard.jsx
β β β β βββ groupEventCardList.jsx
β β β β βββ groupPostCardList.jsx
β β β β βββ inviteFriendsForm.jsx
β β β β βββ style.css
β β β β βββ userCard.jsx
β β β βββ [id]
β β β β βββ page.jsx
β β β β βββ style.css
β β β βββ page.jsx
β β βββ layout.jsx
β β βββ _lib
β β β βββ webSocket.jsx
β β βββ page.jsx
β β βββ profile
β β βββ [id]
β β βββ _components
β β β βββ profileConnections
β β β β βββ followerCard.jsx
β β β β βββ followersContainer.jsx
β β β β βββ followers.css
β β β βββ profileData
β β β β βββ abouUser.jsx
β β β β βββ profile.css
β β β β βββ userInfo.jsx
β β β βββ profilePosts
β β β βββ posts-profile.css
β β β βββ userPosts.jsx
β β βββ page.jsx
β βββ page.module.css
β βββ _utils
β βββ time.js
|____
backend
βββ database
β βββ forum.db
β βββ migrations
β β βββ 000001_create_users_table.down.sql
β β βββ 000001_create_users_table.up.sql
β β βββ ... (other migration files)
β β βββ 000018_create_notifications_table.up.sql
β βββ sqlite
β βββ sqlite.go
βββ go.Dockerfile
βββ go.mod
βββ go.sum
βββ handlers
β βββ auth
β βββ chat
β βββ group
β βββ notification
β βββ post
β βββ profile
β βββ user
βββ middleware
βββ models
βββ repositories
| βββ auth
β βββ chat
β βββ group
β βββ notification
β βββ post
β βββ profile
β βββ user
βββ routes
βββ services
| βββ auth
β βββ chat
β βββ group
β βββ notification
β βββ post
β βββ profile
β βββ user
βββ storage
|ββ main.go
βββ utils
Frontend:
- Next.js (React Framework)
- HTML, CSS, JavaScript
Backend:
- Go (Golang)
- Gorilla WebSocket
- SQLite
- Golang-Migrate
- bcrypt (password hashing)
- UUID
Infrastructure:
- Docker (multi-container setup)
git clone https://github.com/heeemzaaa/social-network.git
cd social-networkEnsure Docker is installed, then run:
docker-compose up --buildThis will spin up two containers:
- Backend (Go server)
- Frontend (Next.js app)
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080
This project was designed to cover a broad range of backend and frontend concepts:
- Authentication (sessions & cookies)
- SQL database design & migrations
- Concurrency in Go (goroutines & channels)
- Data race handling
- Real-time communication (WebSockets)
- Docker containerization
- Routing (frontend & backend)
- Clean architecture principles