GatePass is a decentralized event ticketing platform that uses blockchain technology (NFTs) for secure, verifiable tickets. This guide will help you set up your local development environment.
Prerequisites
Before you begin, ensure you have the following installed:Node.js
Version 18 or higher required
npm or pnpm
Package manager for dependencies
Git
Version control system
PostgreSQL
Optional: SQLite used by default for development
Quick Start
1. Clone the Repository
2. Install Dependencies
Install all project dependencies using npm:- Frontend (React/Vite)
- Backend API (Express/Node.js)
- Database package (Prisma)
The project uses a monorepo structure with packages in
src/packages/3. Environment Configuration
Copy the example environment file and configure your variables:.env and add your configuration. See Environment Variables for detailed information.
Required variables for basic setup:
.env
4. Database Setup
The project uses Prisma ORM with SQLite for development and PostgreSQL for production.Initialize the Database
Navigate to the database package and run migrations:- Create the SQLite database file (
dev.db) - Run all migrations
- Generate the Prisma Client
Seed Demo Data
Populate the database with sample events and users:5. Run the Application
The application consists of two main parts that need to be running:Start the Backend Server
Open a terminal window and start the Express API server:Start the Frontend Development Server
Open a new terminal window and start the Vite development server:Success! Your development environment is now running.
Access the Application
Frontend
Main application interface
http://localhost:5173Backend API
REST API server
http://localhost:8000API Documentation
Swagger API docs
http://localhost:8000/docsPrisma Studio
Database GUI (run
npm run studio)http://localhost:5555Development Workflow
Making Code Changes
Both the frontend and backend support hot module replacement (HMR):- Frontend: Vite automatically reloads changes in
.tsx,.ts, and.cssfiles - Backend: tsx watch mode automatically restarts the server on file changes
Database Changes
When you modify the Prisma schema:View Database
Use Prisma Studio to view and edit your database:http://localhost:5555.
Project Structure
Common Commands
Frontend Commands
Frontend Commands
Backend Commands
Backend Commands
Database Commands
Database Commands
Troubleshooting
Port Already in Use
Port Already in Use
If you see an error about ports 5173 or 8000 being in use:
Database Connection Errors
Database Connection Errors
If you encounter database errors:
Module Not Found Errors
Module Not Found Errors
If you see module resolution errors:
Prisma Client Errors
Prisma Client Errors
If Prisma Client is not found:The Prisma Client is generated to
src/packages/database/generated/client.Next Steps
Environment Variables
Configure your development environment
Database Schema
Learn about the data models
Testing
Run and write tests
API Reference
Explore API endpoints