Welcome to the events platform API, built using TypeScript, Express and PostgreSQL. It's designed for building full stack applications that are aimed at listing events that users can sign up/register to attend, and so event managers can sign up and create a team for themselves or with other team members.
You can use one of these logins to test the app as the following roles:
| Role | Username | Password |
|---|---|---|
| Admin | siteadmin | password123 |
| Team Admin | alice123 | password123 |
| Event Manager | eventmanager | password123 |
| User | regularuser | password123 |
- User registration with validation for username, email, and password
- Support for regular user and event organiser registration
- JWT-based authentication with access and refresh tokens
- Secure login/logout functionality
- Comprehensive user profile management
- Role-based permissions system
- Profile updates for username, email, and profile images
- User registration tracking for events
- Create and manage teams with team admins and event managers
- Add team members with specific roles
- Team dashboard for managing team-specific information
- Role-based access control for team operations
- Create, update, and delete events
- Draft and published event states
- Filter events by category, location, price range, and date
- Sort events by various criteria
- Event capacity and attendance management
- Public and private event visibility
- Register for available events
- Email confirmation for registrations
- Cancel and reactivate registrations
- Ticket generation and management
- Registration validation based on event capacity and availability
- Stripe integration for event payments
- View payment history
- Complete payment flow from checkout to ticket issuance
- Webhook handling for payment status updates
- Full system access
- Manage all users, events, and teams
- Access to admin dashboard
- Promote users to site admin
- Create and manage their team
- Add and manage team members
- Create and manage team events
- Access to team dashboard
- Create and manage events for their team
- View and manage team-specific event data
- Access to team dashboard
- Register for events
- View and manage personal registrations
- Update personal profile information
- View tickets and payment history
The API follows RESTful principles and provides endpoints for all the features mentioned above. Detailed API documentation is available at /api when running the server.
- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
- npm or yarn
git clone https://github.com/TTibbs/events-api
cd events-platform-apinpm installJWT_SECRET=your_jwt_secret
DATABASE_URL=your_supabase_db_url
SENDGRID_API_KEY=your_sendgrid_api_key
SENDGRID_FROM_EMAIL=your_send_from_email_in_sendgrid
STRIPE_PUBLISHABLE_KEY=your_strike_sk_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
FRONTEND_URL=the_redirect_url_for_stripe_rejected_paymentsnpm run setup-dbsSeeding for testing
npm run seedSeeding for production
npm run seed-prodnpm startThe application includes comprehensive test suites for all features:
npm testnpm test auth.testFor production deployment:
npm run build
npm startThis project is licensed under the MIT License - see the LICENSE file for details.