Complete guide for setting up and developing TapIn.
scripts\verify.batscripts\setup-docker.batdocker-compose exec backend python manage.py createsuperuser- Backend API: http://localhost:8000
- Django Admin: http://localhost:8000/admin
- Frontend: http://localhost:3000 (after frontend setup)
-
Setup conda environment:
scripts\setup-conda.bat conda activate tapin -
Configure environment:
cd backend copy .env.example .env # Edit .env with your PostgreSQL credentials
-
Run migrations:
python manage.py migrate python manage.py createsuperuser
-
Start server:
python manage.py runserver
-
Install dependencies:
cd frontend npm install -
Configure environment:
copy .env.local.example .env.local
-
Start development server:
npm run dev
# Start services
docker-compose up
# Start in background
docker-compose up -d
# Stop services
docker-compose down
# View logs
docker-compose logs -f
# Rebuild
docker-compose up --build# Activate environment
conda activate tapin
cd backend
# Run server
python manage.py runserver
# Migrations
python manage.py makemigrations
python manage.py migrate
# Django shell
python manage.py shell
# Create superuser
python manage.py createsuperuser
# Run tests
pytest # All tests
pytest -m unit # Unit tests only
pytest -m property # Property-based tests
pytest --cov=core # With coverage
# Or use script
scripts\test-backend.batcd frontend
# Development
npm run dev
# Build
npm run build
# Production
npm start
# Tests
npm test # Watch mode
npm run test:ci # CI mode
# Or use script
scripts\test-frontend.bat
# Lint
npm run lintWith Docker:
# Access database
docker-compose exec db psql -U postgres -d tapin_db
# Backup
docker-compose exec db pg_dump -U postgres tapin_db > backup.sql
# Restore
docker-compose exec -T db psql -U postgres tapin_db < backup.sqlLocal PostgreSQL:
# Create database
createdb tapin_db
# Connect
psql -d tapin_db
# Backup/Restore
pg_dump tapin_db > backup.sql
psql tapin_db < backup.sql# All tests
pytest
# Specific markers
pytest -m unit # Unit tests
pytest -m property # Property-based tests
pytest -m integration # Integration tests
# Specific file
pytest tests/unit/test_models.py
# With coverage
pytest --cov=core --cov-report=htmlnpm test # Watch mode
npm run test:ci # Single run
npm test -- --coverage # With coverageCannot connect to Docker daemon:
- Ensure Docker Desktop is running
- Restart Docker Desktop
Port already in use:
- Stop services using ports 8000 or 5432
- Or change ports in
docker-compose.yml
Connection refused:
- Verify PostgreSQL is running
- Check credentials in
.env - Ensure database exists
Migration errors:
- Delete database and recreate
- Run
python manage.py migrate --run-syncdb
Environment not found:
conda env remove -n tapin
conda env create -f environment.yml# Python cache
find . -type d -name __pycache__ -exec rm -r {} +
# Node modules
cd frontend
rm -rf node_modules
npm install
# Docker volumes
docker-compose down -v- Review CHANGELOG.md for recent changes
- Check tasks.md for tasks
- Read design.md for architecture
- Follow workflow.md for contribution process