How opabinia9/tcghub works
This repository is a small web authentication application. A visitor can navigate from the front-end landing page to login or account-creation pages; the sampled front-end code only confirms those navigation links, not form submission or account creation. The backend exposes login and protected routes: login validates credentials against in-memory sample users and returns a signed access token, while the protected route verifies a JWT before responding. Other front-end pages are present in the tree, but their behavior and wiring could not be confirmed from the sampled source.
Main entry points: auth.ts Auth routes · user_reposistory.ts User repository · index.ts Fastify server · script.js Page navigation
Components 20
Web front end
- Landing page
apps/FRONT-END/index.html - Page navigation
apps/FRONT-END/script.js - Login page
apps/FRONT-END/login.html - Create account page
apps/FRONT-END/create-account.html - App page
apps/FRONT-END/app.html - Cards page
apps/FRONT-END/cards.html - Decks page
apps/FRONT-END/decks.html
Authentication API
- Fastify server
apps/backend/src/index.ts - Auth routes
apps/backend/src/routes/api/v1/auth.ts - Login schema
apps/backend/src/routes/api/v1/routeschemas.ts - Auth controller
apps/backend/src/controllers/authController.ts - JWT verifier
apps/backend/src/decorators/jwtDecorator.ts - JWT plugin
User lookup
- User facade
apps/backend/src/services/facade.ts - User repository
apps/backend/src/persistence/user_reposistory.ts - In-memory users
apps/backend/src/persistence/user_reposistory.ts - Repository base
apps/backend/src/persistence/reposistory.ts - User type
apps/backend/src/persistence/types.ts - Not-found error
apps/backend/src/errortypes/notFoundError.ts
Other components
- Visitor
Connections 21
- Visitor → Landing page: opens
- Landing page → Page navigation: uses
- Page navigation → Login page: navigates
- Page navigation → Create account page: navigates
- Visitor → App page: opens
- Visitor → Cards page: opens
- Visitor → Decks page: opens
- Fastify server → Auth routes: registers
- Fastify server → JWT plugin: registers
- Fastify server → JWT verifier: registers
- Auth routes → Login schema: validates with
- Auth routes → Auth controller: dispatches to
- Auth routes → JWT verifier: guards with
- Auth controller → User facade: looks up user
- User facade → User repository: queries
- User repository → In-memory users: reads
- User repository → Repository base: extends
- User repository → User type: uses type
- User facade → Not-found error: throws
- Auth controller → JWT plugin: signs token
- JWT verifier → JWT plugin: verifies token