Patrick Frank, Instructor
The front end of this project is hosted at this URL: https://troubleticketserver.onrender.com
- Login: This is just simulated. Use your first name and anything for the password.
- _Note: The application may take a couple minutes to start if it hasn't been run in a while. _
This project is a simple IT Support Ticket System that allows users to create, search, and view support tickets. It demonstrates a full-stack web application with a Node.js/Express backend and a vanilla JavaScript frontend.
it-support-ticket-system/
├── public/ # Static files served by Express
│ ├── index.html # Main HTML file
│ ├── main.css # Stylesheet
│ ├── main.js # Client-side JavaScript
├── server.js # Node.js/Express server
├── package.json # Project dependencies and scripts
-
User Authentication (Simulated)
- Simple login/logout functionality (no actual authentication)
- Session persistence is simulated
-
Ticket Management
- Create new support tickets with validation
- Different ticket types (computer, software, network) with dynamic fields
- View all tickets with sorting options
- Search for tickets by name or ticket ID
-
Data Validation
- Client and server-side validation for all ticket fields
- Format validation for dates, employee IDs, names, etc.
-
Data Storage
- In-memory storage for production environment
- File-based storage for development environment
The server is built with Express.js and provides:
-
API Endpoints
GET /api/tickets- Retrieve all ticketsGET /api/tickets/search- Search for ticketsPOST /api/tickets- Create a new ticketGET /api/ping- Simple API test endpoint
-
Environment Handling
- Development mode: Uses file-based storage
- Production mode: Uses in-memory storage
-
Middleware
- CORS support for cross-origin requests
- JSON body parsing
- Static file serving
- Error handling
- Two custom classes: Ticket and User
The frontend is built with vanilla JavaScript and provides:
-
User Interface
- Login form
- Tabbed interface for ticket operations
- Forms with dynamic fields based on ticket type
-
Client-Side Validation
- Form validation before submission
- Error display for validation failures
-
API Integration
- Fetch API for all server communication
- Error handling for network issues
-
Create a new Web Service on Render.com
- Connect your Git repository
-
Configure the service
- Build Command:
npm install - Start Command:
node server.js - Environment Variables:
NODE_ENV=productionPORT=10000(or let Render set it automatically)
- Build Command:
-
Deploy
- Render will automatically build and deploy your application
- Access your application at the URL provided by Render
The application dynamically changes form fields based on the selected ticket type:
- Computer Hardware: Shows fields for computer model and serial number
- Software: Shows fields for software name and version
- Network: Shows fields for network location and MAC address
All ticket data is validated according to these rules:
- Request Date: Must be in mm/dd/yyyy format
- Employee ID: Must be a capital letter followed by 5 numbers (e.g., A12345)
- First Name: Must start with a capital letter
- Last Name: Must start with a capital letter
- Problem Description: Required
The application automatically extracts email addresses from the problem description and includes them in the ticket details.
This application is designed for educational purposes and has several limitations:
- No Real Authentication: The login system is simulated and doesn't provide actual security
- Limited Data Persistence: Production mode uses in-memory storage which is cleared when the server restarts
- No Database: A real application would use a proper database instead of in-memory or file storage
- Basic Error Handling: A production application would need more robust error handling
Potential enhancements to implement:
- Add a real authentication system with user accounts
- Implement a database backend (MongoDB, PostgreSQL, etc.)
- Add ticket status updates and comments
- Create an admin interface for managing tickets
- Implement email notifications for new tickets
- Add file attachments for tickets
