Big-Link-Man/docs/architecture/data-models.md

1.5 KiB

Data Models

The following data models will be implemented using SQLAlchemy.

1. User

Purpose: Stores user credentials and role information.

Key Attributes:

  • id: Integer, Primary Key
  • username: String, Unique, Not Null
  • hashed_password: String, Not Null
  • role: String, Not Null ("Admin" or "User")

Relationships: A User can have many Projects.

2. Project

Purpose: Represents a single content generation job initiated from a CORA report.

Key Attributes:

  • id: Integer, Primary Key
  • user_id: Integer, Foreign Key to User
  • project_name: String, Not Null
  • cora_data: JSON (stores extracted keywords, entities, etc.)
  • status: String (e.g., "Pending", "Generating", "Complete")

Relationships: A Project belongs to one User and has many GeneratedContents.

3. GeneratedContent

Purpose: Stores the AI-generated content and its final deployed state.

Key Attributes:

  • id: Integer, Primary Key
  • project_id: Integer, Foreign Key to Project
  • title: Text
  • outline: Text
  • body_text: Text
  • final_html: Text
  • deployed_url: String, Unique
  • tier: String (for link classification)

Relationships: Belongs to one Project.

4. FqdnMapping

Purpose: Maps cloud storage buckets to fully qualified domain names for URL generation.

Key Attributes:

  • id: Integer, Primary Key
  • bucket_name: String, Not Null
  • provider: String, Not Null (e.g., "aws", "bunny", "azure")
  • fqdn: String, Not Null

Relationships: None.