mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Refactor documentation and diagrams for web/pipeline. (#272)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com> for assistance with diagram creation and documentation prose updates.
This commit is contained in:
38
docs/web/diagrams/database-schema/beer.mmd
Normal file
38
docs/web/diagrams/database-schema/beer.mmd
Normal file
@@ -0,0 +1,38 @@
|
||||
erDiagram
|
||||
BeerStyle ||--o{ Beer : "categorizes"
|
||||
Beer ||--o{ BeerPhoto : "has photos"
|
||||
Beer ||--o{ BeerComment : "has comments"
|
||||
|
||||
%% Cross-schema: defined in full in identity.mmd / brewery.mmd / media.mmd
|
||||
User ||--o{ Beer : "posts"
|
||||
Brewery ||--o{ Beer : "brews"
|
||||
User ||--o{ BeerComment : "comments"
|
||||
|
||||
BeerStyle {
|
||||
uniqueidentifier BeerStyleID PK
|
||||
nvarchar StyleName UK
|
||||
nvarchar Description "nullable"
|
||||
}
|
||||
|
||||
Beer {
|
||||
uniqueidentifier BeerPostID PK
|
||||
nvarchar Name
|
||||
nvarchar Description
|
||||
decimal ABV
|
||||
int IBU
|
||||
uniqueidentifier PostedByID FK
|
||||
uniqueidentifier BeerStyleID FK
|
||||
uniqueidentifier BrewedByID FK
|
||||
datetime CreatedAt
|
||||
datetime UpdatedAt "nullable"
|
||||
}
|
||||
|
||||
BeerComment {
|
||||
uniqueidentifier BeerPostCommentID PK
|
||||
nvarchar Comment
|
||||
uniqueidentifier BeerPostID FK
|
||||
uniqueidentifier CommentedByID FK
|
||||
int Rating
|
||||
datetime CreatedAt
|
||||
datetime UpdatedAt "nullable"
|
||||
}
|
||||
16
docs/web/diagrams/database-schema/brewery.mmd
Normal file
16
docs/web/diagrams/database-schema/brewery.mmd
Normal file
@@ -0,0 +1,16 @@
|
||||
erDiagram
|
||||
Brewery ||--o| BreweryLoc : "has location"
|
||||
Brewery ||--o{ BreweryPhoto : "has photos"
|
||||
Brewery ||--o{ Beer : "brews"
|
||||
|
||||
%% Cross-schema: defined in full in identity.mmd / location.mmd / media.mmd / beer.mmd
|
||||
User ||--o{ Brewery : "posts"
|
||||
|
||||
Brewery {
|
||||
uniqueidentifier BreweryPostID PK
|
||||
nvarchar BreweryName
|
||||
uniqueidentifier PostedByID FK
|
||||
nvarchar Description
|
||||
datetime CreatedAt
|
||||
datetime UpdatedAt "nullable"
|
||||
}
|
||||
53
docs/web/diagrams/database-schema/identity.mmd
Normal file
53
docs/web/diagrams/database-schema/identity.mmd
Normal file
@@ -0,0 +1,53 @@
|
||||
erDiagram
|
||||
User ||--o{ Cred : "has credentials"
|
||||
User ||--o| Verify : "has verification"
|
||||
User ||--o| Profile : "has profile"
|
||||
User ||--o{ Follow : "follows"
|
||||
User ||--o{ Follow : "followed by"
|
||||
|
||||
%% Cross-schema: defined in full in media.mmd / brewery.mmd / beer.mmd
|
||||
Profile ||--o{ Avatar : "has avatar history"
|
||||
User ||--o{ Photo : "uploads"
|
||||
User ||--o{ Brewery : "posts"
|
||||
User ||--o{ Beer : "posts"
|
||||
User ||--o{ BeerComment : "comments"
|
||||
|
||||
User {
|
||||
uniqueidentifier UserAccountID PK
|
||||
varchar Username UK
|
||||
nvarchar FirstName
|
||||
nvarchar LastName
|
||||
varchar Email UK
|
||||
datetime CreatedAt
|
||||
datetime UpdatedAt "nullable"
|
||||
date DateOfBirth
|
||||
}
|
||||
|
||||
Cred {
|
||||
uniqueidentifier UserCredentialID PK
|
||||
uniqueidentifier UserAccountID FK
|
||||
datetime CreatedAt
|
||||
datetime Expiry
|
||||
nvarchar Hash
|
||||
bit IsRevoked
|
||||
datetime RevokedAt "nullable"
|
||||
}
|
||||
|
||||
Verify {
|
||||
uniqueidentifier UserVerificationID PK
|
||||
uniqueidentifier UserAccountID "FK, UK"
|
||||
datetime VerificationDateTime
|
||||
}
|
||||
|
||||
Profile {
|
||||
uniqueidentifier UserProfileID PK
|
||||
uniqueidentifier UserAccountID "FK, UK"
|
||||
nvarchar Biography
|
||||
}
|
||||
|
||||
Follow {
|
||||
uniqueidentifier UserFollowID PK
|
||||
uniqueidentifier UserAccountID FK
|
||||
uniqueidentifier FollowingID FK
|
||||
datetime CreatedAt
|
||||
}
|
||||
36
docs/web/diagrams/database-schema/location.mmd
Normal file
36
docs/web/diagrams/database-schema/location.mmd
Normal file
@@ -0,0 +1,36 @@
|
||||
erDiagram
|
||||
Country ||--o{ StateProvince : "has"
|
||||
StateProvince ||--o{ City : "has"
|
||||
City ||--o{ BreweryLoc : "located in"
|
||||
|
||||
%% Cross-schema: defined in full in brewery.mmd
|
||||
Brewery ||--o| BreweryLoc : "has location"
|
||||
|
||||
Country {
|
||||
uniqueidentifier CountryID PK
|
||||
nvarchar CountryName
|
||||
char ISO3166_1 UK
|
||||
}
|
||||
|
||||
StateProvince {
|
||||
uniqueidentifier StateProvinceID PK
|
||||
nvarchar StateProvinceName
|
||||
char ISO3166_2 UK
|
||||
uniqueidentifier CountryID FK
|
||||
}
|
||||
|
||||
City {
|
||||
uniqueidentifier CityID PK
|
||||
nvarchar CityName
|
||||
uniqueidentifier StateProvinceID FK
|
||||
}
|
||||
|
||||
BreweryLoc {
|
||||
uniqueidentifier BreweryPostLocationID PK
|
||||
uniqueidentifier BreweryPostID "FK, UK"
|
||||
nvarchar AddressLine1
|
||||
nvarchar AddressLine2 "nullable"
|
||||
nvarchar PostalCode
|
||||
uniqueidentifier CityID FK
|
||||
geography Coordinates "nullable"
|
||||
}
|
||||
39
docs/web/diagrams/database-schema/media.mmd
Normal file
39
docs/web/diagrams/database-schema/media.mmd
Normal file
@@ -0,0 +1,39 @@
|
||||
erDiagram
|
||||
Avatar }o--|| Photo : "uses photo"
|
||||
Photo ||--o{ BreweryPhoto : "used in"
|
||||
Photo ||--o{ BeerPhoto : "used in"
|
||||
|
||||
%% Cross-schema: defined in full in identity.mmd / brewery.mmd / beer.mmd
|
||||
Profile ||--o{ Avatar : "has avatar history"
|
||||
User ||--o{ Photo : "uploads"
|
||||
Brewery ||--o{ BreweryPhoto : "has photos"
|
||||
Beer ||--o{ BeerPhoto : "has photos"
|
||||
|
||||
Photo {
|
||||
uniqueidentifier PhotoID PK
|
||||
nvarchar Hyperlink "nullable"
|
||||
uniqueidentifier UploadedByID FK
|
||||
datetime UploadedAt
|
||||
}
|
||||
|
||||
Avatar {
|
||||
uniqueidentifier UserAvatarID PK
|
||||
uniqueidentifier UserProfileID FK
|
||||
uniqueidentifier PhotoID FK
|
||||
datetime2 ValidFrom
|
||||
datetime2 ValidTo "nullable; at most one row per UserProfileID has ValidTo IS NULL (active avatar)"
|
||||
}
|
||||
|
||||
BreweryPhoto {
|
||||
uniqueidentifier BreweryPostPhotoID PK
|
||||
uniqueidentifier BreweryPostID FK
|
||||
uniqueidentifier PhotoID FK
|
||||
datetime LinkedAt
|
||||
}
|
||||
|
||||
BeerPhoto {
|
||||
uniqueidentifier BeerPostPhotoID PK
|
||||
uniqueidentifier BeerPostID FK
|
||||
uniqueidentifier PhotoID FK
|
||||
datetime LinkedAt
|
||||
}
|
||||
Reference in New Issue
Block a user