01Forum is a dynamic web forum application that enables users to engage in meaningful discussions by allowing users to create, categorize, and interact with posts while maintaining a secure and efficient user authentication system. Built with Go and SQLite, Following RESTful principles and clean architecture patterns, 01Forum demonstrates how to build a scalable web application from scratch.
-
Secure Registration Flow
- Email uniqueness validation
- Username availability checking
- Password encryption using bcrypt
- Custom validation rules for input fields
-
Session Management
- UUID-based session tracking
- Cookie-based authentication
- 24-hour session expiration
- Protection against multiple concurrent sessions
- Content Creation
- Multi-category association
- Code block formatting
- Content validation and sanitization
- Real-time Features
- Like/dislike functionality
- Comment threading
- Post categories
- Real-time updates
- Category-based Filtering
- Subforum-style organization
- Multi-category support
- Dynamic management
-
Data Protection
- SQL injection prevention
- XSS protection
- Input sanitization
-
Rate Limiting
- Comment throttling
- Post creation limits
- API request limiting
-
Database Management
- SQLite integration
- Efficient query optimization
- Data integrity enforcement
-
Frontend Architecture
- Vanilla JavaScript implementation
- Dynamic content loading
- Responsive design
- Browser compatibility
Building this project from scratch provides invaluable experience in various aspects of web development:
-
Go Web Programming
- HTTP server implementation
- Router creation
- Middleware development
- Error handling patterns
-
Database Management
- SQL database design
- Query optimization
- CRUD operations
-
Authentication & Security
- Session management
- Password hashing
- Cookie handling
- Security best practices
-
Pure JavaScript
- DOM manipulation
- Event handling
- AJAX requests
-
HTML/CSS Skills
- Semantic HTML
- CSS architecture
- Responsive design
- Cross-browser compatibility
-
Architecture Patterns
- MVC pattern implementation
- Service layer design
- Repository pattern
- Clean architecture principles
-
API Design
- RESTful API development
- Status code handling
- Request/Response formatting
- API documentation
# Clone repository
git clone https://github.com/ANAS-OU/go_forum.git
cd go_forum
# Install dependencies
go mod download
go mod tidy
# Run application
go run main.go# Build image
docker build -t forum .
# Run container
docker run -p 8080:8080 forumGO_FORUM/
├── 🎮 controllers/ # controls database
├── 💾 database/ # Database initialization and schema
├── 🌐 handlers/ # HTTP request handlers
│ ├── 📡 api/ # API endpoints handlers
│ ├── 🔐 auth/ # Authentication handlers
│ ├── 🛡️ middleware/ # Request middleware
├── 📦 models/ # Data structures and types
├── 🛣️ routers/ # URL routing configuration
├── 🛠️ utils/ # Helper functions and utilities
└── 🎨 web/ # Frontend resources
├── 📂 static/ # Static assets (CSS, JS, images)
└── 📝 templates/ # HTML templates
POST /auth/register- Register new userPOST /auth/login- User loginPOST /auth/logout- User logout
GET /api/posts- Get all postsGET /api/posts/{id}- Get specific postPOST /newpost- Create new postPOST /newcomment- Add comment to postPOST /reaction- React to post/comment
GET /api/categories- Get all categories
Pull Request Process
- Fork repository
- Create feature branch
- Submit PR with description
- Ensure tests pass
Project developed by: