Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add ERD to documentation and update README #20

Merged
merged 5 commits into from
Nov 25, 2024
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
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,34 @@ you wont be able to commit without a type, so make sure to add one.
## 🚨 Quirks

- To add new env variables, add them to the `.env.example` file and head over to `@/lib/env.ts` to add them to the `EnvSchema`. this will allow you to access them in your app in a type-safe manner.

## Documentation

The ERD for this project can be found in the [documentation/erd.md](https://github.com/NHL-P2-INF2-DP/netflix-clone/tree/main/documentation/erd.md) file.

The routes for this project can be found in the [documentation/routes.md](https://github.com/NHL-P2-INF2-DP/netflix-clone/tree/main/documentation/routes.md) file.

## Deployment

To deploy this project using Docker Compose, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/NHL-P2-INF2-DP/netflix-clone.git
cd netflix-clone
```

2. Copy the .env.example file to .env and update the environment variables as needed:

```bash
cp .env.example .env
```

3. Start the Docker containers:

```bash
docker-compose up
```

The application and the PostgreSQL database will now be running. The application will be accessible at [http://localhost:3000](http://localhost:3000).
Binary file removed documentation/APIClassDiagram.asta
Binary file not shown.
117 changes: 117 additions & 0 deletions documentation/erd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
```mermaid
erDiagram
genre {
bigint id
text name
}
content_rating {
bigint id
text rating_type
}
content {
bigint id
text title
timestamp duration
date release_date
int season
bigint quality_id
date created_at
date updated_at
}
language {
bigint id
text language
}
subtitle {
bigint id
bigint language_id
text content
}
content_metadata {
bigint id
bigint title
bigint genre_id
int rating
bigint content_id
bigint language_id
bigint subtitle_id
enum content_type
bigint content_rating_id
enum age_rating
date created_at
date updated_at
}
viewinghistory {
bigint id
bigint profile_id
bigint content_id
timestamp watch_date
double progress_percentage
}
watchlist {
bigint id
bigint profile_id
bigint content_id
}
profile {
bigint id
bigint account_id
text name
bigint profile_image
date date_of_birth
text language
date created_at
date updated_at
}
subscription {
bigint id
date begin_date
date end_date
bigint account_id
bigint subscription_type_id
bigint referral_id
date created_at
date updated_at
}
subscription_type {
bigint id
text type
int price_in_euro_cents
}
invoice {
bigint id
bigint subscription_id
enum is_paid
date created_at
date updated_at
}
account {
bigint id
text email
text password
boolean activated
timestamp blocked_until
date created_at
date updated_at
}
previous_password_hash {
bigint id
bigint account_id
text password_hash
date created_at
}

content_metadata }o--|| content : "content_id"
content_metadata ||--o{ genre : "genre_id"
content_metadata ||--o{ language : "language_id"
content_metadata ||--o{ subtitle : "subtitle_id"
content_metadata ||--o{ content_rating : "content_rating_id"
viewinghistory ||--o{ content : "content_id"
viewinghistory ||--o{ profile : "profile_id"
watchlist ||--o{ content : "content_id"
watchlist ||--o{ profile : "profile_id"
subscription ||--o{ account : "account_id"
subscription ||--o{ subscription_type : "subscription_type_id"
invoice ||--o{ subscription : "subscription_id"
account ||--o{ previous_password_hash : "account_id"
```