How chandruthangadurai2005/vehicle_service works
Purpose and Entry Points
This is a Node.js/Express vehicle service center management system backed by PostgreSQL. It exposes REST CRUD APIs for operational entities—customers, vehicles, employees, services, billing, inventory, and branches—and serves a browser frontend.
Primary runtime entry point: server.js. Database connectivity is centralized in db.js. The deployed service is intended to run through the process definition in Procfile.
HTTP Server and Static Frontend Boundary
server.js initializes the Express application, mounts API routes, and serves browser-facing assets from public/. This separates the system into:
• Browser UI: public/index.html, public/login.html, public/script.js
• Backend API: server.js, routes/api.js
• Persistent data access: db.js
The frontend communicates with the backend over HTTP rather than accessing PostgreSQL directly.
REST API Layer
routes/api.js is the application’s primary business/API boundary. It implements REST-style endpoints used to create, read, update, and delete service-center records across the relational domain.
The API layer is responsible for translating client requests into database operations and returning HTTP responses. It is mounted by server.js and depends on the database connection exported by db.js.
Relational Data Layer
db.js encapsulates PostgreSQL connection/pool setup and is the sole infrastructure boundary for persistent data access. The domain described by the project includes related customer, vehicle, employee, service, billing, inventory, and branch records.
Control flow is generally:
1. Browser action in public/script.js
2. HTTP request to routes in routes/api.js
3. SQL/database request through db.js
4. PostgreSQL response mapped to JSON
5. UI refresh or update in public/script.js
Browser Application
The browser client is a static HTML/CSS/JavaScript application:
• public/index.html provides the main management interface.
• public/login.html provides a separate login-facing page.
• public/script.js contains client-side interaction and API request logic.
• public/main.css provides shared presentation styling.
This is a lightweight server-served frontend, not a separately built SPA runtime.
Runtime and Deployment
The material runtime is Node.js with Express, declared through package.json; dependencies are lockfile-pinned in package-lock.json. PostgreSQL is the external stateful service. Procfile defines the deployment process for a platform such as Render, matching the README’s hosted deployment reference.
Supporting Repository Artifacts
ROLE_SYSTEM.md and session.txt may support project-specific operational or authentication context, but the core application path remains server.js → routes/api.js → db.js. The included presentation, public/vehicle service center (3).pptx, is documentation rather than a runtime component.
Main entry points: server.js Express Server · index.html Management UI · login.html Login Page · script.js Client Interactions
Components 10
Browser UI
Server-served static management interface.
- Management UI
public/index.html - Login Page
public/login.html - Client Interactions · Issues API requests and refreshes the interface.
public/script.js - Shared Styles
public/main.css
Node.js Service
Express API and static asset host.
- Express Server · Hosts static assets and mounts the API.
server.js - REST API · CRUD boundary for service-center operations.
routes/api.js - Node.js Dependencies · Declares the Express service runtime.
package.json - Deployment Process · Defines the hosted service process.
Procfile
Data Layer
Persistent relational storage boundary.
- Database Pool · Centralized connection and SQL access boundary.
db.js - PostgreSQL · Stores customers, vehicles, employees, services, billing, inventory, and branches.
Connections 12
- Management UI → Client Interactions: loads
- Login Page → Client Interactions: loads
- Management UI → Shared Styles: uses
- Login Page → Shared Styles: uses
- Client Interactions → Express Server: HTTP requests
- Express Server → Management UI: serves
- Express Server → Login Page: serves
- Express Server → REST API: mounts
- REST API → Database Pool: queries
- Database Pool → PostgreSQL: SQL connection
- Node.js Dependencies → Express Server: declares runtime
- Deployment Process → Express Server: starts