How ocdevel/gnothi works
Project type and purpose
• This is a full-stack, serverless journaling and AI toolkit called “Gnothi.”
• The frontend is a React/TypeScript single-page app in the web/ directory.
• The backend is composed of multiple serverless microservices (Node.js and Python Lambdas) managed by SST (stacks/*.ts).
• It integrates with AWS (API Gateway, Lambda, Aurora Serverless Postgres, VPC, SES, Logs, etc.) and external ML APIs (OpenAI).
File structure
• Top level: Docker-based local development (docker-compose.yml), SST config (sst.config.ts), stacks/ directory (infrastructure definitions).
• web/: React frontend, UI components, routing, data store, API client.
• services/: source for all Lambda handlers and domain logic:
– services/routes: HTTP routes (Admin, Books, Entries, Fields, Groups, Insights, Notifs, Shares, Stripe, Tags, Users).
– services/auth: custom authorizers, triggers (Cognito, WebSocket auth).
– services/data: data-access layer, migrations, ORM models, DB singleton (Node TS).
– services/ml: Node Lambda wrappers and Python containerized Lambdas for AI tasks (ask, behaviors, books, preprocess, store, summarize).
• schemas/: shared TypeScript types for API contracts.
• stacks/: high-level SST constructs grouping microservices into API, Auth, ML, Web, Logs, SES, etc.
README for additional insights
• Confirms it’s an SST site: each “local” run still deploys into a VPC (private subnets, NAT gateway), Aurora Serverless v2, SES, CloudWatch.
• Developer setup involves Docker Compose for local emulation of the DB and ML containers.
Elements
– Frontend (blue),
– API Gateway & Lambdas (green),
– Database (orange),
– AWS Infra (gray),
• Containers:
– “AWS Cloud” boundary encompassing API Gateway, Lambdas, DB, VPC, SES, CloudWatch.
– “Local Dev” boundary for Docker Compose services.