How mlogclub/bbs-go works
Project type and purpose
• This is a full-stack, modular community forum system (“bbs-go”) composed of three main pieces:
a. server: A Go-based REST API & background services layer (Iris MVC, GORM, cron scheduler, caches, event bus)
b. site: A Nuxt.js-based server-side-rendered Vue frontend for end users
c. admin: A Vue + Arco/Element-UI SPA for administrators
File structure
• Top-level modules
• server/ – the Go backend, organized in packages:
– internal/controllers (api, admin, render)
– internal/services (business logic, event handlers)
– internal/repositories (data access)
– internal/cache, middleware, scheduler
– internal/pkg (email, sms, token, uploader, spam strategies, event bus)
– migrations, locales, config
• site/ – the Nuxt app, with pages, components, plugins, server middleware, stores
• admin/ – the Vite + Vue SPA, with src/components, src/api, store, router, config
Readme insights
• server uses Iris, GORM, Resty, cron, goquery
• site uses Nuxt.js for SSR
• admin uses Vue + Element UI (Arco)
• Supports MySQL, Redis cache, OSS image uploads, email/SMS, captcha, SEO push
Main components & their relationships
A. Frontend clients
1. Admin SPA
– Runs in browser (Arco UI) → calls REST endpoints on server/admin controllers
2. Public site (SSR)
– Nuxt server → pre-renders pages → calls REST endpoints on server/api controllers
B. API server
– Router → maps requests (api vs. admin vs. render) to Controllers
– Controllers → call Services
– Services → implement business logic, publish/subscribe events
– Repositories → CRUD on MySQL via GORM
– Cache layer (Redis) for hot data (user tokens, topic lists, tags)
– Scheduler (robfig/cron) → periodic tasks (notifications, cleanup)
– Event bus → internal event dispatch (ANTS pool) → eventhandler services
– Middleware → auth, install check, metrics
– External integrations:
• OSS Uploader (Aliyun OSS, Tencent COS)
• Email service (SMTP)
• SMS provider
• SEO push (search engine hooks)
• Captcha
C. Data stores & external services
– MySQL database (persistent storage)
– Redis (cache, captcha/session store)
– Email/SMS gateway
– Object storage (OSS)
– Search engine (if used via push API)
Architectural patterns & design principles
• Layered MVC in server: Router → Controller → Service → Repository → Model → DB/cache
• Pub/Sub event bus for decoupling side-effects (notifications, recommendations)
• Cron-driven scheduler for timed tasks
• API-first design: server exposes REST APIs for both frontends
• SSR & SPA separation: Nuxt for SEO, dynamic admin SPA