This directory contains scripts to run the Layercake development environment with both frontend and backend services.
./dev.shdev.bat- Check Prerequisites: Verify that required directories exist
- Port Management: Free up ports 8080 (backend) and 1420 (frontend) if occupied
- Database Setup: Initialize the SQLite database if it doesn't exist
- Backend Server: Start the Rust backend with GraphQL and REST APIs
- Frontend Server: Start the React frontend with hot reload
- Environment Setup: Configure CORS and API endpoints automatically
- Health Monitoring: Monitor both services and provide status updates
You can customize the setup using environment variables:
# Set log level (debug, info, warn, error)
export LOG_LEVEL=debug
# Custom ports (if needed)
export BACKEND_PORT=3000
export FRONTEND_PORT=5173
./dev.shWhen running, the following services will be available:
| Service | URL | Description |
|---|---|---|
| Frontend App | http://localhost:1420 | React application with Plan DAG editor |
| Backend API | http://localhost:8080 | REST and GraphQL APIs |
| API Documentation | http://localhost:8080/swagger-ui/ | Swagger UI for REST APIs |
| GraphQL Playground | http://localhost:8080/graphql | GraphQL endpoint for queries/mutations |
The scripts create log files in the project root:
backend.log- Backend server logsfrontend.log- Frontend build and dev server logs
View logs in real-time:
# Backend logs
tail -f backend.log
# Frontend logs
tail -f frontend.log- Graceful: Press
Ctrl+Cin the terminal running the script - Force: The script automatically cleans up ports on exit
The script automatically attempts to free ports, but if issues persist:
# Kill processes on specific ports
lsof -ti:8080 | xargs kill -9
lsof -ti:1420 | xargs kill -9If database initialization fails:
# Manually initialize
cargo run --bin layercake -- db initIf frontend fails to start:
# Clean install
cd frontend
rm -rf node_modules package-lock.json
npm installIf backend fails to compile:
# Clean build
cargo clean
cargo build -p layercake-core -p layercake-cli -p layercake-server- Start Development: Run
./dev.sh(ordev.baton Windows) - Open Frontend: Navigate to http://localhost:1420
- Test Plan Editor: Click "Plan Editor" in the sidebar
- Make Changes: Edit code - both frontend and backend support hot reload
- View Logs: Monitor
backend.logandfrontend.logfor issues - Stop Services: Press
Ctrl+Cwhen done
- Hot Reload: Frontend automatically reloads on code changes
- CORS Enabled: Backend configured to accept requests from frontend
- Database Persistence: SQLite database persists between runs
- Error Reporting: Detailed error logs for debugging
- Health Monitoring: Automatic detection of service failures
✅ Implemented:
- ReactFlow Plan DAG visual editor
- Apollo Client with GraphQL integration
- Custom node types and connection validation
- Real-time collaboration framework
- Professional UI with navigation
🔄 In Progress:
- Backend GraphQL API implementation
- Database schema for Plan DAG storage
- Node configuration dialogs
The development scripts are ready to support the complete Phase 1.3 frontend and future backend development.