This project supports both development and production environments with different frontend serving strategies.
Configuration:
- Frontend: Vite dev server on port 3210
- Backend: FastAPI on port 8085 with
DEVELOPMENT_MODE=true - Base path:
/(root)
How it works:
- Vite serves frontend with
base: '/' - Backend API proxied through Vite (
/apiand/admin→localhost:8085) - Backend redirects non-API routes to frontend dev server
- Hot reload and fast development
Access URLs:
http://localhost:3210- Main development URLhttp://your-host-url:3210- Network access
Start development:
./start-dev-env-watch.shTo mirror the GitHub Actions checks before every push, enable the bundled git hooks once per clone:
git config core.hooksPath .githooksAfter this, every git push will run:
- Branch and commit format validation (
.github/scripts/validate_format.py) - Python linters:
flake8,black --check,isort --check-only - Frontend lint (
npm run lint)
Make sure you have the development dependencies installed (pip install -e .[dev] and npm install in frontend/).
Need to bypass the hook temporarily? Use
SKIP_LOCAL_CI=1 git pushorgit push --no-verify.
Configuration:
- Frontend: Built and served from backend
/static/path - Backend: FastAPI on port 8085 with
DEVELOPMENT_MODE=false(default) - Base path:
/static/
How it works:
- Frontend built with
base: '/static/' - Build copied to
backend/static/ - Backend serves static files from
/static/ - Backend serves SPA for non-API routes
Build for production:
cd frontend
NODE_ENV=production npm run build
cp -r build/* ../backend/static/Docker production:
- Dockerfile handles the build and copy automatically
- Frontend build →
/app/backend/static
frontend/vite.config.mjs- Base path configurationbackend/osmosmjerka/app.py- Development mode detectionstart-dev-env-watch.sh- Development startup script
NODE_ENV=production- Triggers/static/base path in ViteDEVELOPMENT_MODE=true- Backend development mode (redirects to frontend dev server)
MIME type errors:
- Ensure you're accessing
localhost:3210in development, notlocalhost:8085 - Check that
DEVELOPMENT_MODE=trueis set for backend in development
Static files not loading:
- In production: Verify build copied to
backend/static/ - In development: Check Vite dev server is running on port 3210
Module loading errors (blank page):
- App shows error page instead of blank screen for failed module imports
- Common causes: Network issues, server downtime, corrupted build files
- Solution: Reload page or rebuild frontend with correct base path
- Check browser console for specific error details
Error boundary features:
- Catches module loading failures and JavaScript errors
- Shows user-friendly error page with reload/retry options
- Displays technical details in development mode
- Supports multiple languages (EN/HR/PL)