Skip to content

Latest commit

 

History

History
266 lines (185 loc) · 4.76 KB

File metadata and controls

266 lines (185 loc) · 4.76 KB

⚡ Quick Start Guide

Get the Service Request App running in minutes!

🚀 Fastest Way (Docker - 2 minutes)

# 1. Start everything
docker-compose up -d

# 2. Wait 30 seconds for database initialization

# 3. Open your browser

Access the app:

Default Login:

  • Username: admin
  • Password: admin123

That's it! You're done! 🎉


🛠️ Alternative: Local Development (5 minutes)

Prerequisites Check

# Check if you have Node.js installed
node --version  # Should be 18+

# Check if you have MySQL installed
mysql --version  # Should be 8.0+

Installation Steps

# 1. Install all dependencies
npm run install:all

# 2. Configure environment
# Edit backend/.env with your MySQL credentials

# 3. Setup database
cd backend
npm run migrate
npm run seed

# 4. Start the app
cd ..
npm run dev

Access the app:


📋 What You Get

Customer Features ✨

  • Submit service requests
  • Choose service types
  • Set preferred dates
  • Add special instructions

Admin Features 📊

  • View dashboard statistics
  • See 7-day trends
  • Manage all requests
  • Schedule assignments
  • Track status updates

🎯 First Steps

As a Customer:

  1. Go to http://localhost:3000
  2. Fill out the service request form
  3. Submit and receive confirmation

As an Admin:

  1. Go to http://localhost:3000/admin/login
  2. Login with: admin / admin123
  3. View the dashboard
  4. Click "Schedule" on pending requests
  5. Assign driver and vehicle

🔍 Testing the API

Using Postman:

  1. Import postman_collection.json
  2. Run the "Login" request
  3. Token is saved automatically
  4. Try other endpoints

Using curl (Windows PowerShell):

Login:

$body = @{
    username = "admin"
    password = "admin123"
} | ConvertTo-Json

$response = Invoke-RestMethod -Uri "http://localhost:5000/api/auth/login" -Method Post -Body $body -ContentType "application/json"
$token = $response.token

Get Service Requests:

$headers = @{
    Authorization = "Bearer $token"
}
Invoke-RestMethod -Uri "http://localhost:5000/api/service-requests" -Headers $headers

🐛 Troubleshooting

Docker not working?

# Check if Docker is running
docker ps

# Restart Docker Desktop

# Try again
docker-compose down
docker-compose up -d

Port already in use?

# Windows - Kill process on port 3000
Get-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess | Stop-Process

# Or change ports in docker-compose.yml

Database connection error?

# Check if MySQL is running
docker-compose ps mysql

# View MySQL logs
docker-compose logs mysql

# Restart MySQL
docker-compose restart mysql

Can't login?

# Re-seed the database
docker-compose exec backend npm run seed

# Or check credentials in backend/logs/

📚 Next Steps

  1. Explore the Code

    • Backend: backend/src/
    • Frontend: frontend/src/
  2. Read Documentation

  3. Try API Endpoints

  4. Customize

    • Update branding
    • Add new features
    • Deploy to production

💡 Useful Commands

# View logs
docker-compose logs -f

# Stop everything
docker-compose down

# Restart a service
docker-compose restart backend

# Access database
docker-compose exec mysql mysql -u admin -p

# Run tests
cd backend && npm test

🎓 Learn More


✅ Health Check

Verify everything is working:

# Check health endpoint
curl http://localhost:5000/health

# Should return: {"status":"OK","timestamp":"..."}

🆘 Need Help?

  1. Check README.md troubleshooting section
  2. View COMMANDS.md for all commands
  3. Check Docker logs: docker-compose logs -f
  4. Review ARCHITECTURE.md for design details

🎉 Success!

If you can:

  • ✅ Access the customer portal
  • ✅ Login to admin dashboard
  • ✅ See sample data
  • ✅ Create a service request

Congratulations! You're all set! 🚀


Enjoy building with the Service Request Management System!

For detailed information, see README.md