π Elite Events - Developer Quick Start
Get up and running in 5 minutes with Elite Events development environment.
Prerequisites
Before you begin, ensure you have:
- Node.js 18.0 or higher (Download)
- npm or yarn package manager
- MySQL 8.0+ database (local or cloud)
- Git for version control
- Code editor (VS Code recommended)
1. Clone & Install (2 minutes)
# Clone the repository
git clone <repository-url>
cd elite_events_nextjs
# Install dependencies
npm install
2. Environment Setup (1 minute)
Create .env file in the project root:
# Database
DATABASE_URL="mysql://user:password@host:3306/database_name"
# NextAuth
NEXTAUTH_SECRET="your-secret-key-here" # Generate with: openssl rand -base64 32
NEXTAUTH_URL="http://localhost:3000"
# Stripe (Optional for development)
NEXT_PUBLIC_STRIPE_PUBLIC_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."
Quick Database URL Format:
mysql://USERNAME:PASSWORD@HOST:PORT/DATABASE_NAME
3. Database Setup (1 minute)
# Push schema to database
npx prisma db push
# Seed with demo data (90 products, 2 users, 67 categories)
npx prisma db seed
Demo Credentials Created:
- Admin:
admin@dcsuniverse.com/admin123 - Customer:
demo@dcsuniverse.com/demo123
4. Start Development Server (30 seconds)
npm run dev
Open http://localhost:3000 π
5. Verify Setup (30 seconds)
β Check Homepage
- Navigate to
http://localhost:3000 - Should see Elite Events homepage
β Test Login
- Click "Sign In" in header
- Login with:
demo@dcsuniverse.com/demo123 - Header should show your username
β Test Admin (Optional)
- Logout
- Login with:
admin@dcsuniverse.com/admin123 - See "Admin" menu in navigation
- Click Admin β Products
π― Common Tasks
Run Tests
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage report
Database Operations
npx prisma studio # Open database GUI
npx prisma migrate dev # Create migration
npx prisma db seed # Re-seed database
Linting & Type Checking
npm run lint # ESLint
npm run type-check # TypeScript
npm run build # Production build
Open Database GUI
npx prisma studio
Opens at http://localhost:5555
π Project Structure
elite_events_nextjs/
βββ src/
β βββ app/ # Next.js App Router pages
β β βββ api/ # API routes
β β βββ (auth)/ # Auth pages (signin, signup)
β β βββ shop/ # Shop pages
β β βββ admin/ # Admin pages
β βββ components/ # React components
β β βββ layout/ # Layout components (Header, Footer)
β β βββ features/ # Feature components (Shop, Cart, Admin)
β βββ redux/ # Redux state management
β β βββ features/ # Redux slices
β βββ lib/ # Utilities & helpers
β βββ types/ # TypeScript types
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.ts # Seed data script
βββ public/ # Static assets
β βββ images/ # Product images
βββ docs/ # Documentation
π§ Development Workflow
1. Create a New Feature
# Create feature branch
git checkout -b feature/my-feature
# Make changes
# ... code code code ...
# Run tests
npm test
# Commit
git add .
git commit -m "Add: my feature"
2. Before Pushing
# Lint and type-check
npm run lint
npm run type-check
# Run tests
npm test
# Build to verify
npm run build
3. Common Development Commands
# Development server with hot reload
npm run dev
# Database GUI
npx prisma studio
# Reset database (β οΈ deletes all data)
npx prisma migrate reset --force
# View logs
# Check terminal running `npm run dev`
ποΈ Database Schema Overview
Core Tables
- User - Authentication & profiles
- Product - Product catalog (90 items)
- Category - Hierarchical categories (67)
- Order - Order tracking
- Cart - Shopping cart items
- Wishlist - Saved products
- Address - Shipping/billing addresses
Advanced Tables
- ProductImage - Product images
- Review - Product reviews
- Inventory - Stock tracking
- StockMovement - Inventory audit
- Notification - User notifications
View Schema: prisma/schema.prisma
π Demo Accounts
Admin Account
Email: admin@dcsuniverse.com
Password: admin123
Access: Full admin panel (/admin/*)
Customer Account
Email: demo@dcsuniverse.com
Password: demo123
Access: Customer features (cart, wishlist, orders)
β οΈ Change these in production!
π Troubleshooting
Port 3000 Already in Use
# Find and kill process
# Windows
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Mac/Linux
lsof -ti:3000 | xargs kill
Database Connection Error
- Verify DATABASE_URL in
.env - Check MySQL is running
- Verify credentials are correct
- Test connection with
npx prisma db push
Module Not Found Errors
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
Prisma Client Out of Sync
npx prisma generate
Environment Variables Not Loading
- Restart dev server (
Ctrl+Cthennpm run dev) - Verify
.envfile exists in root - Check variable names match exactly
π Next Steps
For Development
- π Read Development Guide - Architecture deep-dive
- π Review API Integration Guide - API patterns
- π§ͺ Check Testing Guide - Write tests
For Admin
- ποΈ Read Admin Quick Start - Admin panel guide
For Project Understanding
- π Review Project Status - Current status
- πΊοΈ See Plans Roadmap - Development roadmap
π Need Help?
Documentation
- Full docs in
/docsdirectory - API reference:
docs/API_REFERENCE.md - Troubleshooting:
docs/TROUBLESHOOTING.md
Useful Commands
# View all npm scripts
npm run
# Prisma help
npx prisma --help
# Next.js help
npx next --help
β Setup Verification Checklist
- Node.js 18+ installed
- MySQL database running
-
.envfile configured - Dependencies installed (
npm install) - Database schema pushed (
npx prisma db push) - Database seeded (
npx prisma db seed) - Dev server running (
npm run dev) - Can access homepage (http://localhost:3000)
- Can login with demo account
- Tests passing (
npm test)
π You're Ready!
Start building! Key files to explore:
src/app/page.tsx- Homepagesrc/app/api/- API routessrc/components/- React componentsprisma/schema.prisma- Database schemadocs/guides/DEVELOPMENT.md- Detailed development guide
Happy coding! π
Quick Links: