Skip to content

Commit

Permalink
Updated type definition and README
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejkrol18 committed Sep 23, 2023
1 parent 2545f7d commit cce4b21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
teoriainformatyk is a web app for revising to polish INF.02 and INF.03 exams available at [teoriainformatyk.vercel.app](https://teoriainformatyk.vercel.app)

## Features

- One question mode
- roll and answer to a random question idefinetely
- see the stats for the current session, including elapsed time and percentage score
Expand All @@ -19,6 +20,7 @@ teoriainformatyk is a web app for revising to polish INF.02 and INF.03 exams ava
- search the database for questions by typing in its content

## Technologies used

- Typescript
- NextJS 13 /w App Router
- Tailwind CSS
Expand All @@ -27,7 +29,7 @@ teoriainformatyk is a web app for revising to polish INF.02 and INF.03 exams ava
## SQL Table definition

> [!NOTE]
> Images are stored as Base64 strings
> Images are stored in a Supabase bucket. Whether a question has an image attached to it is determined by the "image" boolean value within the table
```sql
create table
Expand All @@ -36,10 +38,9 @@ create table
created_at timestamp with time zone not null,
content text not null,
correct_answer text not null,
image text null,
image boolean not null,
answers text[] not null,
constraint questions_inf02_pkey primary key (id),
constraint questions_inf02_content_key unique (content),
constraint questions_inf02_id_key unique (id)
) tablespace pg_default;
```
Expand All @@ -51,10 +52,9 @@ create table
created_at timestamp with time zone not null,
content text not null,
correct_answer text not null,
image text null,
image boolean not null default false,
answers text[] not null,
constraint questions_inf03_pkey primary key (id),
constraint questions_inf03_content_key unique (content)
constraint inf03_kopia_pkey primary key (id),
constraint questions_inf03_id_key unique (id)
) tablespace pg_default;
```
Expand Down
11 changes: 7 additions & 4 deletions src/types/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface Database {
correct_answer?: string
created_at?: string
id?: number
image: boolean
image?: boolean
}
Relationships: []
}
Expand All @@ -43,15 +43,15 @@ export interface Database {
correct_answer: string
created_at: string
id?: number
image: boolean
image?: boolean
}
Update: {
answers?: string[]
content?: string
correct_answer?: string
created_at?: string
id?: number
image: boolean
image?: boolean
}
Relationships: []
}
Expand All @@ -60,7 +60,10 @@ export interface Database {
[_ in never]: never
}
Functions: {
[_ in never]: never
hello_world: {
Args: Record<PropertyKey, never>
Returns: string
}
}
Enums: {
[_ in never]: never
Expand Down

0 comments on commit cce4b21

Please sign in to comment.