A web-based communication platform built with Go, SQLite, and Docker. This project allows users to create posts, comment, categorize content, and interact via likes and dislikes, featuring a robust authentication system.
This project was created to understand the fundamentals of web development, including HTTP protocols, sessions, cookies, and database manipulation. It avoids modern frontend frameworks (React, Vue, etc.) to focus on raw HTML handling and backend logic.
- Registration: Users can sign up with an Email, Username, and Password.
- Login/Logout: Secure session management using Cookies (with expiration).
- Encryption: Passwords are hashed and encrypted using bcrypt before storage.
- Validation: Checks for unique emails and handles incorrect credentials gracefully.
- Posts: Registered users can create posts with text content.
- Comments: Registered users can comment on posts.
- Categories: Posts can be associated with one or more categories for better organization.
- Visibility: Guests (non-registered users) can read posts and comments but cannot interact.
- Likes/Dislikes: Registered users can like or dislike posts and comments.
- Counters: Total likes and dislikes are visible to all users.
Users can filter the feed by:
- Specific Categories (Subforums).
- Created Posts: View posts created by the logged-in user.
- Liked Posts: View posts liked by the logged-in user.
- Backend: Go (Golang)
- Database: SQLite3
- Frontend: HTML5, CSS3 (No Frameworks)
- Containerization: Docker
- Key Packages:
github.com/mattn/go-sqlite3(Database driver)golang.org/x/crypto/bcrypt(Password hashing)github.com/google/uuid(Session ID generation)
The project uses a relational SQLite database. A typical Entity Relationship Diagram (ERD) for this project includes:
- Users: Stores ID, username, email, hashed password.
- Posts: Stores content, author ID, timestamps.
- Comments: Stores content, author ID, post ID.
- Categories: Stores category names.
- Likes/Dislikes: Join tables linking Users to Posts/Comments.
Clone the repository:
git clone [https://learn.zone01oujda.ma/git/saljaoui/forum](https://learn.zone01oujda.ma/git/saljaoui/forum)
cd forum