Environment setup and configuration scripts for AquaChain development.
# One-command setup (recommended)
scripts\setup\quick-start.bat # Windows
./scripts/setup/quick-start.sh # Linux/MacThis will:
- Check prerequisites (Python, Node.js, AWS CLI)
- Install dependencies
- Configure AWS credentials
- Set up local environment
- Create
.envfiles - Initialize database (if needed)
# Start local development servers
scripts\setup\start-local.bat # Windows
./scripts/setup/start-local.sh # Linux/MacThis will:
- Start frontend dev server (React)
- Start local DynamoDB (if configured)
- Open browser to http://localhost:3000
Complete setup for new developers.
Usage:
# Windows
scripts\setup\quick-start.bat
# Linux/Mac
./scripts/setup/quick-start.shWhat it does:
- Validates prerequisites
- Installs Python dependencies
- Installs Node.js dependencies
- Configures AWS CLI
- Creates environment files
- Sets up local database
- Runs initial tests
Duration: 5-10 minutes
Configure local development environment.
Usage:
# Windows
scripts\setup\setup-local.bat
# Linux/Mac
./scripts/setup/setup-local.shWhat it does:
- Creates
.env.localfiles - Configures local DynamoDB
- Sets up test data
- Configures frontend proxy
Start local development servers.
Usage:
# Windows
scripts\setup\start-local.bat
# Linux/Mac
./scripts/setup/start-local.shWhat it does:
- Starts React dev server (port 3000)
- Starts local DynamoDB (port 8000)
- Opens browser automatically
Stop servers:
- Press
Ctrl+Cin terminal
Create admin user in AWS Cognito.
Usage:
.\scripts\setup\create-admin-user.ps1 -Email admin@example.com -Password SecurePass123!Options:
-Email # Admin email address (required)
-Password # Admin password (required)
-UserPoolId # Cognito User Pool ID (optional, auto-detected)What it does:
- Creates user in Cognito
- Assigns admin role
- Confirms email automatically
- Outputs user credentials
-
Python 3.11+
python --version # Should show: Python 3.11.x or higher -
Node.js 18+
node --version # Should show: v18.x.x or higher -
AWS CLI
aws --version # Should show: aws-cli/2.x.x or higher -
Git
git --version # Should show: git version 2.x.x or higher
Configure AWS credentials:
aws configureEnter:
- AWS Access Key ID
- AWS Secret Access Key
- Default region:
ap-south-1 - Default output format:
json
Verify configuration:
aws sts get-caller-identityCreate .env.local in frontend/:
REACT_APP_API_ENDPOINT=http://localhost:3000/api
REACT_APP_USER_POOL_ID=ap-south-1_XXXXXXX
REACT_APP_USER_POOL_CLIENT_ID=xxxxxxxxxxxxxxxxxxxx
REACT_APP_REGION=ap-south-1cd frontend
npm install
npm startAccess at: http://localhost:3000
cd lambda
pip install -r requirements.txt
pytest# Terminal 1: Start backend
cd lambda
python -m flask run
# Terminal 2: Start frontend
cd frontend
npm startIssue: Python 3.11 not found
# Windows: Download from python.org
# Linux: sudo apt install python3.11
# Mac: brew install python@3.11Issue: Node.js 18 not found
# Windows: Download from nodejs.org
# Linux: Use nvm (Node Version Manager)
# Mac: brew install node@18Issue: AWS credentials not found
# Configure AWS CLI
aws configure
# Or set environment variables
export AWS_ACCESS_KEY_ID=your_key
export AWS_SECRET_ACCESS_KEY=your_secret
export AWS_DEFAULT_REGION=ap-south-1Issue: Port 3000 already in use
# Windows: Find and kill process
netstat -ano | findstr :3000
taskkill /PID <PID> /F
# Linux/Mac: Find and kill process
lsof -ti:3000 | xargs kill -9Issue: npm install fails
# Clear npm cache
npm cache clean --force
# Delete node_modules and reinstall
rm -rf node_modules package-lock.json
npm installIssue: pip install fails
# Upgrade pip
python -m pip install --upgrade pip
# Install with verbose output
pip install -r requirements.txt -v-
Pull latest changes
git pull origin develop
-
Start development servers
scripts\setup\start-local.bat
-
Make changes
- Edit code
- Test locally
- Run tests
-
Commit and push
git add . git commit -m "Description of changes" git push origin feature/my-feature
# Run frontend tests
cd frontend
npm test
# Run backend tests
cd lambda
pytest
# Run comprehensive tests
scripts\testing\run-comprehensive-test.bat dev# Deploy to dev environment
scripts\deployment\deploy-all.bat
# Verify deployment
python scripts/testing/production_readiness_validation.py --environment dev- Always pull before starting work - Avoid merge conflicts
- Test locally before committing - Catch issues early
- Use feature branches - Keep main/develop clean
- Run tests before pushing - Ensure code quality
- Keep dependencies updated - Security and performance
- Document environment changes - Update .env.example
For setup issues:
- Check troubleshooting section above
- Review error messages carefully
- Consult team documentation
- Ask in #dev-help Slack channel