Files
ClubLogos/QUICKSTART.md
T
Tomáš Dvořák 0fc92f8464 first commit
2025-10-02 12:39:28 +02:00

3.2 KiB

🚀 Quick Start Guide

Get the Czech Clubs Logos API running in under 5 minutes!

🐳 Option 1: Docker (Easiest)

Prerequisites: Docker Desktop installed

# Start everything
docker-compose up

# That's it! 🎉

Access:

💻 Option 2: Local Development

Backend Setup

Prerequisites: Go 1.21+, GCC

# Navigate to backend
cd backend

# Install dependencies
go mod download

# Run the server
go run .

Backend runs at: http://localhost:8080

Frontend Setup

Prerequisites: Node.js 18+

# Navigate to frontend
cd frontend

# Install dependencies
npm install

# Start dev server
npm run dev

Frontend runs at: http://localhost:3000

🎯 First Steps

1. Search for a Club

  • Open http://localhost:3000
  • Click "🔍 Search Clubs"
  • Type "Sparta" or "Slavia"
  • Click a result to copy its UUID
  • Click "⬆️ Upload Logo"
  • Paste the UUID from step 1
  • Drag & drop or browse for a logo file (SVG/PNG)
  • Click "Upload Logo"

Visit: http://localhost:8080/logos/{UUID}

Or get JSON metadata: http://localhost:8080/logos/{UUID}/json

📦 Test with Demo Data

The backend includes demo clubs you can search for:

  • SK Slavia Praha
  • AC Sparta Praha
  • FC Viktoria Plzeň
  • FC Baník Ostrava
  • SK Sigma Olomouc

🛠️ Common Commands

Docker

# Start services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

# Rebuild images
docker-compose build --no-cache

Backend

cd backend
go run .              # Run dev server
go build .            # Build binary
go test ./...         # Run tests

Frontend

cd frontend
npm run dev           # Dev server
npm run build         # Production build
npm run preview       # Preview build

🔧 Configuration

Change Backend Port

Edit docker-compose.yml:

environment:
  - PORT=8080  # Change this

Change Frontend API URL

Edit frontend/src/main.js:

const API_BASE_URL = 'http://localhost:8080'  // Change this

⚠️ Troubleshooting

Port Already in Use

# Windows
netstat -ano | findstr :8080
netstat -ano | findstr :3000

# Kill process by PID
taskkill /PID <PID> /F

Docker Issues

# Clean everything and restart
docker-compose down -v
docker-compose up --build

Backend Won't Start

  • Ensure GCC is installed (needed for SQLite)
  • Check if port 8080 is available
  • Check logs: docker-compose logs backend

Frontend Build Fails

# Clear node_modules and reinstall
cd frontend
rm -rf node_modules package-lock.json
npm install

📚 Next Steps

🆘 Need Help?

  • Check logs: docker-compose logs -f
  • Test API: curl http://localhost:8080/health
  • Verify frontend: Open http://localhost:3000

Happy coding! 🎉