🎉 Initial commit: Document Server MVP

 Features implemented:
- FastAPI backend with JWT authentication
- PostgreSQL database with async SQLAlchemy
- HTML document viewer with smart highlighting
- Note system connected to highlights (1:1 relationship)
- Bookmark system for quick navigation
- Integrated search (documents + notes)
- Tag system for document organization
- Docker containerization with Nginx

🔧 Technical stack:
- Backend: FastAPI + PostgreSQL + Redis
- Frontend: Alpine.js + Tailwind CSS
- Authentication: JWT tokens
- File handling: HTML + PDF support
- Search: Full-text search with relevance scoring

📋 Core functionality:
- Text selection → Highlight creation
- Highlight → Note attachment
- Note management with search/filtering
- Bookmark creation at scroll positions
- Document upload with metadata
- User management (admin creates accounts)
This commit is contained in:
Hyungi Ahn
2025-08-21 16:09:17 +09:00
commit 3036b8f0fb
40 changed files with 6303 additions and 0 deletions

75
docker-compose.yml Normal file
View File

@@ -0,0 +1,75 @@
version: '3.8'
services:
# Nginx 리버스 프록시
nginx:
build: ./nginx
container_name: document-server-nginx
ports:
- "24100:80"
volumes:
- ./frontend:/usr/share/nginx/html
- ./uploads:/usr/share/nginx/html/uploads
depends_on:
- backend
networks:
- document-network
restart: unless-stopped
# Backend API 서버
backend:
build: ./backend
container_name: document-server-backend
ports:
- "24102:8000"
volumes:
- ./uploads:/app/uploads
- ./backend/src:/app/src
environment:
- DATABASE_URL=postgresql://docuser:docpass@database:5432/document_db
- PAPERLESS_URL=${PAPERLESS_URL:-http://localhost:8000}
- PAPERLESS_TOKEN=${PAPERLESS_TOKEN:-}
- DEBUG=true
depends_on:
- database
networks:
- document-network
restart: unless-stopped
# PostgreSQL 데이터베이스
database:
image: postgres:15-alpine
container_name: document-server-db
ports:
- "24101:5432"
environment:
- POSTGRES_DB=document_db
- POSTGRES_USER=docuser
- POSTGRES_PASSWORD=docpass
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init:/docker-entrypoint-initdb.d
networks:
- document-network
restart: unless-stopped
# Redis (캐싱 및 세션)
redis:
image: redis:7-alpine
container_name: document-server-redis
ports:
- "24103:6379"
volumes:
- redis_data:/data
networks:
- document-network
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
postgres_data:
redis_data:
networks:
document-network:
driver: bridge