Full-stack app with Flutter frontend and Node.js backend in Docker.
- Docker & Docker Compose
- Flutter SDK
- Git
dham-project/
├── backend/
│ ├── server.js
│ ├── package.json
│ ├── Dockerfile
│ └── .dockerignore
├── frontend/
│ └── lib/
│ ├── main.dart
│ ├── services/api_service.dart
│ └── screens/api_test_screen.dart
└── docker-compose.yml
# Create backend files (copy provided code)
# Place in backend/ directory:
# - server.js (Express server)
# - Dockerfile (Docker config)
# - .dockerignorecd frontend
flutter pub get
# Create Flutter files (copy provided code):
# - lib/main.dart
# - lib/services/api_service.dart
# - lib/screens/api_test_screen.dart# Start Docker backend
docker-compose up --build
# Run Flutter (new terminal)
cd frontend
flutter rundocker-compose up --build # Start backend
docker-compose down # Stop backend
docker-compose logs backend # View logsflutter pub get # Install dependencies
flutter run # Run app
flutter clean # Clean buildcurl http://localhost:8000/health # Health check
curl http://localhost:8000/api/test # Connection test
curl http://localhost:8000/api/users # Get users- Android Emulator:
http://10.0.2.2:8000 - iOS Simulator:
http://localhost:8000 - Flutter Web:
http://localhost:8000
After setup you should see:
- ✅ Flutter app shows "Connection successful!"
- ✅ Docker logs: "🚀 DHAM API server running on port 8000"
- ✅ Test buttons work in Flutter app
Port in use: lsof -i :8000 then kill -9 <PID>
CORS errors: Backend includes CORS for all platforms
Flutter issues: flutter doctor and follow fixes
Docker issues: docker system prune -a then rebuild