# DX001 — Database Documentation & Developer Console Foundation

## Build Database Documentation System for INVEETAIRE

---

# ROLE

You are the Lead Software Architect, Database Architect, DevOps Engineer, and Technical Writer for INVEETAIRE.

Your responsibility is to establish a long-term database documentation system and Developer Console foundation.

This sprint is NOT about changing the database structure.

This sprint is ONLY about documenting the existing MySQL database and preparing the infrastructure for future synchronization with Supabase.

---

# OBJECTIVE

Create a centralized Database Documentation System that allows developers and AI assistants (Claude, ChatGPT, Gemini) to fully understand the project database without manually inspecting MySQL.

The documentation must always become the single source of truth for database architecture.

This sprint does NOT require Supabase integration yet.

---

# PROJECT STRUCTURE

Create a new documentation structure.

Example:

/docs

    /database

        README_SCHEMA.md

        AI_CONTEXT.md

        RELATIONSHIP.md

        CHANGELOG.md

        schema.sql

        /tables

            users.md

            workspace.md

            guest.md

            invitation.md

            attendance.md

            ...

Organize the documentation cleanly and consistently.

---

# README_SCHEMA.md

Generate a complete overview containing:

• Total tables

• Database purpose

• Naming convention

• Primary key convention

• Foreign key convention

• Timestamp convention

• Soft delete convention (if applicable)

• General database architecture

• Module grouping

Example modules:

Authentication

Workspace

Wedding

Guest

Invitation

Attendance

Timeline

Settings

etc.

---

# TABLE DOCUMENTATION

Generate one documentation file for every table.

Each file should include:

• Table purpose

• Description

• Primary Key

• Foreign Keys

• Column list

• Data types

• Nullable

• Default values

• Indexes

• Relationships

• Referenced by

• Business rules

• Notes

The documentation should be written in a developer-friendly format.

---

# RELATIONSHIP DOCUMENTATION

Generate a global relationship document explaining:

Entity relationships

One-to-One

One-to-Many

Many-to-Many

Dependency flow

Workspace hierarchy

Wedding hierarchy

Guest hierarchy

Invitation hierarchy

Attendance hierarchy

Describe the relationship using clear business language rather than only technical descriptions.

---

# AI_CONTEXT.md

Generate an AI-oriented documentation file.

This document should explain the business domain instead of database syntax.

Examples:

What is a Workspace?

How does a Couple own a Workspace?

How are Guests related to Weddings?

What is Attendance?

What modules exist?

How do Crew, Couple, and Super Admin interact with the system?

Which modules are operational?

Which modules are administrative?

The goal is allowing AI assistants to understand INVEETAIRE without reverse engineering the project.

---

# CHANGELOG.md

Create a schema changelog.

Document future schema modifications using semantic versioning.

Example:

v1.0.0

Initial schema documentation.

Future entries should include:

Added

Modified

Removed

Deprecated

Notes

---

# SCHEMA.SQL

Generate a clean SQL schema reference representing the current MySQL database structure.

This file is intended for documentation purposes.

Do NOT modify production schema.

---

# DEVELOPER CONSOLE FOUNDATION

Create a new Developer Console module.

Suggested URL:

/app/developer

This console is reserved for developers and system maintenance.

It is NOT part of the normal Super Admin Portal.

Create a simple dashboard containing cards for:

Database

Schema Documentation

Synchronization (Coming Soon)

System Health (Coming Soon)

Logs (Coming Soon)

Queue (Coming Soon)

Each unavailable feature should display:

"Coming Soon (DX002 / DX003)"

---

# DATABASE PAGE

Create a Database page inside Developer Console.

Display:

Current MySQL Connection

Database Name

Database Version

Total Tables

Connection Status

Documentation Version

Last Documentation Generated

Provide placeholder cards for:

Supabase Mirror

Connection Status

Synchronization Status

Display:

"Available in DX002"

Do NOT implement Supabase integration yet.

---

# SCHEMA PAGE

Create a Schema Documentation page.

Display:

Current Documentation Version

README_SCHEMA

AI_CONTEXT

RELATIONSHIP

CHANGELOG

schema.sql

Show generation status for each document.

Provide placeholder actions:

Generate Documentation

Compare Schema

Download Documentation

These actions may be disabled for now.

Display:

"Available in DX002"

---

# DOCUMENTATION RULES

Create a documentation guideline.

Every database schema modification MUST update:

README_SCHEMA.md

RELATIONSHIP.md

Relevant table documentation

CHANGELOG.md

AI_CONTEXT.md (when business logic changes)

Documentation must always stay synchronized with the database.

---

# CODE QUALITY

Follow the existing INVEETAIRE coding standards.

Keep all Developer Console pages modular.

Avoid duplicate logic.

Separate controllers, services, repositories, and views cleanly.

---

# VALIDATION

Verify:

✓ Documentation directory created.

✓ Documentation templates generated.

✓ Developer Console created.

✓ Database page implemented.

✓ Schema page implemented.

✓ Placeholder pages prepared for DX002 and DX003.

✓ No production database changes introduced.

✓ No existing modules modified unnecessarily.

Run PHP lint (`php -l`) on every modified PHP file before completion.

Do not mark this sprint complete until every validation item passes.

---

# IMPORTANT

This sprint establishes the long-term Database Documentation System for INVEETAIRE.

Supabase integration, synchronization, verification, and recovery are intentionally excluded from DX001 and will be implemented in DX002 and DX003.

Maintain forward compatibility with future MySQL ⇄ Supabase synchronization.