This guide provides technical documentation for developers contributing to Memos. It covers development environment setup, project structure, build systems, code quality tools, and contribution workflows.
For detailed setup instructions, see Setting Up Development Environment. For project organization, see Project Structure and Build System.
Memos uses a dual-stack architecture with separate development toolchains for frontend and backend. The frontend build artifacts are embedded into the Go binary for production releases scripts/Dockerfile15-16
Development Environment Tools and Versions
| Component | Version | Package Manager | Purpose |
|---|---|---|---|
| Go | 1.26.2 | go.mod | Backend runtime and build AGENTS.md10 |
| Node.js | 24 | pnpm | Frontend build toolchain AGENTS.md123 |
| pnpm | 11.0.1 | npm global install | Frontend dependency management AGENTS.md123 |
| Biome | Latest | web/package.json | TypeScript/React linting and formatting AGENTS.md100 |
Title: Development Toolchain and Component Stack
Sources: AGENTS.md10-13 AGENTS.md122-123 scripts/Dockerfile1-26 scripts/Dockerfile51-54
The repository follows a monorepo structure with clear separation between frontend, backend, and protocol definitions.
Title: System Component Mapping
For a deep dive into the directory layout and build system, see Project Structure and Build System.
Sources: AGENTS.md56-75 AGENTS.md79-87
Development tasks are managed through pnpm in the web/ directory and standard go commands in the root AGENTS.md28-52
| Command | Purpose |
|---|---|
pnpm dev | Start dev server on :3001 (proxies API to :8081) AGENTS.md42 |
pnpm lint | Type check and Biome lint AGENTS.md43 |
pnpm build | Production build AGENTS.md45 |
pnpm release | Build assets to server/router/frontend/dist AGENTS.md46 |
| Command | Purpose |
|---|---|
go run ./cmd/memos --port 8081 | Start backend dev server AGENTS.md30 |
go test ./... | Run all tests AGENTS.md31 |
go test -v ./store/... | Run store tests (uses TestContainers for DB drivers) AGENTS.md32 |
cd proto && buf generate | Regenerate Go + TypeScript + OpenAPI from Protos AGENTS.md49 |
Sources: AGENTS.md28-52
Memos maintains high code quality through automated linting and a comprehensive testing strategy.
golangci-lint with strict rules (e.g., no fmt.Errorf, use errors.Wrap from github.com/pkg/errors) AGENTS.md37-91buf lint and buf format AGENTS.md50-51Memos implements multi-layer testing, notably using testcontainers-go to run integration tests against real instances of SQLite, MySQL, and PostgreSQL AGENTS.md32-82
For detailed testing requirements and linting rules, see Testing and Quality Assurance.
Memos uses Protocol Buffers to define the API contract between frontend and backend. The proto/ directory contains service definitions and generated code AGENTS.md13-68 Hand-editing generated outputs is prohibited; developers must modify .proto files and run buf generate AGENTS.md19
For instructions on modifying APIs, see Protocol Buffer Development.
Memos supports multiple languages via JSON translation files located in web/src/locales README.md66
For a guide on adding or updating translations, see Adding Localization.
We welcome contributions of all kinds. Before starting, please review our Contributing Guidelines for information on:
Sources: AGENTS.md15-22 AGENTS.md79-87 README.md58-66
Refresh this wiki
This wiki was recently refreshed. Please wait 6 days to refresh again.