Help Desk Ticketing System
A modern help desk ticketing system built with React (Vite), Firebase, and Material UI.
Features
- User authentication with Google Single Sign-On (Firebase Auth)
- Automatic user account creation on first sign-in
- Ticket creation and management
- File attachments (images, videos, documents)
- Email notifications for ticket updates
- User management with role-based permissions
- Company settings and configuration
Technology Stack
-
Frontend:
- React 19 with Vite
- TypeScript
- Material UI & shadcn/ui
- TailwindCSS
- React Router
-
Backend & Services:
- Firebase Authentication
- Firestore Database
- Firebase Storage
- Firebase Functions
- Google Pub/Sub for notifications
Installation
- Clone the repository
- Navigate to the React app directory:
Terminal window cd react - Install dependencies:
Terminal window npm install - Copy
.env.exampleto.envand fill in your Firebase configuration (useVITE_prefix for all variables)
Development
Run the development server:
cd reactnpm run devOpen http://localhost:5173 with your browser to see the result.
Firestore Indexes
This application requires specific Firestore indexes to function properly. See FIRESTORE_INDEXES.md for details on the required indexes.
To deploy the indexes to Firestore:
firebase deploy --only firestore:indexesDeployment
Firebase Hosting with Cloud Functions
The application can be deployed to Firebase Hosting with Cloud Functions:
# Install Firebase CLI if not already installednpm install -g firebase-tools
# Login to Firebasefirebase login
# Deploy using our script./scripts/deploy.shYour application will be available at your Firebase Hosting URL:
https://YOUR-PROJECT-ID.web.app
Production Build
Build the React application for production:
cd reactnpm run buildThe build output will be in the react/dist directory.
Firebase Deployment
# Deploy the React app to Firebase Hostingcd reactfirebase deploy --only hosting
# Deploy Firebase Cloud Functions for API endpointscd ../functionsnpm installfirebase deploy --only functionsSee the DEPLOY.md file for detailed deployment instructions and all available deployment options.
Docker Deployment (Alternative)
The application can also be deployed using Docker:
docker-compose up -dThe Docker configuration includes:
- Multi-stage build for optimized image size
- Health check endpoint at
/api/health - Automatic container restarts
- Volume mapping for persistent data
Project Structure
react/├── src/│ ├── components/ # React components│ ├── pages/ # Route pages│ ├── lib/ # Utility functions and libraries│ │ ├── auth/ # Authentication utilities│ │ ├── firebase/ # Firebase configuration│ │ └── algolia/ # Search integration│ └── App.tsx # Main application component├── public/ # Static assetsfunctions/├── src/ # Firebase Cloud Functions│ ├── api.js # Main API endpoints│ ├── auth.js # Authentication functions│ └── ... # Other function modulesEnvironment Variables
The following environment variables are required:
# Firebase ConfigNEXT_PUBLIC_FIREBASE_API_KEY=NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=NEXT_PUBLIC_FIREBASE_PROJECT_ID=NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=NEXT_PUBLIC_FIREBASE_APP_ID=NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=
# Firebase AdminFIREBASE_SERVICE_ACCOUNT_KEY=
# AuthenticationALLOWED_EMAIL_DOMAIN=
# Google Pub/SubGCP_PROJECT_ID=PUBSUB_TOPIC_NAME=
# Email ConfigurationSUPPORT_EMAIL=SUPPORT_PHONE=
# SMTP Configuration for Email NotificationsSMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_SECURE=falseSMTP_PASSWORD=your-smtp-password
# Application URL (used for email links)NEXT_PUBLIC_APP_URL=http://localhost:3000
# Company ConfigurationCOMPANY_NAME="Help Desk"Email Configuration
The system uses Nodemailer to send email notifications for ticket events:
- When a new ticket is created
- When a reply is added to a ticket
- When a ticket status changes
To configure email sending:
-
Set the SMTP environment variables in your
.env.localfile:SMTP_HOST=smtp.example.comSMTP_PORT=587SMTP_SECURE=false # Use 'true' for SSL connectionsSMTP_PASSWORD=your-password -
Set the application URL for proper links in emails:
NEXT_PUBLIC_APP_URL=https://your-domain.com -
In development mode, if SMTP is not configured, emails will be simulated (logged to console but not sent).
License
MIT