How chechu1981/recambios works
1. What this repository is
- A small PHP-based administrative app for managing contacts, schedules, internal records, links, passwords, and documents for “recambios” work.
- The app is organized as a classic server-rendered CRUD system, with a mix of PHP pages, form handlers, and static assets.
2. Primary runtime and UI model
- The application is built around PHP on the server and HTML/CSS/JavaScript in the browser.
- The UI is mostly page-based rather than API-driven: users load PHP pages that render tables, modals, and forms, then submit back to PHP endpoints.
3. Entry points and navigation
- index.php is the main top-level entry point.
- login.html is the authentication page.
- users.php and main/cards.php appear to be higher-level application views or landing pages after login.
- The app likely routes authenticated users into the various table modules from these entry pages.
4. Authentication boundary
- connection/login_controller.php handles login logic.
- js/login.js supports client-side login interactions.
- This forms a clear boundary between unauthenticated access and the CRUD/admin area.
5. Shared persistence layer
- connection/bbdd.php is the shared database connection layer, likely centralizing MySQL/MariaDB access.
- The connection/controller_*.php files act as domain-specific controllers for each data area:
- controller_address.php
- controller_documents.php
- controller_int.php
- controller_int_table.php
- controller_links.php
- controller_pass.php
- controller_proveedores.php
- These controllers are the main server-side abstraction between the UI pages and the database.
6. CRUD modules by domain
- Each entity has its own module under tables/, with a consistent CRUD structure:
- index.php for listing
- nuevo.php for creating
- insert.php for persisting new records
- modificar.php for editing
- update.php for saving edits
- eliminar.php for deletion
- This pattern exists for:
- tables/address
- tables/documents
- tables/internas
- tables/links
- tables/pass
- tables/schedule
- This makes the application modular and easy to diagram as separate bounded data domains sharing the same DB and controller layer.
7. Document management and file storage
- The docs/ directory contains many PDFs, a DOCX, and other files, indicating that the app manages or distributes reference documents/catalogs.
- tables/documents/ plus connection/controller_documents.php likely link database rows to these physical files.
- tables/documents/modal.php suggests document selection or preview is handled with modal UI interactions.
8. Schedule and contact data flow
- The app’s main functional focus appears to be schedules and contact/address data, supported by document and link management.
- tables/schedule/ and tables/address/ are likely core operational datasets.
- tables/links/ probably stores quick-reference URLs or related resources.
- tables/internas/ and tables/pass/ suggest internal notes and credentials-like records, though the exact semantics depend on the database schema.
9. Client-side behavior and presentation
- Styling is split across css/main.css, css/cssown.css, and css/cssMobile.css, indicating responsive or device-specific presentation.
- JavaScript is split by concern:
- js/jsown.js for general UI behavior
- js/jsfrm.js for form handling
- js/calc.js for calculator logic
- js/login.js for authentication interactions
- The tables/*/modal.php files imply the UI uses modal dialogs for create/edit flows.
10. Auxiliary calculation feature
- calc/calc.php and calc/newLine.php, supported by js/calc.js, indicate a separate calculator/subtool inside the app.
- This is a side subsystem, not the core data-management path, but it likely supports the work process for parts selection or service calculations.
11. Assets and static content
- img/ holds image assets.
- docs/pdf may be a document subfolder or a special file collection.
- These are part of the presentation and document-distribution layer, not the application logic.
12. Overall architectural shape
- The system is a monolithic PHP CRUD application with:
- browser UI pages,
- a shared DB connection layer,
- per-domain controllers,
- per-entity table modules,
- and file-based document storage.
- For an architecture diagram, the main flows are:
- user login → authenticated page shell → domain CRUD pages → shared controllers → database,
- and document-related pages → file references in docs/ plus database metadata.
Main entry points: cards.php Cards · bbdd.php DB conn · documents/index.php Documents · address/index.php Address
Components 23
Entry & auth
Public entry pages and login boundary.
Admin UI
Authenticated page shell and shared page composition.
CRUD modules
Domain-specific server-rendered table modules.
- Address · Address management screens.
tables/address/index.php - Documents · Document metadata and file linkage screens.
tables/documents/index.php - Internas · Internal records management screens.
tables/internas/index.php - Links · Quick-reference links management screens.
tables/links/index.php - Passwords · Credential-like record management screens.
tables/pass/index.php - Schedule · Scheduling and appointment data screens.
tables/schedule/index.php
Data access
Shared database connection and server-side controllers.
- Login ctl · Handles credential validation and login flow.
connection/login_controller.php - DB conn · Shared database connection and access setup.
connection/bbdd.php - Address ctl · Server-side controller for address data.
connection/controller_address.php - Docs ctl · Server-side controller for document records.
connection/controller_documents.php - Int ctl · Server-side controller for internal records.
connection/controller_int.php - Links ctl · Server-side controller for link records.
connection/controller_links.php - Pass ctl · Server-side controller for password-like records.
connection/controller_pass.php - Prov ctl · Server-side controller for supplier/provider records.
connection/controller_proveedores.php
Calculator
Standalone calculation subtool.
- Calculator · Standalone calculation tool for the workflow.
calc/calc.php - Calc JS · Client-side logic for calculator interactions.
js/calc.js
Static assets
Styles, scripts, and file-based document storage.
- Main CSS · Primary presentation layer styling.
css/main.css - Docs store · Physical document repository used by the app.
docs - Images · Static image assets.
img
Connections 26
- Login → Login ctl: submit credentials · Login form posts to authentication logic.
- Login ctl → DB conn: verify user · Authentication checks the shared database.
- Home → Cards: route in · Top-level entry routes into the authenticated shell.
- Users → Cards: navigate · User-facing area leads into the main cards view.
- Cards → Address: open · Authenticated navigation reaches address management.
- Cards → Documents: open · Authenticated navigation reaches document management.
- Cards → Internas: open · Authenticated navigation reaches internal records.
- Cards → Links: open · Authenticated navigation reaches links management.
- Cards → Passwords: open · Authenticated navigation reaches password records.
- Cards → Schedule: open · Authenticated navigation reaches scheduling.
- Address → Address ctl: crud ops · Address pages delegate persistence to the controller.
- Documents → Docs ctl: crud ops · Document pages delegate persistence to the controller.
- Internas → Int ctl: crud ops · Internal records pages delegate to their controller.
- Links → Links ctl: crud ops · Link pages delegate persistence to the controller.
- Passwords → Pass ctl: crud ops · Password pages delegate persistence to the controller.
- Schedule → Prov ctl: shared data · Scheduling-related workflows appear to share provider data access.
- Address ctl → DB conn: query · Controllers use the shared database connection.
- Docs ctl → DB conn: query · Controllers use the shared database connection.
- Int ctl → DB conn: query · Controllers use the shared database connection.
- Links ctl → DB conn: query · Controllers use the shared database connection.
- Pass ctl → DB conn: query · Controllers use the shared database connection.
- Prov ctl → DB conn: query · Controllers use the shared database connection.
- Documents → Docs store: reference files · Document records point to physical files in the docs repository.
- Calculator → Calc JS: client logic · Calculator page is supported by dedicated JavaScript.
- Cards → Main CSS: style · Main application shell uses shared styling.
- Cards → Images: assets · Main UI relies on static image assets.