A comprehensive printer billing and management system built with Next.js, Firebase, and Google Cloud Platform.
- Node.js 18.x or higher
- npm
- Firebase project (required)
# Install dependencies
npm install
# Copy environment variables
cp env.example .env.local
# Start the auto-reloading dev server
./dev./dev is the repo entrypoint for local development. It checks that node_modules and .env.local exist, then starts next dev with hot reloading enabled.
-
Connect to Vercel
# Install Vercel CLI npm i -g vercel # Login to Vercel vercel login
-
Deploy to Vercel
# Deploy to production vercel --prod # Or deploy to preview vercel
-
Environment Variables
- Go to your Vercel project dashboard
- Navigate to Settings > Environment Variables
- Add the variables from
env.example - Add your Firebase configuration values (public config and service account key)
-
Automatic Deployments
- Connect your GitHub repository to Vercel
- Every push to main branch will trigger automatic deployment
- Preview deployments for pull requests
printerApp/
βββ app/ # Next.js App Router pages
βββ components/ # Reusable React components
βββ lib/ # Utility functions and data store
βββ python/ # Data collection service
βββ scripts/ # Deployment and setup scripts
βββ vercel.json # Vercel deployment configuration
βββ env.example # Environment variables template
Create a .env.local file with the following variables:
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
# Firebase Admin SDK
FIREBASE_SERVICE_ACCOUNT_KEY=your_base64_encoded_service_account_key- Create a Firebase project
- Enable Authentication and Firestore
- Add your Firebase configuration to environment variables
- No code changes are neededβFirebase is already wired in the app
- User Authentication: Secure login system with role-based access
- Print Job Tracking: Monitor and track all print jobs
- Cost Calculation: Real-time cost calculation for printing services
- Billing Management: Generate and manage billing records
- Admin Dashboard: Comprehensive admin interface for user management
- Responsive Design: Mobile-first design with Tailwind CSS
- Modern UI: Clean interface using shadcn/ui components
- Data Visualization: Charts and graphs for printing statistics
- Interactive Tables: Sortable, filterable tables with pagination
- User Management: Create, edit, and manage user accounts
- Billing Management: Generate and export billing records
- Price Management: Set and update pricing for services
- System Monitoring: View printer status and system health
npm run dev # Start the repo dev server wrapper
npm run dev:next # Run raw Next.js dev server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npx ts-node -P tsconfig.scripts.json scripts/backfill-income-createdAt-and-ids.ts # Backfill income createdAt and IDs- Frontend: Next.js 15.4.3, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui components
- Authentication: Firebase Authentication
- Database: Firebase Firestore
- Deployment: Vercel
The application includes a Python service for automated data collection from network printers:
# Deploy data collection service
cd python
docker build -t printer-collector .
docker run -e FIREBASE_SERVICE_ACCOUNT_KEY=your_key printer-collector- Environment variables for sensitive configuration
- Role-based access control
- Secure authentication system
- Input validation and sanitization
- Optimized Next.js configuration
- Code splitting and lazy loading
- Efficient data fetching
- Responsive image optimization
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Check the documentation in
/documentation.md - Review development lessons in
/lessons.md - Check the project roadmap in
/plan.md
Note: This application uses Firebase Firestore and Authentication. The dummy data utilities are available only for seeding/testing via the scripts in /scripts.