{"id":17093933,"url":"https://github.com/abdulvahabaa/ticket-management-system-api","last_synced_at":"2026-04-16T11:35:44.724Z","repository":{"id":257364025,"uuid":"856469585","full_name":"abdulvahabaa/ticket-management-system-api","owner":"abdulvahabaa","description":"Ticket management system API project using Node.js, Express.js, TypeScript, and PostgreSQL with raw SQL queries.","archived":false,"fork":false,"pushed_at":"2024-09-14T10:01:36.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T22:48:59.740Z","etag":null,"topics":["expressjs","nodejs","postgresql","sql-query","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdulvahabaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-12T16:17:44.000Z","updated_at":"2024-09-16T06:51:29.000Z","dependencies_parsed_at":"2024-09-16T09:38:47.174Z","dependency_job_id":null,"html_url":"https://github.com/abdulvahabaa/ticket-management-system-api","commit_stats":null,"previous_names":["abdulvahabaa/ticket-management-system-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulvahabaa%2Fticket-management-system-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulvahabaa%2Fticket-management-system-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulvahabaa%2Fticket-management-system-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdulvahabaa%2Fticket-management-system-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdulvahabaa","download_url":"https://codeload.github.com/abdulvahabaa/ticket-management-system-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245136348,"owners_count":20566586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","nodejs","postgresql","sql-query","typescript"],"created_at":"2024-10-14T14:09:48.108Z","updated_at":"2026-04-16T11:35:44.688Z","avatar_url":"https://github.com/abdulvahabaa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ticket-management-system-api\n\n## Table of Contents\n\n- [ticket-management-system-api](#ticket-management-system-api)\n  - [Table of Contents](#table-of-contents)\n  - [Features](#features)\n  - [Technologies Used](#technologies-used)\n  - [Installation and Setup](#installation-and-setup)\n    - [Prerequisites](#prerequisites)\n    - [Environment Setup](#environment-setup)\n    - [Running the Application](#running-the-application)\n  - [Usage](#usage)\n    - [API Endpoints](#api-endpoints)\n    - [Postgress Schama Create Table](#postgress-schama-create-table)\n\n## Features\n\n- **User Authentication**: Secure registration and login for users.\n- **Security**: Implemented with secure authentication and authorization to protect user data. cors protection use helmet and cors options\n\n## Technologies Used\n\n- **Backend**: Node.js, Express.js, TypeScript\n- **Database**: PostgreSQL\n- **Authentication**: JWT\n\n## Installation and Setup\n\n### Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- Node.js and npm installed\n- PostgreSQL installed and running\n\n### Environment Setup\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/abdulvahabaa/ticket-management-system-api.git\n   cd ticket-management-system-api\n\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Create an `.env` file in the root directory and add the following:\n\n   ```env\n   PORT=9002\n   PG_USER=postgres\n   PG_HOST=localhost\n   PG_DATABASE=\u003cYour DataBase Name\u003e\n   PG_PASSWORD=\u003cYour Password\u003e\n   PG_PORT=5432\n   JWT_SECRET=\u003cYour JWT Secret\u003e\n\n   ```\n\n### Running the Application\n\n1. Start the backend server:\n\n   ```bash\n   npm run dev\n   ```\n\n2. The API should now be running on `http://localhost:9002`.\n\n## Usage\n\n### API Endpoints\n\n- **Create a User**: `POST /users`\n- **Authentication**: `POST /auth/login`\n- **Assign a User to a Ticket**: `POST /tickets/:ticketId/assign`\n- **Get Ticket Details**: `GET /tickets/:ticketId`\n- **Ticket History**: `GET /tickets/analytics`\n- **Ticket Analytics**: `GET /dashboard/analytics`\n\n### Postgress Schama Create Table\n\n```sql\nCREATE TABLE users (\n    id SERIAL PRIMARY KEY,\n    name VARCHAR(100) NOT NULL,\n    email VARCHAR(100) UNIQUE NOT NULL,\n    password VARCHAR(255) NOT NULL,\n    type VARCHAR(10) CHECK (type IN ('customer', 'admin')) NOT NULL,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```\n\n```sql\nCREATE TABLE tickets (\n    id SERIAL PRIMARY KEY,\n    title VARCHAR(255) NOT NULL,\n    description TEXT NOT NULL,\n    type VARCHAR(50) NOT NULL, \n    venue VARCHAR(255) NOT NULL,\n    status VARCHAR(15) CHECK (status IN ('open', 'in-progress', 'closed')) DEFAULT 'open',\n    price DECIMAL(10, 2),\n    priority VARCHAR(10) CHECK (priority IN ('low', 'medium', 'high')) NOT NULL,\n    due_date TIMESTAMP NOT NULL,\n    assigned_users JSONB DEFAULT '[]'::jsonb,\n    created_by INT REFERENCES users(id) ON DELETE CASCADE,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP\n);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulvahabaa%2Fticket-management-system-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulvahabaa%2Fticket-management-system-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulvahabaa%2Fticket-management-system-api/lists"}