This project involves building a Facebook-like social network that provides the following features:
- User authentication with sessions and cookies
- Follower system with public and private profiles
- Posts with privacy settings and multimedia support
- Group creation, membership management, and events
- Real-time chat using WebSockets
- Notifications for various actions and events
Both the backend and frontend are containerized using Docker to ensure easy deployment and maintainability.
- Registration with the following fields:
- Mandatory: Email, Password, First Name, Last Name, Date of Birth
- Optional: Avatar/Image, Nickname, About Me
- Login with session persistence using cookies
- Logout functionality
- Follow/unfollow users
- Handle follow requests for private profiles
- Automatic follow for public profiles
- Display user information, activity, and posts
- Show followers and following users
- Toggle between public and private profiles
- Create posts with images or GIFs
- Comment on posts
- Privacy settings:
- Public
- Almost private (followers only)
- Private (specific followers only)
- Create and manage groups with title and description
- Invite members and accept/decline requests
- Browse and request to join groups
- Group-specific posts and comments
- Event creation with RSVP options (e.g., "Going" or "Not Going")
- Real-time private messaging between users (via WebSockets)
- Group chat rooms
- Emoji support
- Notifications for:
- Follow requests
- Group invitations
- Requests to join a group
- New group events
- Separate UI for private messages and notifications
- Languages: HTML, CSS, JavaScript
- Frameworks: (Choose one: Next.js, Vue.js, Svelte, Mithril, etc.)
- Language: Go
- Database: SQLite
- Packages:
golang-migratefor migrationsbcryptfor password hashinggorilla/websocketfor real-time communicationuuidfor generating unique IDs
- Web Server: Caddy (or custom-built server)
- Docker images for frontend and backend
.
├── backend
│ ├── pkg
│ │ ├── db
│ │ │ ├── migrations
│ │ │ │ ├── 000001_create_users_table.up.sql
│ │ │ │ ├── 000001_create_users_table.down.sql
│ │ │ │ ├── 000002_create_posts_table.up.sql
│ │ │ │ └── 000002_create_posts_table.down.sql
│ │ └── sqlite
│ │ └── sqlite.go
│ └── server.go
├── frontend
│ ├── public
│ │ └── index.html
│ └── src
│ ├── components
│ ├── styles
│ └── main.js
├── docker-compose.yml
└── README.md
- Docker and Docker Compose installed on your machine
- Go programming environment
git clone https://github.com/your-repo/social-network.git
cd social-network- Navigate to the
backendfolder:cd backend - Build the Docker image:
docker build -t social-network-backend . - Run the backend container:
docker run -p 8080:8080 social-network-backend
- Navigate to the
frontendfolder:cd frontend - Build the Docker image:
docker build -t social-network-frontend . - Run the frontend container:
docker run -p 3000:3000 social-network-frontend
- Apply migrations:
go run backend/pkg/db/sqlite/sqlite.go
- Open the frontend in your browser at
http://localhost:3000. - Register a new user and log in.
- Explore features like creating posts, following users, and joining groups.
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add new feature" - Push to the branch:
git push origin feature-name
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or suggestions, please contact [zone01@gmail.com].