A simple Flask-based ticket management system where users can create, update, and close tickets. The system also includes email notifications and role-based access (admin and regular users).
- User authentication (admin and regular users)
- Ticket creation, updating, and closing
- Email notifications for ticket status changes
- Archived tickets page for closed tickets
- Simple role management (staff and regular users)
- Flask
- Flask-SQLAlchemy
- Flask-Login
- Flask-Mail
- MySQL (PyMySQL)
- Python-dotenv for environment variable management
-
Clone the repository:
git clone https://github.com/yourusername/flask-ticket-system.git cd flask-ticket-system -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies:
pip install Flask Flask-SQLAlchemy Flask-Login Flask-Mail python-dotenv PyMySQL
-
Set up environment variables by creating a
.envfile in the root directory:SECRET_KEY=your_secret_key DATABASE_URL=mysql://username:password@localhost/dbname MAIL_SERVER=smtp.gmail.com MAIL_PORT=587 MAIL_USE_TLS=True [email protected] MAIL_PASSWORD=your_email_password
To set up the database, simply run the application. The database tables will be created automatically if they do not exist:
python app.py