Skip to main content

Coding Standards

Proxima Console is a monorepo with three main components: agent/ (Go), backend/ (Go), and frontend/ (React/TypeScript). This page provides a brief overview of the coding standards for each component. Detailed conventions are covered in dedicated pages.

Project Structure

The monorepo is organized as follows:

agent/           # Go agent service
backend/ # Go backend service
frontend/ # React/TypeScript frontend
docs/ # Standards and reference documentation
scripts/ # Build, test, and deployment scripts
backend/migrations/ # Database migration files (consolidated initial schema)

Each Go service follows a consistent internal layout: cmd/ for entrypoints, internal/ for private packages (domain, store, api, transport, worker, config), and docs/ for generated Swagger specs.

Go (Agent and Backend)

  • Standard library preferred. Use the Go standard library wherever possible before reaching for third-party packages.
  • Router: chi for HTTP routing.
  • Database: sqlx for database access with raw SQL. No ORM.
  • Logging: slog with JSON output. See the Logging page.
  • Error handling: Always wrap errors with context. See the Error Handling page.
  • Linting: golangci-lint with the project configuration in .golangci.yml.

Frontend

  • Framework: React 18 with TypeScript 5 in strict mode.
  • Styling: Tailwind CSS for utility-first styling.
  • Components: shadcn/ui as the component library.
  • Linting: ESLint and Prettier with configurations in .eslintrc.json and .prettierrc.
  • Testing: Vitest with React Testing Library. Coverage threshold enforced in vite.config.ts.

See Also

For detailed standards on specific topics:

  • Naming Conventions -- Go, SQL, TypeScript, NATS, and environment variable naming rules.
  • Error Handling -- Error wrapping, sentinel errors, and API error responses.
  • Logging -- Structured logging with slog, levels, and required fields.
  • Security -- Secrets management, SQL injection prevention, CORS, and container scanning.
  • Testing -- Test types, mocking strategies, and coverage requirements.