- Node.js 18.0.0 or higher
- npm 8.0.0 or higher
- PostgreSQL database (for production)
git clone <repository-url>
cd SmartInvoice-main-1
bun installCreate a .env.local file in the root directory with the following variables:
# Application
NODE_ENV=development
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Database (Required)
DATABASE_URL=postgresql://username:password@localhost:5432/smartinvoice
# Security (Required)
JWT_SECRET=your-super-secret-jwt-key-change-in-production
# Email Configuration (Optional)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SECURE=false
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
EMAIL_FROM=noreply@yourdomain.com- Install PostgreSQL locally
- Create a database named
smartinvoice - Update the
DATABASE_URLin your.env.local
- Use a managed PostgreSQL service (e.g., Supabase, Railway, or AWS RDS)
- Ensure SSL is enabled
- Set up proper connection pooling
# Development
bun dev
# Production build
bun run build
bun start- Change
JWT_SECRETto a strong random string - Use HTTPS in production
- Set
NODE_ENV=productionin production - Configure proper email settings
- Use strong database passwords
- Enable SSL connections
- Restrict database access to application servers
- Regular database backups
- Enable rate limiting
- Configure CORS properly
- Set up proper error handling
- Use HTTPS for all external communications
- ✅ User authentication and authorization
- ✅ Invoice creation and management
- ✅ Client management
- ✅ Payment tracking
- ✅ Email notifications
- ✅ Analytics dashboard
- ✅ PDF generation
- ✅ CSV export
- ✅ Automated payment reminders
- ✅ Smart invoice numbering
- ✅ Multi-currency support
- ✅ Tax and discount calculations
- ✅ Payment link integration
- ✅ Responsive design
Login with email and password
{
"email": "user@example.com",
"password": "password123"
}Create a new account
{
"email": "user@example.com",
"password": "password123",
"name": "John Doe",
"company": "Acme Corp"
}Get all invoices for the authenticated user
Create a new invoice
{
"clientName": "Client Name",
"clientEmail": "client@example.com",
"items": [
{
"description": "Service Description",
"quantity": 1,
"rate": 100
}
],
"taxRate": 10,
"discountRate": 0
}- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on push to main branch
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]- Build the application:
npm run build - Set up a reverse proxy (nginx)
- Use PM2 for process management
- Configure SSL certificates
- Check
DATABASE_URLformat - Ensure PostgreSQL is running
- Verify network connectivity
- Check SMTP settings
- Verify email credentials
- Check firewall settings
- Clear node_modules and reinstall
- Check Node.js version compatibility
- Verify all environment variables
- Database Indexing: Ensure proper indexes on frequently queried columns
- Caching: Implement Redis for session and data caching
- CDN: Use a CDN for static assets
- Compression: Enable gzip compression
- Image Optimization: Optimize images and use WebP format
For issues and questions:
- Check the troubleshooting section
- Review the API documentation
- Create an issue in the repository
- 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.