Welcome to Aphrodite! This guide will help you set up a local development environment and contribute to the project.
Get up and running in under 5 minutes:
# 1. Clone the repository
git clone https://github.com/jackkerouac/aphrodite.git
cd aphrodite
# 2. Run development setup script
.\scripts\dev-setup.ps1
# 3. Start development environment
docker-compose -f docker-compose.dev.yml up -d
# 4. Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000
# API Documentation: http://localhost:8000/docs# 1. Clone the repository
git clone https://github.com/jackkerouac/aphrodite.git
cd aphrodite
# 2. Make scripts executable and run setup
chmod +x scripts/*.sh
./scripts/dev-setup.sh
# 3. Start development environment
docker-compose -f docker-compose.dev.yml up -d
# 4. Access the application
# Frontend: http://localhost:3000
# Backend API: http://localhost:8000
# API Documentation: http://localhost:8000/docs- Docker Desktop - For containerized development (required)
- Git - For version control
- PowerShell 5.1+ - For Windows users (VS Code terminal)
- Bash - For Linux/macOS users
- Node.js 18+ - For frontend development (optional, if running natively)
- Python 3.11+ - For backend development (optional, if running natively)
This is the easiest way to get started and ensures consistency across all platforms.
# Start all services with hot reloading
docker-compose -f docker-compose.dev.yml up -d
# View logs
docker-compose -f docker-compose.dev.yml logs -f
# Stop services
docker-compose -f docker-compose.dev.yml down
# Rebuild after dependency changes
docker-compose -f docker-compose.dev.yml up --build# Start all services with hot reloading
docker-compose -f docker-compose.dev.yml up -d
# View logs
docker-compose -f docker-compose.dev.yml logs -f
# Stop services
docker-compose -f docker-compose.dev.yml down
# Rebuild after dependency changes
docker-compose -f docker-compose.dev.yml up --buildServices:
- Frontend: http://localhost:3000 (Next.js with hot reloading)
- Backend API: http://localhost:8000 (FastAPI with hot reloading)
- API Docs: http://localhost:8000/docs (Swagger UI)
- Database: PostgreSQL on port 5433
- Redis: Redis on port 6379
Run database services in Docker but frontend/backend natively for maximum development speed.
# Start only database services
docker-compose -f docker-compose.dev.yml up postgres redis -d
# Run backend natively (PowerShell terminal 1)
cd api
pip install -r requirements.txt
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Run frontend natively (PowerShell terminal 2)
cd frontend
npm install
npm run dev# Start only database services
docker-compose -f docker-compose.dev.yml up postgres redis -d
# Run backend natively (terminal 1)
cd api
pip install -r requirements.txt
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
# Run frontend natively (terminal 2)
cd frontend
npm install
npm run devaphrodite/
├── api/ # FastAPI backend
│ ├── main.py # API entry point
│ ├── requirements.txt # Python dependencies
│ └── ...
├── frontend/ # Next.js frontend (React + TypeScript)
│ ├── src/ # Source code
│ ├── package.json # Node.js dependencies
│ └── ...
├── shared/ # Shared utilities between frontend/backend
├── aphrodite_logging/ # Logging utilities
├── aphrodite_helpers/ # Helper functions
├── workers/ # Background job workers
├── scripts/ # Development and deployment scripts
├── docker-compose.dev.yml # Development environment
└── docker-compose.yml # Production environment
# Always build frontend before creating production Docker images
cd frontend
npm run build
# This generates the required .next directory for production# Always build frontend before creating production Docker images
cd frontend
npm run build
# This generates the required .next directory for production- Follow PEP 8 style guidelines
- Use type hints for function parameters and return values
- Use async/await for database operations
- Maximum line length: 88 characters (Black formatter)
# Good
async def get_user(user_id: int) -> Optional[User]:
"""Retrieve user by ID."""
return await User.get_or_none(id=user_id)- Use TypeScript for all new code
- Follow React functional components with hooks
- Use Tailwind CSS v4 for styling
- Prefer named exports over default exports
// Good
export const UserProfile: React.FC<UserProfileProps> = ({ userId }) => {
const [user, setUser] = useState<User | null>(null);
return (
<div className="p-4 bg-white rounded-lg">
{user?.name}
</div>
);
};-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Code changes are automatically reloaded in development
- Backend changes trigger FastAPI auto-reload
- Frontend changes trigger Next.js hot module replacement
-
Test your changes
# Run all tests .\scripts\test.ps1 # Run only backend tests .\scripts\test.ps1 -Backend # Run only frontend tests .\scripts\test.ps1 -Frontend # Run only integration tests .\scripts\test.ps1 -Integration
# Run all tests ./scripts/test.sh # Run backend tests cd api && python -m pytest # Run frontend tests cd frontend && npm test # Run integration tests ./scripts/integration-test.sh
-
Commit and push
git add . git commit -m "feat: add user profile component" git push origin feature/your-feature-name
Development environment variables are in .env.development. Copy and modify as needed:
Copy-Item .env.development .env.local
# Edit .env.local with your specific settingscp .env.development .env.local
# Edit .env.local with your specific settingsKey variables:
DATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringJELLYFIN_URL: Your Jellyfin server URLDEBUG: Enable debug loggingSECRET_KEY: JWT secret (change in production)
# Run migrations
cd api
python database_defaults_init.py
# Reset development database
.\scripts\reset-db.ps1# Run migrations
cd api
python database_defaults_init.py
# Reset development database
./scripts/reset-db.shThe development environment starts with a clean database. Use the web interface to:
- Configure Jellyfin connection
- Import your anime library
- Set up user preferences
# All tests
.\scripts\test.ps1
# Backend only
.\scripts\test.ps1 -Backend
# Frontend only
.\scripts\test.ps1 -Frontend
# Integration tests
.\scripts\test.ps1 -Integration# All tests
./scripts/test.sh
# Backend only
cd api && python -m pytest
# Frontend only
cd frontend && npm test
# Integration tests
./scripts/integration-test.sh- Backend: Use pytest with async support
- Frontend: Use Jest and React Testing Library
- Integration: Test API endpoints with real database
- Logs available at
http://localhost:8000/logsordocker-compose logs api - Use debugger: Add
import pdb; pdb.set_trace() - Database queries logged in debug mode
- React DevTools browser extension
- Console logs available in browser
- Next.js build errors shown in terminal
Database connection errors:
# Check if PostgreSQL is running
docker-compose -f docker-compose.dev.yml ps postgres
# Reset database
.\scripts\reset-db.ps1# Check if PostgreSQL is running
docker-compose -f docker-compose.dev.yml ps postgres
# Reset database
./scripts/reset-db.shFrontend build errors with Tailwind v4:
cd frontend
Remove-Item -Recurse -Force .next, node_modules
npm install
npm run buildcd frontend
rm -rf .next node_modules
npm install
npm run buildHot reloading not working:
# Restart development services
docker-compose -f docker-compose.dev.yml restart api frontend-
Before submitting:
- Code follows style guidelines
- Tests pass locally
- Frontend builds successfully (required for Tailwind v4)
- Documentation updated if needed
-
PR Requirements:
- Clear description of changes
- Link to related issue (if applicable)
- Screenshots for UI changes
- Test coverage for new features
-
Review Process:
- Maintainer will review within 48 hours
- Address feedback promptly
- Squash commits before merge
Use the bug report template and include:
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Docker version, PowerShell/Bash version, etc.)
- Relevant logs or screenshots
Use the feature request template and include:
- Use case description
- Proposed solution
- Alternative solutions considered
- Mockups or examples (if applicable)
- Documentation: Check the
/docsdirectory - Discussions: GitHub Discussions for questions
- Issues: GitHub Issues for bugs and features
- Development Chat: Join our Discord (link in README)
Both PowerShell (.ps1) and Bash (.sh) versions are provided for cross-platform compatibility.
# Setup development environment
.\scripts\dev-setup.ps1
# Run all tests
.\scripts\test.ps1
# Reset development database
.\scripts\reset-db.ps1
# Build for production (includes frontend)
.\scripts\build.ps1
# Clean development environment
.\scripts\clean.ps1
# Validate setup
.\scripts\validate-setup.ps1# Make scripts executable first
chmod +x scripts/*.sh
# Setup development environment
./scripts/dev-setup.sh
# Run all tests
./scripts/test.sh
# Reset development database
./scripts/reset-db.sh
# Build for production (includes frontend)
./scripts/build.sh
# Clean development environment
./scripts/clean.sh
# Validate setup
./scripts/validate-setup.sh- Use async database operations
- Implement proper caching with Redis
- Monitor API response times
- Use database indexes for queries
- Optimize images and assets
- Use React.memo for expensive components
- Implement proper loading states
- Minimize bundle size
Thank you for contributing to Aphrodite! 🚀
For questions or help, open a GitHub Discussion or reach out to the maintainers.