Skip to Content
Getting startedOverview

Getting started

You do not need to know Hono or MongoDB on day one. You only need this story:

The story of one button tap

  1. Student taps “Submit answer” in the Flutter app.
  2. App sends HTTP POST to something like
    https://api.example.com/api/v1/practice-pyq/.../answer
  3. Request includes header: Authorization: Bearer eyJhbG... (access token).
  4. index.ts receives the request and forwards it to the right route file.
  5. auth.middleware.ts checks: “Is this token valid? Does the user exist?”
  6. Route parses JSON body with a validator (Zod schema).
  7. Route calls a service (e.g. grade answer, update SRS card).
  8. Service reads/writes models in MongoDB.
  9. Route returns JSON → app shows “Correct!” or “Try again”.

Nothing magic — just a pipeline.

Folders you’ll touch most

FolderBaby nameJob
src/index.tsFront doorWires URLs to route files
src/routes/Reception desksOne desk per area (auth, users, admin, …)
src/middleware/BouncersAuth, admin role, internal API key
src/services/ChefsReal rules and workflows
src/models/Filing cabinetsShape of each MongoDB collection
src/validators/Form checkers”Email must look like email”
src/config/Settings.env → typed env object, DB connect

Next pages

Last updated on