Complete guide to setting up Meteo Weather App for local development
Before you begin, ensure you have the following installed:
- Node.js 14.0.0 or higher (Download)
- npm 6.0.0 or higher (comes with Node.js)
- Docker 20.10+ (Download)
- Docker Compose 1.29+ (usually bundled with Docker Desktop)
- Git (Download)
Optional but recommended:
- Visual Studio Code with extensions:
- ESLint
- Prettier
- Docker
- GitLens
git clone https://github.com/mbuckingham74/meteo-weather.git
cd meteo-weatherFrom the root directory:
npm run install:allThis installs dependencies for root, frontend, and backend.
# Copy the example environment file to project root
cp .env.example .envEdit .env with your API keys (see API Keys section below).
Minimum required for local development:
# Database
DB_HOST=localhost
DB_PORT=3307
DB_USER=root
DB_PASSWORD=rootpassword
DB_NAME=meteo_db
# Required API Key
VISUAL_CROSSING_API_KEY=your_key_here
# Required for Radar Maps
OPENWEATHER_API_KEY=your_key_here
# Optional - AI features won't work without this
ANTHROPIC_API_KEY=your_key_hereOption A: Using Docker (Recommended)
npm run dev
# or
docker-compose upOption B: Without Docker (Manual)
# Terminal 1 - Start MySQL (you'll need MySQL installed)
mysql.server start
# Terminal 2 - Start Backend
cd backend
npm run dev
# Terminal 3 - Start Frontend
cd frontend
npm run dev- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
- API Health Check: http://localhost:5001/api/health
- Go to Visual Crossing Weather
- Sign up for a free account
- Navigate to your account page
- Copy your API key
- Free tier: 1,000 records/day
- Go to OpenWeather
- Sign up for a free account
- Go to API Keys section
- Copy your API key (may take a few hours to activate)
- Free tier: 1,000 calls/day
- Go to Anthropic Console
- Sign up and add payment method
- Create an API key
- Pricing: ~$0.01 per AI query (pay-as-you-go)
From the root directory, you can run:
npm run dev # Start full stack with Docker
npm run dev:frontend # Start frontend only
npm run dev:backend # Start backend onlynpm test # Run all tests (frontend + backend)
npm run test:frontend # Run frontend tests only
npm run test:backend # Run backend tests onlynpm run lint # Lint all code
npm run lint:fix # Auto-fix linting issues
npm run format # Format all code with Prettier
npm run format:check # Check formatting without changing filesnpm run db:init # Initialize database
npm run db:schema # Load database schema
npm run db:seed # Seed database with sample datanpm run docker:build # Build Docker images
npm run docker:up # Start containers in detached mode
npm run docker:down # Stop and remove containers
npm run docker:logs # View container logs
npm run docker:restart # Restart all containersnpm run security:scan # Run security verification script
npm run security:audit # Run npm audit on all packagesWe use Husky to run automatic checks before each commit:
- Linting & Formatting - Auto-fixes code style issues
- Regression Tests - Prevents critical bugs from being reintroduced
The hooks will:
- Run ESLint and Prettier on staged files
- Run critical regression tests if you modify specific files
- Auto-format code and re-stage files
- Block commits if critical tests fail
To bypass hooks (not recommended):
git commit --no-verify -m "message"meteo-app/
├── backend/ # Express.js API server
│ ├── config/ # Configuration files
│ ├── middleware/ # Express middleware
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── services/ # Business logic
│ ├── tests/ # Backend tests
│ └── server.js # Entry point
│
├── frontend/ # React (Vite) application
│ ├── public/ # Static files
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── contexts/ # React contexts (state)
│ │ ├── hooks/ # Custom React hooks
│ │ ├── services/ # API clients
│ │ ├── styles/ # CSS files
│ │ ├── utils/ # Utility functions
│ │ └── App.jsx # Main app component
│ └── vite.config.js # Vite configuration
│
├── database/ # Database schema and migrations
│ ├── schema.sql # Database structure
│ └── seed.sql # Sample data
│
├── scripts/ # Deployment and utility scripts
├── docs/ # Documentation
└── docker-compose.yml # Local development setup
Recommended Extensions:
- ESLint (dbaeumer.vscode-eslint)
- Prettier (esbenp.prettier-vscode)
- Docker (ms-azuretools.vscode-docker)
- GitLens (eamodio.gitlens)
Recommended Settings (.vscode/settings.json):
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.workingDirectories": [
"frontend",
"backend"
]
}If you see "port already in use" errors:
# Check what's using the port
lsof -i :3000 # Frontend
lsof -i :5001 # Backend
lsof -i :3307 # MySQL
# Kill the process
kill -9 <PID># Clean up Docker
docker-compose down -v # Remove volumes
docker system prune -a # Remove all unused containers/images
# Rebuild from scratch
docker-compose build --no-cache
docker-compose up- Ensure MySQL container is running:
docker ps - Check database credentials in
backend/.env - Try reinitializing:
npm run db:init
# Reinstall all dependencies
npm run install:all
# Or individually
cd frontend && npm install
cd ../backend && npm install# Run the checks manually to see details
npm run lint:fix
npm run test:frontend
npm run test:backend- Read ARCHITECTURE.md to understand the system design
- Review CONTRIBUTING.md for contribution guidelines
- Check docs/troubleshooting/REGRESSION_PREVENTION.md before modifying geolocation code
- Explore TROUBLESHOOTING.md for common issues
- Documentation Issues: Check docs/README.md for more guides
- Bug Reports: GitHub Issues
- Questions: GitHub Discussions
Last Updated: November 5, 2025