About and database table to convert for the orm
This commit is contained in:
18
README.md
18
README.md
@@ -11,6 +11,12 @@ cd ./latosa-frontend
|
|||||||
deno install
|
deno install
|
||||||
```
|
```
|
||||||
|
|
||||||
|
then use the init to developp
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./init.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
To run the frontend part:
|
To run the frontend part:
|
||||||
@@ -20,7 +26,17 @@ cd ./latosa-frontend/
|
|||||||
deno task dev
|
deno task dev
|
||||||
```
|
```
|
||||||
|
|
||||||
It should launch properly, go at http://localhost:3000
|
It should launch properly, go at http://localhost:8000
|
||||||
|
|
||||||
|
Use this to sync with backend
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
## deploy
|
||||||
|
|
||||||
|
For deployement, it can be found at http://localhost:3000
|
||||||
|
|
||||||
## Committing
|
## Committing
|
||||||
|
|
||||||
|
|||||||
25
database/mock-up.md
Normal file
25
database/mock-up.md
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Latosa-escrima-db
|
||||||
|
- user (cedric job)
|
||||||
|
- planning_events
|
||||||
|
- event_id uuid PK,
|
||||||
|
- creation_date id,
|
||||||
|
- schedule_start date,
|
||||||
|
- schedule_end end,
|
||||||
|
- status { 'Canceled', 'Active', '' }
|
||||||
|
CHECK schedule_start < schedule_end
|
||||||
|
- events_to_users
|
||||||
|
- event_id uuid references planning_events(event_id),
|
||||||
|
- user_id uuid references user(user_id)
|
||||||
|
- blog
|
||||||
|
uuid: slug PK,
|
||||||
|
slug: string unique,
|
||||||
|
content: string,
|
||||||
|
label: string,
|
||||||
|
author: uuid references user_id,
|
||||||
|
published: string,
|
||||||
|
summary: string,
|
||||||
|
image: string,
|
||||||
|
href: string
|
||||||
|
|
||||||
|
- website settings
|
||||||
|
- auto accept demand ? true/false
|
||||||
12
database/schemas/blog.sql
Normal file
12
database/schemas/blog.sql
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
CREATE TABLE blogs (
|
||||||
|
uuid UUID PRIMARY KEY, -- The blog primary key
|
||||||
|
slug VARCHAR(255) UNIQUE NOT NULL, -- Slug must be unique and non-null
|
||||||
|
content TEXT NOT NULL, -- Content cannot be null
|
||||||
|
label VARCHAR(100), -- Optional label
|
||||||
|
author UUID REFERENCES users(user_id) ON DELETE SET NULL, -- Foreign key to user with cascading null for author deletion
|
||||||
|
published TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Automatically set the published time
|
||||||
|
summary VARCHAR(500), -- A brief summary of the blog
|
||||||
|
image VARCHAR(255), -- URL for the blog image
|
||||||
|
href VARCHAR(255), -- Link to the blog if external
|
||||||
|
CONSTRAINT check_slug_length CHECK (length(slug) > 0) -- Ensure slug is not empty
|
||||||
|
);
|
||||||
11
database/schemas/events.sql
Normal file
11
database/schemas/events.sql
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||||
|
CREATE TYPE Event_status as ENUM('Canceled', 'Active')
|
||||||
|
|
||||||
|
CREATE TABLE events (
|
||||||
|
event_id UUID PRIMARY KEY, -- Use UUID as the primary key
|
||||||
|
creation_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Automatically capture the creation date
|
||||||
|
schedule_start DATE NOT NULL,
|
||||||
|
schedule_end DATE NOT NULL,
|
||||||
|
status Event_status DEFAULT 'Active', -- enum-like constraint for status
|
||||||
|
CHECK (schedule_start < schedule_end) -- Ensure the start date is before the end date
|
||||||
|
);
|
||||||
6
database/schemas/events_to_user.sql
Normal file
6
database/schemas/events_to_user.sql
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
CREATE TABLE events_to_users (
|
||||||
|
event_id UUID REFERENCES events(event_id) ON DELETE CASCADE, -- Foreign key with cascading delete for referential integrity
|
||||||
|
user_id UUID REFERENCES users(user_id) ON DELETE CASCADE, -- Foreign key with cascading delete
|
||||||
|
PRIMARY KEY (event_id, user_id) -- Ensure uniqueness of event-user pairs
|
||||||
|
);
|
||||||
4
database/schemas/web_settings.sql
Normal file
4
database/schemas/web_settings.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
CREATE TABLE website_settings (
|
||||||
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(), -- Auto-generate UUID for settings table
|
||||||
|
auto_accept_demand BOOLEAN DEFAULT FALSE -- Automatically accept demands by default is false
|
||||||
|
);
|
||||||
16
latosa-frontend/app/about/page.tsx
Normal file
16
latosa-frontend/app/about/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
"use server"
|
||||||
|
|
||||||
|
export default async function About() {
|
||||||
|
return (
|
||||||
|
<main>
|
||||||
|
<div>
|
||||||
|
About us
|
||||||
|
will :
|
||||||
|
+explain what we
|
||||||
|
+pricing
|
||||||
|
|
||||||
|
+plannign for what will come next
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -106,7 +106,7 @@ const Navbar = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
href="/">
|
href="/">
|
||||||
Calendar
|
Planning
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
className={cn(
|
className={cn(
|
||||||
@@ -116,9 +116,9 @@ const Navbar = () => {
|
|||||||
variant: "ghost",
|
variant: "ghost",
|
||||||
}),
|
}),
|
||||||
)}
|
)}
|
||||||
href="#"
|
href="/about"
|
||||||
>
|
>
|
||||||
Pricing
|
A propos
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
className={cn(
|
className={cn(
|
||||||
|
|||||||
Reference in New Issue
Block a user