Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/database.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from sqlalchemy import create_engine
from sqlmodel import SQLModel

# Import all models to register them with SQLModel metadata
from app.db_models.api_key import APIKey
Comment on lines +4 to +5
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Importing models solely for registration creates implicit dependencies that may be overlooked during refactoring. Consider using a dedicated model registry function or importing all models in a centralized location.

Suggested change
# Import all models to register them with SQLModel metadata
from app.db_models.api_key import APIKey
# Function to register all models with SQLModel metadata
def register_models():
from app.db_models.api_key import APIKey
# Add other models here as needed

Copilot uses AI. Check for mistakes.

# Database URL for SQLite
DATABASE_URL = "sqlite:///./gateway.db"

Expand Down
28 changes: 21 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
version: '3.8'

# docker-compose.yml (API Gateway)
services:
redis:
image: redis:alpine

networks:
- shared-app-network

gateway:
build: .
ports:
- "8000:8000"
env_file:
- .env
volumes:
- ./gateway.db:/code/gateway.db
- .:/code
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mounting the entire project directory (.:/code) into the container can expose sensitive files and create security risks. Consider mounting only necessary files or using a .dockerignore file to exclude sensitive content.

Copilot uses AI. Check for mistakes.
depends_on:
- redis

networks:
- shared-app-network

prometheus:
image: prom/prometheus:latest
ports:
Expand All @@ -23,12 +26,23 @@ services:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
depends_on:
- gateway

networks:
- shared-app-network

grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
depends_on:
- prometheus
- prometheus
networks:
- shared-app-network

# volumes:
# gateway_db:

networks:
shared-app-network:
external: true
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an external network requires manual creation before running docker-compose. Consider using a regular network definition or document the network creation requirement in the deployment instructions.

Suggested change
external: true
driver: bridge

Copilot uses AI. Check for mistakes.
Loading