A modern web application for New Calcutta Motors to generate professional electronic invoices (E-Bills) with PDF export functionality. Built with React, TypeScript, and Vite.
- Overview
- Features
- Technologies Used
- Project Structure
- Getting Started
- Available Scripts
- Usage
- Invoice Features
- Pages
- Development
- Build & Deployment
NCM Services is a comprehensive invoice management system designed for New Calcutta Motors. The application allows users to:
- Generate professional invoices for multiple shop locations
- Export invoices as PDF documents
- View company information and contact details
- Access an interactive map showing business location
The application supports two shop locations:
- Calcutta Motors
- New Calcutta Motors
- β Multi-Shop Invoice Generation: Support for multiple shop locations with different GSTIN and bank details
- β Dynamic Invoice Form: Fully editable invoice with real-time calculations
- β PDF Export: Generate and download invoices as PDF files
- β Automatic Tax Calculations: CGST, SGST, and IGST calculations
- β Amount in Words: Automatic conversion of invoice amount to words (Indian numbering system)
- β Responsive Design: Mobile-friendly interface with modern UI/UX
- π Interactive Map: Leaflet-based map showing business location
- π Contact Form: Customer inquiry form
- π’ About Page: Company information and statistics
- π¨ Modern UI: Clean, professional design with smooth animations
- React 19.2.0 - UI library
- TypeScript 5.9.3 - Type-safe JavaScript
- Vite 7.2.4 - Build tool and dev server
- React Router DOM 7.10.1 - Client-side routing
- jsPDF 3.0.4 - PDF document generation
- html2canvas 1.4.1 - HTML to canvas conversion
- Leaflet 1.9.4 - Interactive maps
- React Leaflet 5.0.0 - React bindings for Leaflet
- ESLint 9.39.1 - Code linting
- TypeScript ESLint 8.46.4 - TypeScript-specific linting rules
ncm-services/
βββ public/ # Static assets
β βββ vite.svg
βββ src/
β βββ assets/ # Images and other assets
β β βββ react.svg
β βββ components/ # Reusable components
β β βββ Navbar.tsx # Navigation bar component
β β βββ Navbar.css
β βββ pages/ # Page components
β β βββ Home.tsx # Landing page with shop selection
β β βββ Home.css
β β βββ About.tsx # About us page
β β βββ About.css
β β βββ Contact.tsx # Contact page with form and map
β β βββ Contact.css
β β βββ Invoice.tsx # Invoice generator page
β β βββ Invoice.css
β βββ App.tsx # Main app component with routing
β βββ App.css # Global app styles
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ index.html # HTML template
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ eslint.config.js # ESLint configuration
- Node.js (v16 or higher recommended)
- npm or yarn package manager
-
Clone the repository (or navigate to the project directory)
cd ncm-services -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser
- Navigate to
http://localhost:5173(or the port shown in terminal)
- Navigate to
| Command | Description |
|---|---|
npm run dev |
Start development server with hot module replacement |
npm run build |
Build the project for production (outputs to dist/) |
npm run preview |
Preview the production build locally |
npm run lint |
Run ESLint to check code quality |
-
Navigate to Home Page
- Click on "Home" in the navigation bar
- You'll see two shop options: "Calcutta Motors" and "New Calcutta Motors"
-
Select a Shop
- Click on the shop card you want to generate an invoice for
- You'll be redirected to the invoice page with pre-filled shop details
-
Fill Invoice Details
- Invoice Number (required): Enter a unique invoice number
- Date: Select the invoice date (defaults to today)
- Receiver Details:
- Name (required)
- Address
- GSTIN/UIN
- Vehicle Number
-
Add Items
- Fill in item details in the table:
- Description
- HSN/SAC code
- Quantity
- Rate
- Amount is automatically calculated (Quantity Γ Rate)
- Up to 12 items can be added
- Fill in item details in the table:
-
Configure Taxes
- CGST percentage (default: 9%)
- SGST percentage (default: 9%)
- IGST is automatically calculated
-
Generate PDF
- Click "Print Invoice" button
- The invoice will be generated as a PDF and downloaded
- Filename format:
[First10CharsOfName]_[InvoiceNumber].pdf
- About: View company information, mission, values, and statistics
- Contact:
- Fill out the contact form
- View contact information (address, phone, email)
- See business location on interactive map
- Item Amount: Quantity Γ Rate (auto-calculated)
- Total Before Tax: Sum of all item amounts
- CGST: Percentage of total before tax
- SGST: Percentage of total before tax
- IGST: Automatically calculated to round up to next whole number
- Total After Tax: Sum of all amounts including taxes
- Automatically converts the total invoice amount to words
- Uses Indian numbering system (Lakhs, Crores)
- Example: βΉ1,50,000 β "One Lakh Fifty Thousand only"
- High-quality PDF export
- A4 page format
- Professional layout with proper formatting
- All input fields are converted to text in PDF
- Date format conversion (YYYY-MM-DD β DD-MM-YYYY)
- Required fields: Invoice Number and Receiver Name
- Error messages for missing required fields
- Visual indicators for validation errors
- Hero section with company name
- Shop selection cards
- Navigation to invoice generation
- Company story and mission
- Core values
- Statistics (customers, experience, satisfaction)
- Contact information display
- Contact form with validation
- Interactive map showing business location
- Clickable phone numbers and email
- Dynamic route based on shop name
- Full invoice generation interface
- Editable form fields
- PDF export functionality
- Reset button to clear all fields
- Back button to return to home
- TypeScript for type safety
- ESLint for code quality
- Functional components with hooks
- CSS modules for styling
To add a new shop location:
-
Update
src/pages/Home.tsx:- Add a new card in the
cards-container - Use
handleCardClickwith the shop name
- Add a new card in the
-
Update
src/pages/Invoice.tsx:- Add shop detection logic in the component
- Add shop-specific data (GSTIN, bank account, etc.) in
invoiceData
- Styling: Modify CSS files in respective component directories
- Invoice Template: Edit
src/pages/Invoice.tsxandInvoice.css - Company Info: Update contact information in
Contact.tsxandInvoice.tsx
npm run buildThis creates an optimized production build in the dist/ directory.
npm run previewThe dist/ folder can be deployed to:
- Netlify: Drag and drop the
distfolder - Vercel: Connect your repository for automatic deployments
- GitHub Pages: Configure to serve from
distfolder - Any static hosting service: Upload the
distfolder contents
Currently, no environment variables are required. All configuration is done directly in the code.
- The application uses client-side routing (React Router)
- PDF generation requires a modern browser with JavaScript enabled
- Map functionality requires internet connection (uses OpenStreetMap tiles)
- Invoice data is not persisted - it's generated on-demand
This is a private project for New Calcutta Motors. For any modifications or improvements, please contact the project maintainer.
Private project - All rights reserved.
Developed for New Calcutta Motors π
For questions or support, please contact: alokshaw83@gmail.com