The project is a comprehensive ticketing and request management system for a PreK through 8 school and used in a highschool (9-12). It is designed to support complete workflows for ticket lifecycle management, admin oversight, and reporting, ensuring both users and administrators have the necessary tools for effective issue tracking and resolution.
- Framework: Flask
- Database: SQLAlchemy
- Key Features:
- Ticket creation with support for file attachments
- Comment management
- Handling of various request types:
- Equipment requests
- User (new employee) requests
- Student requests
- Task management
- Role-based access control
- Email notifications
- Endpoints for statistics and logging
- Framework: React with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Key Features:
- Modern interface for creating and viewing tickets and requests
- Task management interface
- Interactive components including headers, sidebars, modals, and forms
- Features such as assignment modals, notifications, and a bug report system
Before you begin, ensure you have the following installed on your system:
- Python 3.8+
- Node.js (LTS version recommended)
- npm or Yarn (npm comes with Node.js)
- Git
-
Clone the Repository:
git clone https://github.com/DomMinnich/TicketWorkforceSystem cd TicketWorkforceSystem -
Navigate to the Backend Directory:
cd ticketing_backend -
Create and Activate a Virtual Environment: It's highly recommended to use a virtual environment to manage dependencies.
python -m venv venv # On Windows: .\venv\Scripts\activate # On macOS/Linux: source venv/bin/activate
-
Install Python Dependencies:
pip install -r requirements.txt
-
Configure Environment Variables: Create a
.envfile in theticketing_backenddirectory (same level asapp.py). Copy the contents from the provided.envfile structure and fill in the placeholders:# Environment variables (e.g., SECRET_KEY, EMAIL_PASS) SECRET_KEY="your_very_secret_key_here_for_flask_sessions" SYSTEM_EMAIL_NAME="your_system_email@gmail.com" # e.g., seasticketingsys@gmail.com SYSTEM_EMAIL_PASSWORD="your_app_password" # Use an app password if using Gmail for security SUPER_ADMIN_EMAIL="your_super_admin_email@example.com" # This email will be the super admin FEEDBACK_EMAIL="feedback_recipient_email@example.com" # Authentication codes (for user registration) AUTH_CODE="your_auth_code" # Code for regular user registration ADMIN_AUTH_CODE="your_auth_code" # Code for admin user registration # Google Gemini API Key GEMINI_API_KEY="XXXXXXXXXXXXXXXXXXXXXXX" # License Expiration Date (YYYY-MM-DD) # This will be fetched from the URL, but keep a local fallback or a default for dev LICENSE_EXPIRATION_DEFAULT="2025-07-15" LICENSE_EXPIRATION_URL="https://example.txt"
IMPORTANT: Change
SECRET_KEY,SYSTEM_EMAIL_NAME,SYSTEM_EMAIL_PASSWORD,SUPER_ADMIN_EMAIL,AUTH_CODE,ADMIN_AUTH_CODE, andGEMINI_API_KEYfor production. ForSYSTEM_EMAIL_PASSWORD, if using Gmail, you MUST generate an App Password. -
Initialize the Database and Super Admin: This command creates the SQLite database file (
instance/tickets.db) and the initial super admin user.flask init-db
You will see a message like:
Database initialized and super admin 'your_super_admin_email@example.com' created. Please change the default super admin password immediately via the API.The default password for the super admin issuperadminpassword1234. Change this immediately after logging in. -
Run the Flask Application:
flask run
The backend will typically run on
http://127.0.0.1:5000orhttp://localhost:5000.
-
Navigate to the Frontend Directory:
cd ../ticketing_frontend -
Install Node.js Dependencies:
npm install # or yarn install -
Configure Frontend Environment Variables: Create a
.env.localfile in theticketing_frontenddirectory. This is used by Vite.VITE_GEMINI_API_KEY="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
-
Run the React Application:
npm run dev # or yarn devThe frontend will typically run on
http://10.2.0.6:5173as per yourvite.config.ts. If this IP address is not available or you want to use localhost, you might need to adjust theserver.hostinvite.config.tsto'localhost'or'0.0.0.0'if necessary, and ensureAPI_BASE_URLinticketing_frontend/constants.tsmatches your backend's actual address.
- Frontend (User Interface): Open your web browser and navigate to the address where your frontend is running (e.g.,
http://10.2.0.6:5173). - Backend (API Endpoints): The API is served from
http://10.2.0.6:5000/api.
- Super Admin Login: Use the
SUPER_ADMIN_EMAILconfigured in your backend's.envand the default passwordsuperadminpassword1234(case-sensitive) to log in. Immediately change this password from the Profile page. - Regular User Registration: To register a new user, provide an email, password, and the
AUTH_CODEfrom your backend's.env. - Admin User Registration: To register a new administrator (beyond the super admin), provide an email, password, and the
ADMIN_AUTH_CODEfrom your backend's.env. Note that only the super admin can assign the 'admin' role, and the system is configured to allow only one active super admin at a time, protecting the primary super admin account.
- Dashboard: Provides an overview of active tickets and requests.
- Tickets:
- Create New Ticket: Click "Create New Ticket" to submit a new issue. You can optionally attach a file.
- View/Manage Tickets: Browse the list of tickets. Click on a ticket to view details, add comments, and download attachments.
- Admin Actions (for
adminrole): Admins can close tickets, assign tickets to other admins, and delete tickets (with super-admin confirmation for certain actions).
- Requests:
- Equipment Requests: Submit requests for equipment usage. Admins (IT department association) can approve, deny, or close these requests.
- New Employee Requests: Submit requests for new staff onboarding. Admins (IT department association) can view and close these requests.
- New Student Requests: Submit requests for new student setup. Admins (IT department association) can view and mark various setup tasks as complete (email, computer, ID card, etc.).
- User Management (Admin Tools -> User Management):
- Admin Access Only: Only users with the
adminrole can access this section. - View all registered users.
- Edit user roles and associations.
- Reset user passwords.
- Delete users (only super admin can delete others).
- Important: The super admin account's role and email cannot be changed by other admins, and it cannot be deleted by anyone except itself under specific circumstances, or by another super admin if multiple exist (though the system aims for a single super admin).
- Admin Access Only: Only users with the
- Task Manager (Admin Tools -> Task Manager):
- Admin Access Only: Only users with the
adminrole can access this section. - Add new tasks for
tech,maintenance, oradministrationcategories. - Mark tasks as complete or reset them.
- View a log of all task actions.
- Download or clear task logs.
- Admin Access Only: Only users with the
- AI Assistant (Floating Button): Click the chat bubble icon in the bottom right to open the AI assistant modal. Ask questions related to the system or general IT.
- Report Bug / Feedback (Floating Button): Click the bug icon in the bottom right to submit a bug report or provide feedback.
- License Expiration: If the system license expires (as determined by the
LICENSE_EXPIRATION_URL), the application will display a "Service Unavailable" page.
The primary configuration for the backend is done via the .env file in the ticketing_backend directory.
SECRET_KEY: A strong, random string used for session management. MUST be unique and kept secret.SYSTEM_EMAIL_NAME: The email address used to send system notifications (e.g.,example@gmail.com).SYSTEM_EMAIL_PASSWORD: The password for theSYSTEM_EMAIL_NAME. For Gmail, use an App Password.SUPER_ADMIN_EMAIL: The email address for the initial super administrator account. This user has full system privileges.FEEDBACK_EMAIL: The email address where bug reports/feedback will be sent.AUTH_CODE: A secret code required for standard user registration.ADMIN_AUTH_CODE: A secret code required for initial admin user registration.GEMINI_API_KEY: Your Google Gemini API key if you enable the AI assistant.LICENSE_EXPIRATION_DEFAULT: A fallback expiration date (YYYY-MM-DD) if the URL cannot be reached.LICENSE_EXPIRATION_URL: A URL pointing to a plain text file containing the license expiration date (year, month, day on separate lines). Example:https://example.txt
The frontend's API_BASE_URL is configured in ticketing_frontend/constants.ts and should point to your backend's address. The GEMINI_API_KEY for the frontend is in ticketing_frontend/.env.local.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
You are free to view, fork, and modify this code for personal, educational, or recruitment-related purposes, but you may not use it for any commercial purpose whatsoever.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes following conventional commit messages.
- Push your branch and create a Pull Request.
For any questions or issues, please contact: Dominic Minnich - dominicminnich@gmail.com


