A lightweight, modern, self-hosted forum platform for small communities
Minimal โข Fast โข Extensible โข Self-hosted
๐ Quick Start โข ๐ Documentation โข ๐ค Contributing
- ๐ Secure Authentication - Session-based auth with HTTPOnly cookies
- ๐ฑ Responsive Design - Mobile-first with dark/light theme toggle
- โก Fast & Lightweight - Optimized for performance and minimal resource usage
- ๐จ Modern UI - Clean, accessible interface inspired by GitHub Discussions
- ๐ Organized Categories - Hierarchical forum structure
- ๐ฌ Rich Discussions - Threads, replies, and nested conversations
- โ๏ธ Markdown Support - Full markdown rendering with syntax highlighting
- ๐ Powerful Search - Full-text search across all content
- ๐ File Attachments - Image uploads with validation
- ๐ Notifications - In-app notifications for mentions and replies
- ๐ฅ Role-based Access - Admin, moderator, and user roles
- ๐ฉ Content Moderation - Flag inappropriate content
- ๐๏ธ Soft Delete - Maintain data integrity with soft deletion
- ๐ Admin Dashboard - Comprehensive moderation tools
- ๐ Analytics - View moderation logs and statistics
- ๐ OpenAPI Documentation - Interactive API docs at
/docs - ๐ณ Docker Ready - One-command deployment
- ๐งช Comprehensive Testing - Backend and frontend test suites
- ๐ CI/CD Pipeline - Automated testing and deployment
- ๐ Type Safety - Full TypeScript and Pydantic validation
| Component | Technology | Description |
|---|---|---|
| Frontend | Next.js + TypeScript + Tailwind CSS | Modern React framework with type safety |
| Backend | FastAPI + Python + Pydantic | High-performance async API framework |
| Database | PostgreSQL + SQLAlchemy | Robust relational database with ORM |
| Cache | Redis | Optional caching and session storage |
| Deployment | Docker + docker-compose | Containerized deployment |
| Testing | PyTest + React Testing Library | Comprehensive test coverage |
| Code Quality | Black + isort + ESLint + Prettier | Automated code formatting and linting |
Get Discuss Lite running in under 5 minutes!
- ๐ณ Docker and docker-compose
- ๐ Git
# 1. Clone the repository
git clone https://github.com/code-xon/discuss-lite.git
cd discuss-lite
# 2. Set up environment
cp .env.example .env
# Edit .env with your settings (optional - defaults work for development)
# 3. Launch the application
docker-compose up --build
# 4. Set up the database (in another terminal)
docker-compose exec backend alembic upgrade head
docker-compose exec backend python scripts/seed_data.pyOnce running, access these URLs:
| Service | URL | Description |
|---|---|---|
| ๐จ Frontend | http://localhost:3000 | Main forum interface |
| ๐ง API | http://localhost:8000 | REST API endpoints |
| ๐ API Docs | http://localhost:8000/docs | Interactive OpenAPI documentation |
| ๐๏ธ Database | localhost:5432 | PostgreSQL (if needed) |
| โก Cache | localhost:6379 | Redis (if needed) |
- Create Account - Visit http://localhost:3000/auth and sign up
- Explore Categories - Browse the seeded forum categories
- Create Thread - Start your first discussion
- Customize - Modify settings in the admin panel (
/admin)
๐ก Default Admin Account:
admin/admin123(created by seed script)
Create a .env file based on .env.example:
cp .env.example .envKey Configuration Options:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql+asyncpg://discuss:discuss_password@postgres:5432/discuss_lite |
REDIS_URL |
Redis connection string | redis://redis:6379 |
SECRET_KEY |
JWT and session signing key | Auto-generated |
APP_ENV |
Environment (development/production) |
development |
FRONTEND_URL |
Frontend application URL | http://localhost:3000 |
BACKEND_URL |
Backend API URL | http://localhost:8000 |
- RESTful - Standard HTTP methods and resource-based URLs
- Consistent Responses - Standardized JSON response format
- OpenAPI Compliant - Full API specification available
- Versioned - API versioning with
/api/v1/prefix
All API responses follow this consistent structure:
{
"success": true,
"data": {
// Response data here
},
"error": null
}Error Response:
{
"success": false,
"data": null,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message"
}
}POST /api/auth/signup # User registration
POST /api/auth/login # User authentication
POST /api/auth/logout # Session terminationGET /api/categories # List all categories
POST /api/categories # Create category (admin)
GET /api/categories/{id}/threads # Get threads in category
GET /api/threads/{id} # Get thread details
POST /api/threads # Create new thread
PUT /api/threads/{id} # Update thread
DELETE /api/threads/{id} # Delete threadPOST /api/threads/{id}/replies # Create reply
PUT /api/replies/{id} # Update reply
DELETE /api/replies/{id} # Delete reply
POST /api/uploads # Upload files
GET /api/search?q=query # Search contentPOST /api/flags # Flag content
GET /api/flags # View moderation queue (admin)Visit http://localhost:8000/docs for the interactive OpenAPI documentation where you can:
- ๐ Explore all endpoints with detailed descriptions
- ๐งช Test API calls directly in your browser
- ๐ View request/response schemas
- ๐ Authenticate and test protected endpoints
Ensure code quality with comprehensive test suites:
# Run all backend tests
docker-compose exec backend pytest
# Run with coverage report
docker-compose exec backend pytest --cov=app --cov-report=html
# Run specific test file
docker-compose exec backend pytest app/tests/test_api.py# Run frontend tests
docker-compose exec frontend npm test
# Run tests once (CI mode)
docker-compose exec frontend npm test -- --watchAll=false --coverage-
Prepare production environment:
# Create production docker-compose file cp infra/docker-compose.yml docker-compose.prod.yml # Edit for production settings (ports, environment variables)
-
Deploy with Docker:
# Build and run in background docker-compose -f docker-compose.prod.yml up --build -d # Run database migrations docker-compose -f docker-compose.prod.yml exec backend alembic upgrade head # Seed initial data (optional) docker-compose -f docker-compose.prod.yml exec backend python scripts/seed_data.py
For systems without Docker:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
alembic upgrade head
uvicorn app.main:app --host 0.0.0.0 --port 8000cd frontend
npm install
npm run build
npm start| Language | Linting | Formatting | Testing |
|---|---|---|---|
| Python | flake8 | Black + isort | PyTest |
| TypeScript | ESLint | Prettier | React Testing Library |
# Create new migration
docker-compose exec backend alembic revision --autogenerate -m "Add new feature"
# Apply migrations
docker-compose exec backend alembic upgrade head
# Rollback migration
docker-compose exec backend alembic downgrade -1
# View migration history
docker-compose exec backend alembic historydiscuss-lite/
โโโ ๐ backend/ # FastAPI Backend
โ โโโ ๐ app/
โ โ โโโ ๐ api/v1/endpoints/ # API route handlers
โ โ โโโ ๐ db/ # Database models & connections
โ โ โโโ ๐ utils/ # Helper utilities
โ โ โโโ ๐ main.py # FastAPI application
โ โ โโโ ๐ config.py # Environment configuration
โ โโโ ๐ requirements.txt # Python dependencies
โ โโโ ๐ Dockerfile # Backend container config
โโโ ๐ frontend/ # Next.js Frontend
โ โโโ ๐ src/pages/ # Next.js pages & components
โ โโโ ๐ src/styles/ # Global styles
โ โโโ ๐ package.json # Node dependencies
โ โโโ ๐ Dockerfile # Frontend container config
โโโ ๐ infra/ # Infrastructure
โ โโโ ๐ docker-compose.yml # Local development setup
โโโ ๐ scripts/ # Utility scripts
โ โโโ ๐ seed_data.py # Database seeding
โโโ ๐ .github/workflows/ # CI/CD pipelines
โโโ ๐ README.md # This file!
We welcome contributions! Here's how to get started:
# Fork and clone
git clone https://github.com/your-username/discuss-lite.git
cd discuss-lite
# Set up development environment
cp .env.example .env
docker-compose up --build
# Run tests before submitting
docker-compose exec backend pytest
docker-compose exec frontend npm test -- --watchAll=false- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with tests
- Test thoroughly:
- Backend:
docker-compose exec backend pytest - Frontend:
docker-compose exec frontend npm test - Manual testing in browser
- Backend:
- Commit with clear messages:
git commit -m "feat: Add amazing feature" - Push to your branch:
git push origin feature/amazing-feature - Create a Pull Request with detailed description
- ๐ Code Style: Follow existing patterns and run formatters
- ๐งช Testing: Add tests for new features
- ๐ Documentation: Update docs for API changes
- ๐ Compatibility: Ensure backward compatibility
- ๐จ UI/UX: Maintain consistent design patterns
- Check existing Issues
- Create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Environment details
We'd love to hear your ideas! Create an Issue with:
- Feature description
- Use case and benefits
- Implementation ideas (optional)
MIT License - see LICENSE file for details.
Copyright (c) 2025 Ramkrishna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
- ๐จโ๐ป Author: Ramkrishna
- ๐ง Email: ramkrishna@code-xon.fun
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- FastAPI - The modern Python web framework
- Next.js - The React framework for production
- PostgreSQL - The world's most advanced open source database
- Tailwind CSS - A utility-first CSS framework
- Docker - Containerization platform
Made with โค๏ธ for the open source community
โญ Star us on GitHub โข ๐ Read the docs โข ๐ Quick start