A full-stack event ticketing application designed for selling and verifying tickets for house parties and private events. This system features a secure payment flow using Paystack, automated ticket generation, and a real-time verification interface for door entry.
The repository is organized as a monorepo containing two distinct applications:
frontend/: A modern React application (Vite + TypeScript + Tailwind CSS) for the user interface.server/: A robust REST API (Node.js + Express + TypeScript) that handles business logic, database interactions, and payments.
- Framework: React 19
- Build Tool: Vite
- Styling: Tailwind CSS v4
- Language: TypeScript
- Routing: React Router
- HTTP Client: Native Fetch / Custom Utils
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB (with Mongoose ODM)
- Payment Gateway: Paystack API
- Language: TypeScript
Ensure you have the following installed before proceeding:
Navigate to the server directory and install dependencies:
cd server
npm install
Create a .env file in the server/ root directory with the following variables:
# Server Configuration
PORT=3000
APP_PUBLIC_URL=http://localhost:3000
# Database
MONGO_URI=mongodb://localhost:27017/house_party_tickets
# Paystack Configuration (Get these from your Paystack Dashboard)
PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxx
PAYSTACK_PUBLIC_KEY=pk_test_xxxxxxxxxxxxxxxxxxxx
# Event Details
EVENT_NAME="Summer House Party 2026"
EVENT_DATE="2026-07-20T18:00:00.000Z"
TOTAL_TICKETS=200
TICKET_PRICE_GHS=150
Start the backend server:
npm run dev
> The server will start on `http://localhost:3000`.
The server will start on
http://localhost:3000.
Open a new terminal, navigate to the frontend directory, and install dependencies:
cd frontend
npm install
Start the frontend development server:
npm run dev
The frontend will start on
http://localhost:5173.
- Users visit the Home page and click "Get Ticket".
- They enter their details (Name, Email, Phone).
- The system initializes a transaction with Paystack.
- Users are redirected to Paystack to complete payment (Card, Mobile Money, etc.).
- Upon success, they are redirected to a Confirmation page displaying their unique Ticket Code.
-
Event organizers navigate to the
/verifyroute (e.g.,http://localhost:5173/verify). -
Enter the attendee's Ticket Code.
-
The system checks the database:
- ✅ Valid: Ticket exists and hasn't been used. (Status updates to
USED). ⚠️ Used: Ticket exists but was already scanned.- ❌ Invalid: Ticket code does not exist.
.
├── frontend/ # Client-side React application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── hooks/ # Custom React hooks (e.g., useAvailability)
│ │ ├── pages/ # Application views (Home, Buy, Verify)
│ │ └── utils/ # API helpers
│ └── ...
│
├── server/ # Server-side Node.js application
│ ├── src/
│ │ ├── config/ # Environment & DB config
│ │ ├── models/ # Mongoose Data Models (Order, Ticket)
│ │ ├── routes/ # API Route definitions
│ │ ├── services/ # Logic for Paystack & Ticket handling
│ │ └── app.ts # App entry point
│ └── ...
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/tickets/initialize |
Creates an order and gets Paystack auth URL |
GET |
/api/tickets/verify-payment |
Verifies transaction after callback |
GET |
/api/tickets/verify/:code |
Checks if a ticket code is valid for entry |
GET |
/api/tickets/availability |
Checks remaining ticket count |
POST |
/api/tickets/webhook |
Receives Paystack webhooks (optional) |
This project is open-source and available under the MIT License.