Archived
- Backend: Django REST Framework API with Bookmark and Note models - ViewSets with user-scoped querysets and select_related for N+1 prevention - Create/List/Detail/Update/Delete endpoints - Batch delete operations - Unique constraint on user+book+page for bookmarks - IsOwner permission class for object-level access control - Full serializer validation (page > 0, non-empty content, duplicate check) - 30+ pytest-django tests covering CRUD, auth, filtering, edge cases - Frontend: React TypeScript components - AnnotationsContext with useReducer for state management - BookmarkList, NoteList, AddAnnotationForm, AnnotationsDashboard - Inline note editing with immediate save - Batch delete support - API client with JWT auto-refresh interceptors - Paginated query hook for infinite scroll support - Responsive CSS with loading/empty states - Infrastructure: Django project with custom User model, JWT auth, CORS - PostgreSQL database models with proper FK and indexes - Django admin configuration for all models
52 lines
1.1 KiB
YAML
52 lines
1.1 KiB
YAML
services:
|
|
db:
|
|
image: postgres:15
|
|
restart: unless-stopped
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
environment:
|
|
POSTGRES_DB: cloudreader
|
|
POSTGRES_USER: cloudreader
|
|
POSTGRES_PASSWORD: cloudreader
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U cloudreader -d cloudreader"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
api:
|
|
build:
|
|
context: ./api
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
DATABASE_URL: "postgres://cloudreader:cloudreader@db:5432/cloudreader"
|
|
DJANGO_SECRET_KEY: "dev-secret-key-change-in-production"
|
|
DJANGO_DEBUG: "True"
|
|
volumes:
|
|
- ./api:/app
|
|
- book_uploads:/app/media
|
|
command: >
|
|
sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
web:
|
|
build:
|
|
context: ./web
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
VITE_API_URL: "http://localhost:8000"
|
|
volumes:
|
|
- ./web:/app
|
|
- /app/node_modules
|
|
depends_on:
|
|
- api
|
|
|
|
volumes:
|
|
postgres_data:
|
|
book_uploads: |