Leaforum is a modern, high-performance forum system built with Go, featuring a scalable architecture designed for social interaction and content sharing.
- User Authentication: Complete user registration, login, and account management
- Content Management: Post, edit, and manage articles and content
- Social Interaction: Follow users, like, comment, and collect articles
- Real-time Feed System: Hybrid push-pull feed delivery model optimized for performance
- Search Functionality: Elasticsearch-powered content search
- Notification System: Real-time event notifications
- Cloud Storage: File uploads with Aliyun OSS integration
Leaforum is built with a clean, modular architecture:
- Web Layer: API endpoints with Gin framework
- Service Layer: Core business logic
- Repository Layer: Data access abstraction
- Domain Layer: Business entities and models
- Events System: Kafka-based event processing
- Backend: Go 1.23+
- Database: MySQL 8.0+
- Cache: Redis
- Message Queue: Kafka
- Search Engine: Elasticsearch
- Cloud Storage: Aliyun OSS
- Containerization: Docker, Kubernetes
- Go 1.23+
- Docker and Docker Compose (for local development)
- MySQL 8.0+
- Redis
- Kafka
- Elasticsearch
-
Clone the repository:
git clone https://github.com/inannan423/leaforum.git cd leaforum -
Configure your environment: Create a configuration file based on the example:
cp config/[env].example.yaml config/dev.yaml
Edit the configuration file with your settings.
-
Start the required services using Docker Compose:
docker-compose up -d
-
Build and run the application:
go build -o leaforum ./leaforum
Build a Docker image and run the application in a container:
make docker
docker run -p 8080:8080 -v $(pwd)/config:/app/config leaforum:latestBuild a Linux executable:
GOOS=linux GOARCH=amd64 go build -o leaforum-linux-amd64Leaforum can be deployed on Kubernetes using the configurations in the k8s directory.
See k8s/guide.md for detailed deployment instructions.
├── config/ # Configuration files
├── docs/ # Documentation
├── internal/ # Internal application code
│ ├── domain/ # Domain models
│ ├── events/ # Event handling
│ ├── job/ # Background jobs
│ ├── repository/ # Data access layer
│ ├── service/ # Business logic
│ └── web/ # Web handlers
├── ioc/ # Dependency injection
├── pkg/ # Shared packages
├── script/ # Scripts for setup and maintenance
└── k8s/ # Kubernetes deployment configurations
