How fabiosperotto/api-players-express works
Game-API is an Express REST API for client authentication and game-player data, including player equipment relationships. Its main flow is HTTP routing through validation or token checks to controllers, then Sequelize models and MySQL. The README documents CORS, JSON-schema validation, JWT, and ORM synchronization; the graph reflects these capabilities. Some model and relationship behavior is documented or indexed but not shown in source excerpts, so those links are cited to the README or left unasserted where evidence is insufficient.
Main entry points: index.js ORM bootstrap · ClienteController.js Client controller · conexao.js Sequelize connection · app.js Express server
Components 19
API runtime
- Express server
app.js - Player routes
app/routes/jogador.routes.js - Client routes
app/routes/cliente.routes.js
Client identity
- Client controller
app/controllers/ClienteController.js - Token middleware
app/middlewares/TokenValido.js - Password and JWT
app/commons/helper.js - Client schema
app/schemas/cliente/novoCliente.js - Login schema
app/schemas/cliente/login.js - Client model
app/models/Cliente.js
Game domain
- Player controller
app/controllers/JogadorController.js - Player schema
app/schemas/jogador/novoJogador.js - Player model
app/models/Jogador.js - Equipment model
app/models/Equipamento.js
Persistence
- Model associations
app/models/relations.js - ORM bootstrap
app/models/index.js - Sequelize connection
app/models/conexao.js - App configuration
config.js
Other components
- API consumer
- MySQL database
Connections 26
- API consumer → Express server: sends requests
app.js - Express server → Player routes: mounts routes
app.js - Express server → Client routes: mounts routes
app.js - Express server → ORM bootstrap: initializes ORM
app.js - Player routes → Player controller: dispatches requests
app/routes/jogador.routes.js - Player routes → Token middleware: checks tokens
app/routes/jogador.routes.js - Client routes → Client controller: dispatches requests
app/routes/cliente.routes.js - Player controller → Player schema: validates input
app/controllers/JogadorController.js - Player controller → Player model: queries and mutates
app/controllers/JogadorController.js - Player controller → Equipment model: passes to query
app/controllers/JogadorController.js - Client controller → Client schema: validates registration
app/controllers/ClienteController.js - Client controller → Login schema: validates login
app/controllers/ClienteController.js - Client controller → Password and JWT: hashes and signs
app/controllers/ClienteController.js - Client controller → Client model: creates and finds
app/controllers/ClienteController.js - Token middleware → App configuration: reads JWT settings
app/middlewares/TokenValido.js - Password and JWT → App configuration: reads JWT settings
app/commons/helper.js - ORM bootstrap → Player model: loads model
app/models/index.js - ORM bootstrap → Equipment model: loads model
app/models/index.js - ORM bootstrap → Client model: loads model
app/models/index.js - ORM bootstrap → Model associations: configures relations
app/models/index.js - Player model → Sequelize connection: initializes on
app/models/Jogador.js - Equipment model → Sequelize connection: initializes on
app/models/Equipamento.js - Client model → Sequelize connection: initializes on
app/models/Cliente.js - Sequelize connection → App configuration: reads DB settings
app/models/conexao.js - ORM bootstrap → MySQL database: syncs models
README.md - Sequelize connection → MySQL database: connects to
README.md