Skip to content

Leaforum is a modern, high-performance forum system built with Go, featuring a scalable architecture designed for social interaction and content sharing.

Notifications You must be signed in to change notification settings

inannan423/leaforum

Repository files navigation

LEAFORUM

LEAFORUM

中文

Leaforum is a modern, high-performance forum system built with Go, featuring a scalable architecture designed for social interaction and content sharing.

Features

  • 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

Architecture

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

Technologies

  • Backend: Go 1.23+
  • Database: MySQL 8.0+
  • Cache: Redis
  • Message Queue: Kafka
  • Search Engine: Elasticsearch
  • Cloud Storage: Aliyun OSS
  • Containerization: Docker, Kubernetes

Getting Started

Prerequisites

  • Go 1.23+
  • Docker and Docker Compose (for local development)
  • MySQL 8.0+
  • Redis
  • Kafka
  • Elasticsearch

Installation

  1. Clone the repository:

    git clone https://github.com/inannan423/leaforum.git
    cd leaforum
  2. 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.

  3. Start the required services using Docker Compose:

    docker-compose up -d
  4. Build and run the application:

    go build -o leaforum
    ./leaforum

Docker Deployment

Build a Docker image and run the application in a container:

make docker
docker run -p 8080:8080 -v $(pwd)/config:/app/config leaforum:latest

Linux Deployment

Build a Linux executable:

GOOS=linux GOARCH=amd64 go build -o leaforum-linux-amd64

Kubernetes Deployment

Leaforum can be deployed on Kubernetes using the configurations in the k8s directory.

See k8s/guide.md for detailed deployment instructions.

Development

Project Structure

├── 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

About

Leaforum is a modern, high-performance forum system built with Go, featuring a scalable architecture designed for social interaction and content sharing.

Topics

Resources

Stars

Watchers

Forks

Languages