{"id":23780697,"url":"https://github.com/hunter87ff/ticket_booking","last_synced_at":"2025-11-10T21:05:30.746Z","repository":{"id":259717007,"uuid":"868483351","full_name":"Hunter87ff/ticket_booking","owner":"Hunter87ff","description":"ticket creation, validation and managing web application using flask and mongodb","archived":false,"fork":false,"pushed_at":"2024-10-30T14:58:55.000Z","size":758,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T09:39:36.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mod.sprucbot.tech","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hunter87ff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-06T13:56:47.000Z","updated_at":"2024-12-15T19:22:30.000Z","dependencies_parsed_at":"2024-10-27T15:05:22.740Z","dependency_job_id":"f2ee91c7-cc2e-44e6-9835-d6847f24fe9b","html_url":"https://github.com/Hunter87ff/ticket_booking","commit_stats":null,"previous_names":["hunter87ff/ticket_booking"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter87ff%2Fticket_booking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter87ff%2Fticket_booking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter87ff%2Fticket_booking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hunter87ff%2Fticket_booking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hunter87ff","download_url":"https://codeload.github.com/Hunter87ff/ticket_booking/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985726,"owners_count":19729515,"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":[],"created_at":"2025-01-01T11:15:56.368Z","updated_at":"2025-11-10T21:05:25.707Z","avatar_url":"https://github.com/Hunter87ff.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\nThis project is a ticket booking application built using Flask, MongoDB, and other technologies. The application includes various components such as API endpoints, error handling, and user authentication.\n\n## Key Components\n\n### 1. app.py\n- **Purpose**: Main application file that initializes the Flask app and defines routes.\n- **Key Sections**:\n    - **Error Handlers**: Custom error pages for 404, 401, 500, and 405 errors.\n    - **Routes**: \n        - `/`: Renders the home page.\n        - `/validate`: Renders the validation page.\n        - `/generate`: Renders the ticket generation page (requires manager authentication).\n        - `/dashboard`: Renders the admin dashboard (requires manager authentication).\n\n### 2. api.py\n- **Purpose**: Defines API endpoints for ticket generation, ticket validation, date updates, and user login.\n- **Key Sections**:\n    - **Endpoints**:\n        - `/api/gen`: Generates a new ticket (requires manager authentication).\n        - `/ticket/\u003ctoken\u003e`: Validates and displays a ticket.\n        - `/api/update_date`: Updates the event date (requires manager authentication).\n        - `/login`: Handles user login and redirects to the dashboard if successful.\n\n### 3. config.py\n- **Purpose**: Configuration file that sets up the database connections, environment variables, and utility functions.\n- **Key Sections**:\n    - **Database Setup**: Connects to MongoDB and initializes collections.\n    - **Utility Functions**: Functions for logging, ticket management, and user authentication.\n    - **Classes**:\n        - `Ticket`: Manages ticket creation and storage.\n        - `Event`: Manages event details and ticket tracking.\n        - `Admin`: Manages admin user details and authentication.\n\n\n## Setup Instructions\n\nTo set up the application on your local machine, follow these steps:\n\n### Prerequisites\n\nEnsure you have the following installed:\n- Python 3.x\n- pip (Python package installer)\n- MongoDB\n\n### Steps\n\n1. **Clone the Repository**:\n    ```sh\n    git clone https://github.com/hunter87ff/ticket_booking.git\n    cd ticket_booking\n    ```\n\n2. **Create a Virtual Environment**:\n    ```sh\n    python -m venv venv\n    ```\n\n3. **Activate the Virtual Environment**:\n    - On Windows:\n        ```sh\n        venv\\Scripts\\activate\n        ```\n    - On macOS/Linux:\n        ```sh\n        source venv/bin/activate\n        ```\n\n4. **Install Dependencies**:\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n5. **Set Up Environment Variables**:\n    Create a `.env` file in the root directory and add the following variables:\n    ```env\n    MONGO_URI=mongo_uri\n    DEV_ENV=True\n    ```\n\n6. **Run the Application**:\n    ```sh\n    python app.py\n    ```\n\n7. **Access the Application**:\n    Open your web browser and navigate to `http://127.0.0.1:8787`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunter87ff%2Fticket_booking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunter87ff%2Fticket_booking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunter87ff%2Fticket_booking/lists"}