A comprehensive full-stack web application for managing billing, customer data, and analytics for a gold and jewelry shop. Built with React, Node.js, Express, and MongoDB with GST and BIS compliance.
- Generate GST-compliant bills with jewelry-specific fields
- PDF generation and download
- HUID (Hallmark Unique ID) tracking
- Gold purity and weight calculations
- Making charges and wastage calculations
- Multi-tax support (CGST, SGST, IGST)
- View all generated bills
- Filter by status and payment status
- Search by bill number, customer details
- Update payment status
- Download bills as PDF
- Detailed bill view with all item information
- Add and manage customer profiles
- GST number tracking
- Purchase history
- Search and filter customers
- Customer analytics
- Sales dashboard with key metrics
- Monthly and yearly sales trends
- Tax reports (CGST, SGST, IGST)
- Customer analytics
- Payment status tracking
- Secure login system
- JWT-based authentication
- Admin user management
- Session management
- React 19 with TypeScript
- Tailwind CSS for styling
- shadcn/ui for UI components
- Phosphor Icons for icons
- jsPDF & html2canvas for PDF generation
- Axios for API communication
- React Hook Form for form management
- Sonner for notifications
- Node.js with Express.js
- MongoDB with Mongoose ODM
- JWT for authentication
- bcryptjs for password hashing
- Helmet for security headers
- CORS for cross-origin requests
- Morgan for logging
- Express Rate Limit for API protection
- Node.js (v16 or higher)
- MongoDB Atlas account (or local MongoDB)
- Git
git clone <repository-url>
cd arjun-swarnkar-billingVITE_API_URL=http://localhost:5000/apiMONGODB_URI=mongodb+srv://rahulkumar20000516:mnspass@cluster0.ar1qaru.mongodb.net/arjunBill
JWT_SECRET=your_super_secret_jwt_key_here_change_in_production_please
PORT=5000
NODE_ENV=development
CORS_ORIGIN=http://localhost:5173
# Default admin user (for seeding)
ADMIN_EMAIL=admin@arjunswarnkar.com
ADMIN_PASSWORD=admin123# Install frontend dependencies
npm install
# Start both frontend and backend
npm run dev:fullstack# Terminal 1 - Backend
cd backend
npm install
npm run dev
# Terminal 2 - Frontend
npm install
npm run dev- Frontend: http://localhost:5173
- Backend API: http://localhost:5000/api
- Health Check: http://localhost:5000/api/health
Email: admin@arjunswarnkar.com
Password: admin123
POST /api/auth/login- User loginGET /api/auth/me- Get current userPOST /api/auth/change-password- Change password
GET /api/bills- Get all bills (with pagination and filters)GET /api/bills/:id- Get bill by IDPOST /api/bills- Create new billPUT /api/bills/:id- Update billPUT /api/bills/:id/payment-status- Update payment statusDELETE /api/bills/:id- Cancel bill
GET /api/customers- Get all customersGET /api/customers/:id- Get customer by IDPOST /api/customers- Create new customerPUT /api/customers/:id- Update customerDELETE /api/customers/:id- Deactivate customerGET /api/customers/search/:query- Search customers
GET /api/analytics/dashboard- Dashboard dataGET /api/analytics/sales-report- Sales reportsGET /api/analytics/tax-report- Tax reports
- Authentication and user management
- Role-based access (admin/user)
- Encrypted passwords
- Customer information
- GST details
- Purchase history tracking
- Complete bill information
- Line items with jewelry-specific fields
- Tax calculations
- Payment tracking
- Status management
- JWT token-based authentication
- Password hashing with bcrypt
- CORS protection
- Rate limiting
- Input validation
- XSS protection with Helmet
- Environment variable protection
- GST Calculations: Automatic CGST, SGST, and IGST calculations
- HSN Codes: Jewelry-specific HSN code (71131900)
- BIS Compliance: HUID (Hallmark Unique ID) tracking
- Tax Reports: Detailed tax breakdowns for compliance
- Bill Numbering: Sequential bill numbering with prefix
- Server-side PDF generation using jsPDF
- Professional invoice layout
- Company branding
- Detailed item breakdown
- Tax summary
- Terms and conditions
├── src/ # Frontend source code
│ ├── components/ # React components
│ ├── lib/ # Utilities and API
│ └── ...
├── backend/ # Backend source code
│ ├── models/ # MongoDB models
│ ├── routes/ # Express routes
│ ├── middleware/ # Auth middleware
│ └── utils/ # Utilities
└── ...
Frontend:
npm run dev- Start development servernpm run build- Build for productionnpm run lint- Run ESLint
Backend:
npm run dev- Start development server (nodemon)npm start- Start production server
Full Stack:
npm run dev:fullstack- Start both frontend and backend
- Build the frontend:
npm run build - Deploy the
distfolder to your hosting service - Configure environment variables
- Set production environment variables
- Deploy to your server (Heroku, DigitalOcean, etc.)
- Ensure MongoDB connection is secure
- Use a strong JWT secret
- Use strong, unique JWT secrets
- Secure MongoDB connection string
- Configure CORS for your domain
- Set NODE_ENV=production
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.
For support or questions, please contact the development team or create an issue in the repository.