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
159 lines
3.8 KiB
Markdown
159 lines
3.8 KiB
Markdown
# 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
|
|
|
|
1. Create a `.env` file in the root directory:
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
# 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
|
|
|
|
1. Install dependencies:
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
2. Set up environment variables:
|
|
```bash
|
|
cp .env.example .env
|
|
# Edit .env with your configuration
|
|
```
|
|
|
|
3. Set up the database:
|
|
```bash
|
|
npm run db:push
|
|
```
|
|
|
|
4. Start the development server:
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
## API Endpoints
|
|
|
|
### Authentication
|
|
- `GET /api/login` - Initiate login flow
|
|
- `GET /api/logout` - Logout user
|
|
- `GET /api/auth/user` - Get current user
|
|
|
|
### Events
|
|
- `GET /api/events` - Get all events
|
|
- `POST /api/events` - Create new event
|
|
- `GET /api/events/upcoming` - Get upcoming events
|
|
- `GET /api/events/public` - Public events (for WordPress integration)
|
|
|
|
### Admin
|
|
- `GET /api/users` - Get all users (admin only)
|
|
- `GET /api/stats/admin` - Admin dashboard statistics
|
|
- `POST /api/invitations` - Send DJ invitation
|
|
|
|
## WordPress Integration
|
|
|
|
The system provides public API endpoints for WordPress integration:
|
|
|
|
```javascript
|
|
// 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
|
|
|
|
1. Update the `docker-compose.yml` with your production settings
|
|
2. Set up proper SSL/TLS certificates
|
|
3. Configure your reverse proxy (nginx/Apache)
|
|
4. Set up proper backup for PostgreSQL data
|
|
|
|
### Environment Variables
|
|
|
|
Required environment variables for production:
|
|
- `DATABASE_URL`: PostgreSQL connection string
|
|
- `SESSION_SECRET`: Secure session encryption key
|
|
- `REPLIT_DOMAINS`: Comma-separated list of allowed domains
|
|
- `REPL_ID`: Your Replit application ID
|
|
- `NODE_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 |