This is a web-based forum application built with Go. It provides a platform for users to create posts, comment on them, like content, and interact in real-time through WebSocket connections. The application includes user authentication, session management, and a responsive frontend.
- User registration and login
- Create, view, and manage posts
- Comment on posts
- Like posts and comments
- Real-time messaging via WebSocket
- Rate limiting and security middleware
- SQLite database for data persistence
- Static file serving for frontend assets
- Go 1.22 or later
- SQLite3
-
Clone the repository:
git clone <repository-url> cd forum -
Install dependencies:
go mod download -
Set up the database:
- The application will automatically create the database schema on first run.
-
Build the application:
go build -o server . -
Run the server:
./server
The server will start on the configured port (default: 8080).
-
Build the Docker image:
docker build -t forum . -
Run the container:
docker run -p 8080:8080 forum
- Access the application at
http://localhost:8080 - Register a new account or log in
- Create posts, add comments, and interact with other users
- Use the real-time chat feature for instant messaging
- Backend: Go
- Database: SQLite
- Frontend: HTML, CSS, JavaScript
- Real-time Communication: WebSocket (Gorilla WebSocket)
- Authentication: Session-based
- Containerization: Docker
Server.go: Main server entry pointBackEnd/: Backend logic including API handlers, middleware, models, and routersFrontEnd/: Frontend assets including static files, JavaScript, and templatesassets/: Additional assets like imagesLogs/: Application logs
