Sign inSign up

sisqueslabs/gardenia-api

By sisqueslabs

•Updated about 1 month ago

Image
0

10K+

sisqueslabs/gardenia-api repository overview

⁠Gardenia API

Backend for Gardenia — a gardening companion that keeps your green spaces organized, shared, and easy to look after. DDD + CQRS + Hexagonal architecture on NestJS, TypeORM/PostgreSQL, JWT + OAuth (Google/GitHub/Apple) auth with multi-tenant spaces, optional Kafka event forwarding, REST (Swagger) + GraphQL (Apollo) transports, OpenTelemetry traces + metrics + logs, and an MCP endpoint.

⁠Quick start

# OAUTH_TOKEN_ENC_KEY must be a 32-byte base64 key, e.g. `openssl rand -base64 32`
docker run -p 3000:3000 \
  -e DATABASE_HOST=host.docker.internal \
  -e DATABASE_PORT=5432 \
  -e DATABASE_USERNAME=gardenia \
  -e DATABASE_PASSWORD=secret \
  -e DATABASE_DATABASE=gardenia_db \
  -e JWT_SECRET=change_me_in_production \
  -e OAUTH_TOKEN_ENC_KEY=change_me_in_production \
  -e OAUTH_STATE_SECRET=change_me_in_production \
  sisqueslabs/gardenia-api:latest

The container needs a reachable PostgreSQL instance — it does not bundle one.

⁠Ports

PortPurpose
3000HTTP — REST (/api/*), GraphQL (/graphql), Swagger docs, health, MCP (see routes below)

⁠Routes

PathPurpose
GET /api/health/liveLiveness probe
GET /api/health/readyReadiness probe (checks DB connectivity)
POST /api/mcpMCP (Model Context Protocol) endpoint — auth required, exposes every bounded context's commands/queries as tools
POST /graphqlGraphQL (Apollo)
GET /docsSwagger UI

Traces, metrics, and logs are pushed via OTLP to a collector (see OTEL_EXPORTER_OTLP_ENDPOINT below) — there is no in-process /metrics endpoint to scrape. Logs still go to stdout/file regardless.

⁠Environment variables

VariableDefaultRequiredNotes
PORT3000NoHTTP port
NODE_ENVproductionNo
DATABASE_DRIVERpostgresNoOnly postgres is supported
DATABASE_HOST—Yes
DATABASE_PORT5432No
DATABASE_USERNAME—Yes
DATABASE_PASSWORD—Yes
DATABASE_DATABASE—Yes
JWT_SECRET—YesSigns access tokens
JWT_EXPIRES_IN7dNo
REFRESH_TOKEN_TTL_DAYS30No
OAUTH_TOKEN_ENC_KEY—Yes32-byte base64 key (AES-256-GCM) encrypting stored OAuth provider tokens
OAUTH_STATE_SECRET—YesSigns the OAuth state JWT (CSRF protection)
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET / GOOGLE_CALLBACK_URL—Only if Google sign-in is used
GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET / GITHUB_CALLBACK_URL—Only if GitHub sign-in is used
APPLE_CLIENT_ID / APPLE_TEAM_ID / APPLE_KEY_ID / APPLE_PRIVATE_KEY / APPLE_CALLBACK_URL—Only if Sign in with Apple is used
QR_BASE_URLhttp://localhost:3000NoBase URL embedded in plant QR deep links
CORS_ORIGINS—Production onlyComma-separated allowed origins
OTEL_EXPORTER_OTLP_ENDPOINT—NoOpenTelemetry traces+metrics+logs disabled when unset
KAFKA_ENABLEDfalseNoDomain event forwarding; app boots fine without a broker when disabled
KAFKA_BROKERS—If Kafka enabledComma-separated broker list
FILES_STORAGE_DRIVERdatabaseNodatabase or s3; S3 vars only required when set to s3

See the project's .env.example for the full list, including per-provider OAuth variables and S3 file-storage settings.

⁠Tags

  • latest — most recent stable release (main branch)
  • x.y.z — specific stable release
  • x.y.z-alpha.n / -beta.n / -rc.n — prereleases from develop/staging

⁠Source

https://github.com/sisques-labs/gardenia-api⁠

Tag summary

Content type

Image

Digest

sha256:c37edbe6b…

Size

125.9 MB

Last updated

about 2 months ago

docker pull sisqueslabs/gardenia-api