made the filestructure better and migrated the game creation from the old type of db to the newer relational db type!

This commit is contained in:
RezHackXYZ 2025-05-15 06:27:40 +05:30
parent 9ac813c699
commit 736059646d
No known key found for this signature in database
28 changed files with 343 additions and 736 deletions

View file

@ -1,38 +1,45 @@
# sv
# DB Diagrams
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
## Current DB Diagram
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-app
```mermaid
erDiagram
GAMES {
int GamePIN PK
string gameStatus
json questions
jsonb players
}
```
## Developing
## Goal MVP DB Diagram
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```mermaid
erDiagram
GAMES {
int ID PK
string creator
date creationDate
string status
}
QUESTIONS {
int ID PK
int GameID FK
string QuestionsText
string CorrectAnswer
}
ANSWERS {
int ID PK
int QuestionID FK
string content
}
PLAYERS {
int ID PK
int GameID FK
int Score
}
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
GAMES ||--o{ QUESTIONS : contains
QUESTIONS ||--o{ ANSWERS : has
GAMES ||--o{ PLAYERS : participated_by
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.