Privacy-first messaging with a web app, shared validation contracts, and a Go API boundary.
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
- Node.js 20 or newer
- Go 1.22
- Docker and Docker Compose for local services
- Copy
.env.exampleto.envand adjust any local values. - Install dependencies from the repository root with
npm install. - Start the frontend with
npm run dev. - Run the backend directly with
cd backend && go run ./cmd/apior use Docker Compose.
| 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 |
From the repository root:
npm run dev- start the frontend in development modenpm run build- build the frontend and backend APInpm run lint- run the frontend linternpm run test- run the frontend tests and backend Go testsnpm run typecheck- run the frontend TypeScript checknpm run go:test- run the backend test suite directly
From frontend/:
npm run devnpm run buildnpm run lintnpm run typechecknpm test
Run the full local verification path from the repository root:
npm run test
npm run buildThe frontend tests validate the shared auth contract. The backend tests cover the health endpoint, request ID middleware, configuration loading, and logger setup.
- 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.
See CONTRIBUTING.md for the working conventions used in this repository.