ec2ab0e9f4
Adds Dockerfile, docker-compose files, and deployment scripts for containerizing the React/Express app. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 3a22ac80-cd1d-4441-9e36-f24fc2f4c3de Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3478f7c3-db8c-4fca-9165-3adbdf1b5829/e8da43e7-d99c-4328-9fdc-485bdeecffc1.jpg
3.8 KiB
3.8 KiB
DJ Management System
A comprehensive web-based DJ management and event scheduling system built with React, Express.js, and PostgreSQL.
Features
- User Management: DJ profiles with social media links, bio, and contact information
- Event Management: Create, schedule, and manage DJ events with multiple event types
- Availability System: Calendar-based availability management for DJs
- Admin Dashboard: Complete administrative controls for user and event management
- Assignment Tool: Automated DJ assignment with rotation algorithms
- WordPress Integration: API endpoints for displaying events on WordPress sites
- Authentication: Secure authentication using Replit Auth (OpenID Connect)
Quick Start with Docker
Prerequisites
- Docker and Docker Compose installed on your system
Environment Setup
- Create a
.envfile in the root directory:
# Database Configuration
DATABASE_URL=postgresql://postgres:postgres@db:5432/dj_management
# Authentication
SESSION_SECRET=your-super-secret-session-key-here-minimum-32-chars
REPLIT_DOMAINS=localhost,yourdomain.com
REPL_ID=your-repl-id
ISSUER_URL=https://replit.com/oidc
# Application
NODE_ENV=production
PORT=5000
Running with Docker Compose
# Build and start the application
docker-compose up --build
# Run in detached mode
docker-compose up -d --build
# Stop the application
docker-compose down
# View logs
docker-compose logs -f app
The application will be available at http://localhost:5000
Building Docker Image Manually
# Build the Docker image
docker build -t dj-management .
# Run the container
docker run -p 5000:5000 \
-e DATABASE_URL="your-database-url" \
-e SESSION_SECRET="your-session-secret" \
-e REPLIT_DOMAINS="localhost" \
dj-management
Development Setup
Prerequisites
- Node.js 18+
- PostgreSQL database
- npm or yarn
Local Development
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration
- Set up the database:
npm run db:push
- Start the development server:
npm run dev
API Endpoints
Authentication
GET /api/login- Initiate login flowGET /api/logout- Logout userGET /api/auth/user- Get current user
Events
GET /api/events- Get all eventsPOST /api/events- Create new eventGET /api/events/upcoming- Get upcoming eventsGET /api/events/public- Public events (for WordPress integration)
Admin
GET /api/users- Get all users (admin only)GET /api/stats/admin- Admin dashboard statisticsPOST /api/invitations- Send DJ invitation
WordPress Integration
The system provides public API endpoints for WordPress integration:
// Fetch upcoming events for WordPress widget
fetch('https://your-domain.com/api/events/public')
.then(response => response.json())
.then(events => {
// Display events in WordPress
});
Production Deployment
Docker Deployment
- Update the
docker-compose.ymlwith your production settings - Set up proper SSL/TLS certificates
- Configure your reverse proxy (nginx/Apache)
- Set up proper backup for PostgreSQL data
Environment Variables
Required environment variables for production:
DATABASE_URL: PostgreSQL connection stringSESSION_SECRET: Secure session encryption keyREPLIT_DOMAINS: Comma-separated list of allowed domainsREPL_ID: Your Replit application IDNODE_ENV: Set to "production"
Architecture
- Frontend: React 18 with TypeScript, Vite, TailwindCSS
- Backend: Express.js with TypeScript, Drizzle ORM
- Database: PostgreSQL with session storage
- Authentication: OpenID Connect (Replit Auth)
- UI Components: Radix UI primitives with shadcn/ui
License
MIT License - see LICENSE file for details