How it fits together
The pieces behind KarmaCircle and how a click turns into saved data.
KarmaCircle is three small programs that share one database.
| Piece | What it does | Built with |
|---|---|---|
| Website | What people see and click in the browser | React |
| API | Checks every request and reads or saves data | Node.js and Express |
| Worker | Does slow jobs in the background, like sending emails | Go |
| Database | Keeps all the data | PostgreSQL |
The big picture
What happens on a click
The browser asks the API, sending the sign-in cookie along.
The API checks the request: is the person signed in, allowed, and is the input valid?
The API reads or saves data in the database and answers.
Slow work is queued. If emails need sending, the API saves a note for the worker and wakes it up. See Background jobs.
Good to know
- The website never touches the database. Everything goes through the API.
- Images go straight from the browser to storage, never through the API.
- Development and production each have their own database.
Your data
Each area lists its own data. The platform itself only adds the records it needs to stay safe and working. Everything in one place: Your data, in one place.
What we collect
| Data | When | Kept for |
|---|---|---|
| Request logs: time, address asked for, result, network address | Every request to the API | Vercel's standard log period |
| Request counters, by network address or account email | Sign-in and other limited actions | Until the time window ends, minutes to an hour |
| Background jobs, including the contents of emails waiting to go out | When a change needs an email or a total | 7 days after done, 30 days if it failed |
| Error reports: what broke and where, never the request contents | When something crashes, if switched on | Sentry's standard period |
Sign-in cookies and passwords are removed from the logs before they are written.
Why
- Request logs help find out what went wrong when someone reports a problem.
- Request counters stop people from guessing passwords or flooding the site.
- Background jobs make sure an email is sent even if a service is briefly down.
- Error reports tell the team about crashes straight away.
What we do with it
- Only the KarmaCircle team can read logs, jobs and error reports.
- Nothing here is sold or shared for advertising.
- The outside services that host or receive data are listed in Your data, in one place.
How it moves
- Vercel rewrites every API path to one function,
apps/api/api/index.ts, which waits on a database connection gate (503 on failure) except forGET /health/live. - Middleware order: helmet, compression, request logging, CORS allowlist, body parsers, cookie parser, passport, general rate limit, then routes and
errorHandler. - Each module has
routes,controller,service,validationandmodelfiles. Inputs are checked with Zod; signed-in routes userequireAuth. - Health:
GET /health/live(no database) andGET /health(503 when the database is down).
| Part | Main libraries |
|---|---|
| Web | React 19, Vite, React Router, Tailwind CSS 4, Redux Toolkit, SWR, axios |
| API | Express 4, Drizzle ORM, pg, Zod 4, passport (Google), jsonwebtoken, bcryptjs, helmet, pino, Resend, Razorpay |
| Worker | Go 1.26, pgx v5, standard library HTTP |
| Tooling | pnpm, Turborepo, GitHub Actions, Vercel CLI |
apps/api/src/app.ts builds the app.