CodeVetter · Repo Unpack · Behavior traces
keystonejs/keystone
The inspected flows connect CLI startup, browser item creation, password login, and asset persistence to their actual execution functions. Branches such as disabled UI, failed authentication, denied queries, and frozen builds change the sequence materially. These are source-derived walkthroughs, not executed traces.
- Production startup follows cli('start') → start() → importBuiltKeystoneConfiguration() → createSystem() → importBuiltPrismaModule() → getKeystone() → connect() → createExpressServer(); --no-server returns before client/server initialization.
- After API startup, enabled UI follows createNextServer() → prepare() → createAdminUIMiddlewareWithNextApp(); PORT and HOST override listen options before httpServer.listen().
- CreateItemPage submits through useCreateItem.create(); invalid fields stop submission, otherwise serialization feeds tryCreateItem(), success clears navigation prevention and emits a toast, then the page navigates to /{list.path}/{id}.
- The generated create resolver calls createOne() → getOperationAccess() → createSingle__() → list/field access enforcement → resolveInputForCreateOrUpdate() → beforeOperation() → Prisma.create() → afterOperation(); singleton creation forces id=1.
- SigninPage submits identity/secret to the generated authentication mutation; its resolver performs sudo().db.findOne(), simulated hashing for missing password data, KDF comparison, and sessionStrategy.start(), returning failure if the token is empty.
- The next authenticated request follows withRequest() → wrapped session get() → stateless getToken()/Iron.unseal() → sudo().query.findOne(sessionData) → withSession(); missing tokens, missing users, or failed hydration leave the request unauthenticated.
- A file create resolves the Upload, opens its stream, transforms the filename, and awaits storage.put() before Prisma persistence; replacement cleanup runs after the update and deletes the old key only when it differs.
- build() bundles configuration, ensures Prisma config, then validates schemas when frozen or generates them otherwise; it generates types/client, bundles Prisma, and optionally generates/builds Next UI. postinstall selects frozen=true and ui=false.