This directory contains all database-related services and infrastructure.
database/
├── infrastructure/ # Database infrastructure (PostgreSQL, pgAdmin)
│ ├── docker-compose.yml
│ ├── init.sql
│ ├── init-rag.sql
│ ├── schema.sql # Complete database schema
│ └── servers.json
└── api/ # Database API service (FastAPI)
├── app/
├── sql/
├── Dockerfile
├── requirements.txt
└── README.md
-
Start database infrastructure:
cd database/infrastructure docker-compose up -d -
Start database API:
cd database/api docker build -t database-api . docker run -p 3001:3001 database-api
- PostgreSQL with pgvector extension
- pgAdmin for database management
- Complete schema with all tables and indexes
- Database initialization scripts
- FastAPI service for database operations
- SQL query files for all operations
- RESTful API endpoints
- Vector similarity search support
The complete schema is defined in infrastructure/schema.sql and includes:
- pages - Web pages with embeddings
- chunks - Text chunks with vector embeddings
- keywords - Extracted keywords with embeddings
- page_metrics - SEO and analytics data
- domain_text_targets - Content guidelines per domain
- gap_outlines - Content gap analysis
- seo_ab_tests - A/B testing data
- seo_recommendations - SEO recommendations
- webpage_tone_metrics - Sentiment and readability analysis
All tables include proper indexes for vector similarity search and performance.
- Clear separation between infrastructure and application layers
- Single source of truth for all database-related code
- Easier deployment with related services in one place
- Better organization for future database-related features