How nesohq/bgce-archive works
Project type and purpose
• This is a full-stack, community-vault monorepo housing:
– Two front-end apps (Vue “archive-admin” and Next.js “archive-client”)
– Three Go microservices (“cortex”, “ecommerce”, plus a “skeleton” service template)
– Shared docs, scripts, and scaffolding
• Purpose: archive and serve Go community content via REST APIs and web UIs.
File structure
• Top-level UIs:
– archive-admin (Vue-based admin dashboard, Cypress e2e tests)
– archive-client (Next.js client portal)
• Microservices: all Go modules, each with:
– cmd/ (entrypoints)
– config/ (load environment, config)
– rest/ (HTTP handlers, middlewares, Swagger UI)
– domain packages (e.g. cortex/cache, cortex/category)
– persistence: ent ORM under ent/, database models under database/
– messaging: rabbitmq/
– util/, logger/, apm/
• Infrastructure scripts (scripts/), documentation (docs/).
Readme insights
• “cortex” handles category domain logic (CRUD, caching, message bus)
• “ecommerce” is a tutorial e-commerce API (products, reviews, users)
• “skeleton” is a template to bootstrap new microservices.
Main components
A. Clients & UIs
1. archive-client (Next.js SPA)
2. archive-admin (Vue SPA)
1. cortex service
2. ecommerce service
3. (optionally) skeleton template service
C. Data stores
1. MySQL/Postgres for each service (separate schemas)
2. Redis (for cache toggles in cortex)
D. Message broker
– RabbitMQ cluster for pub/sub events
E. Observability & infra
– APM agent (traces from microservices)
– Swagger UI (embedded in each service’s REST layer)
F. Documentation site (static docs served via GitHub Pages)
Relationships & data flows
• Browsers → HTTP(S) → archive-client / archive-admin
• UIs → invoke REST endpoints on cortex/ecommerce via API URLs
• REST handlers → domain services → ent ORM → MySQL
• cortex service → optional Redis cache reads/writes
• Domain events (e.g. “category created”) → RabbitMQ → other subscribers
• Services report spans/traces → APM back end
Architectural patterns & principles
• Hexagonal/Ports & Adapters: each service isolates domain logic (cache, repo, messaging are ports)
• Layered REST: handlers → services → repository → database
• Shared scaffolding (skeleton) enforces consistent structure across services
• CI via GitHub Actions (lint, docs build, Go tests)