Get up and running with the PDF Editor in 5 minutes!
- Docker Desktop installed and running
- Git (to clone the repository)
# Clone the repository
git clone <repository-url>
cd pdf_editor_project
# Start all services
docker-compose up -d
# Wait for services to be healthy (30-60 seconds)
docker-compose ps# Check backend health
curl http://localhost:5000/health
# Expected response:
# {"status":"healthy","database":"connected","redis":"connected"}curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"username": "demo",
"email": "demo@example.com",
"password": "demo123"
}'Save the access_token from the response!
# Set your token
export TOKEN="your_access_token_here"
# Upload a PDF
curl -X POST http://localhost:5000/api/upload \
-H "Authorization: Bearer $TOKEN" \
-F "file=@your_document.pdf"Save the document id from the response!
export DOC_ID="your_document_id"
curl -X POST http://localhost:5000/api/rotate \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"document_id\": \"$DOC_ID\",
\"rotation\": 90,
\"pages\": \"all\"
}"curl -X POST http://localhost:5000/api/watermark \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"document_id\": \"$DOC_ID\",
\"text\": \"CONFIDENTIAL\",
\"opacity\": 0.3,
\"position\": \"diagonal\"
}"curl -X POST http://localhost:5000/api/compress \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"document_id\": \"$DOC_ID\",
\"quality\": \"medium\"
}"# List all documents
curl -X GET http://localhost:5000/api/documents \
-H "Authorization: Bearer $TOKEN"
# Get document stats
curl -X GET http://localhost:5000/api/documents/stats \
-H "Authorization: Bearer $TOKEN"# Download a document
curl -X GET http://localhost:5000/api/documents/$DOC_ID/download \
-H "Authorization: Bearer $TOKEN" \
-o result.pdf# Backend logs
docker-compose logs -f backend
# All services
docker-compose logs -f# Restart all
docker-compose restart
# Restart specific service
docker-compose restart backenddocker-compose downdocker-compose up -d --buildEdit docker-compose.yml and change the external ports:
ports:
- "5555:5000" # Change 5555 to another port# Check Docker is running
docker ps
# Check logs for errors
docker-compose logs backend
docker-compose logs db# Reset database
docker-compose down -v
docker-compose up -d- Read the API Documentation for all available endpoints
- Try the Testing Guide for comprehensive examples
- Check Implementation Summary for feature details
- Explore the README for full documentation
- Backend API: http://localhost:5000
- Frontend: http://localhost:3000 (if running)
- PostgreSQL: localhost:5433
- Redis: localhost:6380
- Database: postgres/postgres
- No default user - create via registration
- Max upload size: 100MB
- Supported formats: PDF, PNG, JPG, JPEG, GIF, BMP, TIFF
#!/bin/bash
# Complete workflow example
TOKEN=$(curl -s -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"quickstart","email":"quick@start.com","password":"pass123"}' \
| jq -r '.access_token')
echo "Token: ${TOKEN:0:20}..."
# Upload two PDFs
DOC1=$(curl -s -X POST http://localhost:5000/api/upload \
-H "Authorization: Bearer $TOKEN" \
-F "file=@doc1.pdf" | jq -r '.document.id')
DOC2=$(curl -s -X POST http://localhost:5000/api/upload \
-H "Authorization: Bearer $TOKEN" \
-F "file=@doc2.pdf" | jq -r '.document.id')
echo "Uploaded: $DOC1, $DOC2"
# Merge them
MERGED=$(curl -s -X POST http://localhost:5000/api/merge \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"document_ids\":[\"$DOC1\",\"$DOC2\"]}" \
| jq -r '.document.id')
echo "Merged: $MERGED"
# Add watermark
FINAL=$(curl -s -X POST http://localhost:5000/api/watermark \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"document_id\":\"$MERGED\",\"text\":\"FINAL\",\"opacity\":0.3}" \
| jq -r '.document.id')
echo "Final document: $FINAL"
# Download
curl -X GET http://localhost:5000/api/documents/$FINAL/download \
-H "Authorization: Bearer $TOKEN" \
-o final_result.pdf
echo "Done! Check final_result.pdf"- Check logs:
docker-compose logs -f - View health:
curl http://localhost:5000/health - Database status:
docker exec -it pdf_editor_db psql -U postgres -d pdfeditor - Redis status:
docker exec -it pdf_editor_redis redis-cli ping
Happy PDF editing! 🎉