Skip to content

Repository files navigation

Encora

Privacy-first messaging with a web app, shared validation contracts, and a Go API boundary.

Architecture

Encora is a monorepo with three pieces:

frontend/   Next.js app router UI and local form validation
common/     Shared Zod schemas used at the frontend boundary
backend/    Go 1.22 API with typed config, structured logging, and health checks

Prerequisites

  • Node.js 20 or newer
  • Go 1.22
  • Docker and Docker Compose for local services

Local Setup

  1. Copy .env.example to .env and adjust any local values.
  2. Install dependencies from the repository root with npm install.
  3. Start the frontend with npm run dev.
  4. Run the backend directly with cd backend && go run ./cmd/api or use Docker Compose.

Environment Variables

Variable Purpose Required
APP_NAME Service name used in logs and the backend app config Yes
PORT Backend listen port Yes
NEXT_PUBLIC_APP_URL Public URL used by the frontend Yes
API_BASE_URL API origin consumed by the frontend Yes
DATABASE_URL PostgreSQL connection string Yes for database-backed features
REDIS_URL Redis connection string Yes for cache-backed features
JWT_SECRET Access token signing secret Yes for auth features
JWT_REFRESH_SECRET Refresh token signing secret Yes for auth features
LOG_LEVEL Backend log level (debug, info, warn, error) Yes

Scripts

From the repository root:

  • npm run dev - start the frontend in development mode
  • npm run build - build the frontend and backend API
  • npm run lint - run the frontend linter
  • npm run test - run the frontend tests and backend Go tests
  • npm run typecheck - run the frontend TypeScript check
  • npm run go:test - run the backend test suite directly

From frontend/:

  • npm run dev
  • npm run build
  • npm run lint
  • npm run typecheck
  • npm test

Testing

Run the full local verification path from the repository root:

npm run test
npm run build

The frontend tests validate the shared auth contract. The backend tests cover the health endpoint, request ID middleware, configuration loading, and logger setup.

Deployment Notes

  • The backend reads its configuration from environment variables and should not rely on hardcoded secrets.
  • Docker Compose provides a reproducible local runtime for PostgreSQL, Redis, the API, and the frontend.
  • The repository currently ships the MVP slice only; auth, messaging, and media APIs are still planned work.

Contributing

See CONTRIBUTING.md for the working conventions used in this repository.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages