A comprehensive auto service management application built with React, TypeScript, Node.js, Express, and PostgreSQL. This system helps auto repair shops manage customers, vehicles, work orders, inventory, appointments, and billing.
- π Role-based Authentication (Admin and Mechanic roles)
- π₯ Customer Management with contact information and vehicle history
- π Vehicle Management linked to customers
- π§ Work Order System with status tracking and mechanic assignment
- π¦ Inventory Management with stock tracking and low-stock alerts
- π Appointment Scheduling with calendar integration
- π° Billing & Invoicing system with tax calculations
- π± Mobile-responsive Design optimized for workshop tablets and phones
- π Dashboard with key metrics and recent activity
- React 18 with TypeScript
- Tailwind CSS for styling
- Lucide React for icons
- Vite for development and building
- Node.js with Express
- TypeScript for type safety
- PostgreSQL database
- JWT authentication with jose library
- bcrypt for password hashing
- Node.js 18+
- PostgreSQL 12+
git clone <repository-url>
cd auto-service-management
npm install
cd server && npm install && cd ..
- Create a PostgreSQL database:
CREATE DATABASE auto_service_db;
- Copy environment files:
cp .env.example .env
cp server/.env.example server/.env
- Update the database configuration in
server/.env
:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=auto_service_db
DB_USER=postgres
DB_PASSWORD=your_password
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
- Run database migrations and seed data:
npm run db:setup
Start both frontend and backend:
npm run dev:full
Or start them separately:
# Terminal 1 - Backend
npm run server:dev
# Terminal 2 - Frontend
npm run dev
The application will be available at:
- Frontend:
http://localhost:5173
- Backend API:
http://localhost:3001
Use the seeded demo accounts:
- Admin: admin@autoservice.com / password
- Mechanic: mechanic@autoservice.com / password
The system uses the following main tables:
auth_users
- Authentication credentialsusers
- User profiles and rolescustomers
- Customer informationvehicles
- Vehicle details linked to customerswork_orders
- Service jobs and repairswork_order_items
- Parts used in work ordersinventory
- Parts and supplies inventoryappointments
- Scheduled servicesinvoices
- Billing and payment tracking
- Full access to all features
- Customer and vehicle management
- Work order creation and assignment
- Inventory management
- Invoice creation and management
- User management
- View assigned work orders
- Update work order status and progress
- View customer and vehicle information
- Check inventory levels
- View appointments
- Real-time metrics and KPIs
- Recent activity feed
- Quick action buttons
- Low stock alerts
- Complete customer profiles
- Contact information and notes
- Vehicle history per customer
- Search and filtering
- Detailed job descriptions
- Status tracking (Pending β In Progress β Completed)
- Time and labor tracking
- Parts and materials used
- Mechanic assignment
- Stock level monitoring
- Low stock alerts
- Part pricing and descriptions
- Usage tracking through work orders
- Automatic invoice generation from work orders
- Tax calculations
- Payment tracking
- PDF generation (planned)
βββ src/ # Frontend React app
β βββ components/ # React components
β βββ contexts/ # React contexts
β βββ lib/ # Utilities and API client
β βββ types/ # TypeScript type definitions
βββ server/ # Backend Node.js app
β βββ src/
β β βββ config/ # Database configuration
β β βββ middleware/ # Express middleware
β β βββ routes/ # API routes
β β βββ scripts/ # Database scripts
β βββ package.json
βββ package.json # Frontend dependencies
POST /api/auth/signin
- User loginPOST /api/auth/signup
- Create new user (admin only)
GET /api/customers
- List all customersPOST /api/customers
- Create customerPUT /api/customers/:id
- Update customerDELETE /api/customers/:id
- Delete customer
# Run migrations
npm run db:migrate
# Seed sample data
npm run db:seed
# Reset and setup database
npm run db:setup
- Create database tables in a new migration file
- Add API routes in the server
- Create React components for the UI
- Add navigation items to the sidebar
- Update TypeScript types
- JWT-based authentication
- Password hashing with bcrypt
- SQL injection protection with parameterized queries
- CORS configuration
- Input validation and sanitization
- Set production environment variables
- Build the server:
npm run server:build
- Start with:
npm run server:start
- Update API URL in
.env
- Build:
npm run build
- Serve the
dist
folder with any static hosting service
- Use a production PostgreSQL instance
- Run migrations:
npm run db:migrate
- Update connection settings in server
.env
Use the included Docker configuration:
docker-compose up -d
This will start:
- PostgreSQL database
- Node.js backend
- Nginx serving the frontend
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support or questions:
- Check the GitHub issues
- Review the application logs for error details
- Check database connectivity
Built with β€οΈ for auto repair shops everywhere.