How sithscript/projeto-clinipet works
CliniPet’s stated centerpiece is a normalized veterinary-clinic database, with a REST API and browser panel as additions. The main user flow is navigating the panel, selecting a clinic or report screen, and viewing or managing data exposed by the API. The API routes requests through controllers to repositories and the configured database. The README documents SQL schema, seed data, validation queries, views, and analytics, but those database files are absent from the supplied tree; their internals are therefore shown only as documented capabilities. Some controller and repository links rely on the SOURCE INDEX rather than excerpts.
Main entry points: main.js Browser entry and navigation · database.ts Database selection · entity.js Entity screens · CrudController.ts CRUD controller
Components 27
Database core
- Relational schema and SQL
- Database selection
src/config/database.ts - Embedded SQLite
src/config/sqlite.ts
REST API
- HTTP server
src/server.ts - Express app
src/app.ts - API routes
src/routes - CRUD routing
src/routes/crudRoutes.ts - CRUD controller
src/controller/CrudController.ts
Clinic records
- Clinic controllers
src/controller - Domain models
src/models - Input validation
src/models/validators.ts - Clinic repositories
src/repository - Shared data access
src/repository/BaseRepository.ts - Pet-tutor links
src/repository/PetTutorRepository.ts
Reports
- Report routes
src/routes/relatorioRoutes.ts - Report controller
src/controller/ReportController.ts - Analytics queries
src/repository/ReportRepository.ts
Web panel
- Browser entry and navigation
frontend/js/main.js - Entity definitions
frontend/js/entities.js - Frontend data model
frontend/js/model.js - Entity screens
frontend/js/presenters/entity.js - Pet records
frontend/js/presenters/prontuario.js - Dashboard
frontend/js/presenters/dashboard.js - Report screens
frontend/js/presenters/reports.js - UI components
frontend/js/view.js
Other components
- Clinic user
- MySQL server
Connections 30
- Clinic user → Browser entry and navigation: navigates
frontend/js/main.js - Browser entry and navigation → Dashboard: dispatches
frontend/js/main.js - Browser entry and navigation → Entity screens: dispatches
frontend/js/main.js - Browser entry and navigation → Report screens: dispatches
frontend/js/main.js - Browser entry and navigation → Entity definitions: configures screens
frontend/js/main.js - Entity screens → Pet records: uses
frontend/js/presenters/entity.js - Entity screens → Frontend data model: uses
frontend/js/presenters/entity.js - Report screens → Frontend data model: uses
frontend/js/presenters/reports.js - Entity screens → UI components: renders with
frontend/js/presenters/entity.js - Pet records → UI components: renders with
frontend/js/presenters/prontuario.js - Report screens → UI components: renders with
frontend/js/presenters/reports.js - Browser entry and navigation → Express app: consumes API
- HTTP server → Express app: starts
src/server.ts - Express app → API routes: mounts
src/app.ts - API routes → CRUD routing: uses
src/routes/petRoutes.ts - CRUD routing → CRUD controller: dispatches
src/routes/crudRoutes.ts - CRUD controller → Input validation: validates with
src/controller/CrudController.ts - CRUD controller → Shared data access: calls
src/controller/CrudController.ts - Clinic controllers → Domain models: builds
src/controller/PetController.ts - Clinic controllers → Clinic repositories: calls
src/controller/PetController.ts - Clinic repositories → Shared data access: extends
src/repository/PetRepository.ts - Pet-tutor links → Database selection: queries via
src/repository/PetTutorRepository.ts - Shared data access → Database selection: queries via
src/repository/BaseRepository.ts - Report routes → Report controller: dispatches
src/routes/relatorioRoutes.ts - Report controller → Analytics queries: calls
src/controller/ReportController.ts - Analytics queries → Database selection: queries via
src/repository/ReportRepository.ts - Database selection → Embedded SQLite: opens default
src/config/database.ts - Database selection → MySQL server: selects optionally
src/config/database.ts - Embedded SQLite → Relational schema and SQL: initializes from scripts
- Relational schema and SQL → Analytics queries: documents views and analytics