How mayachakra/pokeportal works
PokePortal is a Pokémon web app with account signup/login, a Pokédex, battles, and a quiz that assigns a Pokémon. The main workflow runs from a browser through Express routes to page rendering or API responses; quiz and battle handlers use Pokémon data and the database. The graph includes the documented Pokédex capability, but the supplied excerpts do not show its implementation or route wiring. Frontend scripts and templates are shown as product surfaces; their client-to-API connections are not evidenced in the excerpts.
Main entry points: models/index.js Model associations · api/index.js API dispatcher · server.js Express server · quiz-routes.js Quiz assignment
Components 17
Web application
- Express server
server.js - Page routes
controllers/home-routes.js - API dispatcher
controllers/api/index.js - Rendered pages
views - Browser scripts
public/js
Accounts and sessions
- Signup and login
controllers/api/user-routes.js - Login routes
controllers/api/login-routes.js - Session handling
server.js
Pokémon features
- Quiz assignment
controllers/api/quiz-routes.js - Battle simulation
controllers/api/battle-routes.js - Pokédex
models/Pokemon.js
Persistence
- Model associations
models/index.js - User records
models/User.js - Pokémon records
models/Pokemon.js
Other components
- Trainer browser
- PokéAPI
- PostgreSQL
Connections 21
- Trainer browser → Express server: sends requests
README.md - Express server → Page routes: mounts routes
server.js - Express server → API dispatcher: mounts routes
server.js - Page routes → Rendered pages: renders pages
controllers/home-routes.js - Trainer browser → Browser scripts: uses features
- API dispatcher → Signup and login: dispatches requests
controllers/api/index.js - API dispatcher → Login routes: dispatches requests
controllers/api/index.js - API dispatcher → Quiz assignment: dispatches requests
controllers/api/index.js - API dispatcher → Battle simulation: dispatches requests
controllers/api/index.js - Express server → Session handling: configures sessions
server.js - Signup and login → Model associations: uses models
controllers/api/user-routes.js - Login routes → Model associations: uses models
controllers/api/login-routes.js - Quiz assignment → Model associations: uses models
controllers/api/quiz-routes.js - Battle simulation → Model associations: uses models
controllers/api/battle-routes.js - Model associations → User records: associates records
models/index.js - Model associations → Pokémon records: associates records
models/index.js - User records → PostgreSQL: persists via
- Pokémon records → PostgreSQL: persists via
- Battle simulation → PokéAPI: fetches Pokémon
controllers/api/battle-routes.js - Quiz assignment → PokéAPI: fetches species
controllers/api/quiz-routes.js - Trainer browser → Pokédex: explores species