diff --git a/pages/zotmeet/_meta.json b/pages/zotmeet/_meta.json index 9742ec7..74b2866 100644 --- a/pages/zotmeet/_meta.json +++ b/pages/zotmeet/_meta.json @@ -4,5 +4,8 @@ }, "getting-started": { "title": "Getting Started" + }, + "api": { + "title": "ZotMeet API" } } diff --git a/pages/zotmeet/api/_meta.json b/pages/zotmeet/api/_meta.json new file mode 100644 index 0000000..5c32c3b --- /dev/null +++ b/pages/zotmeet/api/_meta.json @@ -0,0 +1,14 @@ +{ + "index": { + "title": "Overview" + }, + "user": { + "title": "User" + }, + "meeting": { + "title": "Meeting" + }, + "group": { + "title": "Group" + } +} diff --git a/pages/zotmeet/api/group.mdx b/pages/zotmeet/api/group.mdx new file mode 100644 index 0000000..d019498 --- /dev/null +++ b/pages/zotmeet/api/group.mdx @@ -0,0 +1,312 @@ +import { Tabs } from "nextra/components"; + +# Group API Specification + +### Get Multiple Groups + +
+ + `GET` + `/groups` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | optional | + > | name | string | optional | + > | created_at | Date | optional | + + ##### Response + + + ```json copy + { + "groups": [ + { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + } + ] + } + + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Get Group + +
+ + `GET` + `/groups` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | optional | + > | name | string | optional | + > | created_at | Date | optional | + + ##### Response + + + ```json copy + { + "groups": [ + { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + } + ] + } + + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Get Group's Meetings + +
+ + `GET` + `/groups/{id}/meetings` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Response + + + ```json copy + { + "meetings": [ + { + "id": "string", + "title": "string", + "dates": ["Date"], + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + ] + } + + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Get Group's Users + +
+ + `GET` + `/groups/{id}/users` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Response + + + ```json copy + { + "users": [ + { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + ] + } + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Create Group + +
+ + `POST` + `/groups/{id}` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | name | string | required | + > | description | Date | optional | + + ##### Response + + + ```json copy + { + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + } + } + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Update Group + +
+ + `PUT` + `/groups/{id}` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + > | name | string | optional + > | description | string | optional + > | created_at | Date | optional | + + ##### Response + + + ```text copy + Group Information Successfully Modified + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Delete Group + +
+ + `DELETE` + `/groups/{id}` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + + ##### Response + + + ```text copy + Group Information Successfully Deleted + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
diff --git a/pages/zotmeet/api/index.mdx b/pages/zotmeet/api/index.mdx new file mode 100644 index 0000000..4c3fb13 --- /dev/null +++ b/pages/zotmeet/api/index.mdx @@ -0,0 +1,56 @@ +# API List + +Attached is a list of all API Routes for ZotMeet. Subject to Change. + +- [ ] `GET /users` `Get Multiple Users` + +- [ ] `POST /users` `Create User` + +- [ ] `GET /users/{id}` `Get User` + +- [ ] `PUT /users/{id}` `Update User` + +- [ ] `DELETE /users/{id}` `Delete User` + +- [ ] `GET /users/{id}/groups` `Get User's Groups` + +- [ ] `GET /users/{id}/meetings` `Get User's Meetings +` + +- [ ] `GET /users/{id}/availabilities` `Get User's Availabilities` + +- [ ] `POST /users/{id}/availabilities` `Add User's Availabilities` + +- [ ] `GET /users/{id}/availabilities/{meeting_id}` `Get User's Availabilities for Meeting` + +- [ ] `PUT /users/{id}/availabilities/{meeting_id}` `Update User's Availabilities for Meeting` + +- [ ] `DELETE /users/{id}/availabilities/{meeting_id}` `Deletes User's Availabilities for Meeting` + +- [ ] `GET /meetings` `Get Multiple Meetings` + +- [ ] `GET /meetings/{id}` `Get Meeting` + +- [ ] `GET /meetings/{id}/users` `Get Meeting's Users` + +- [ ] `GET /meetings/{id}/shared-availability` `Get Meeting's Shared Availability` + +- [ ] `POST /meetings` `Create Meeting` + +- [ ] `PUT /meetings/{id}` `Update meeting` + +- [ ] `DELETE /meetings/{id}` `Delete Meeting` + +- [ ] `GET /groups` `Get Multiple Groups` + +- [ ] `POST /groups` `Create Group` + +- [ ] `GET /groups/{id}` `Get Group` + +- [ ] `PUT /groups/{id}` `Update Group` + +- [ ] `DELETE /groups/{id}` `Delete Group` + +- [ ] `GET /groups/{id}/meetings` `Get Group's Meetings` + +- [ ] `GET /groups/{id}/users` `Get Group's Users` diff --git a/pages/zotmeet/api/meeting.mdx b/pages/zotmeet/api/meeting.mdx new file mode 100644 index 0000000..571764e --- /dev/null +++ b/pages/zotmeet/api/meeting.mdx @@ -0,0 +1,401 @@ +import { Tabs } from "nextra/components"; + +# Meeting API Specification + +--- + +## Get Multiple Meetings + +
+ + `GET` + `/meetings` + + + ##### Parameters + > | name | type | description + > |------------|-------------------------|------| + > | id | string | optional | + > | title | string | optional | + > | dates | Date[] | optional | + > | location | string | optional | + > | from_time | string | optional | + > | to_time | string | optional | + > | group_id | string | optional | + > | host_id | string | optional | + + ##### Responses + + + ```json copy + { + "meetings": [ + { + "id": "string", + "title": "string", + "dates": ["Date"], + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + ] + } + ``` + + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+ +--- + +## Gets Meeting + +
+ + `GET` + `/meetings/{id}` + + + ##### Parameters + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Responses + + + ```json copy + { + "meeting": { + "id": "string", + "title": "string", + "dates": ["Date"], + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +--- + +## Gets Meeting's Users + +
+ + `GET` + `/meetings/{id}/users` + + + ##### Parameters + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Responses + + + ```json copy + { + "users": [ + { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + ] + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+ +--- + +## Gets Meeting's Shared Availability + +
+ + `GET` + `/meetings/{id}/shared-availability` + + + ##### Parameters + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Responses + + + ```json copy + { + "availabilities": [ + { + "day": "Date", + "availability_string": "string", + "block_length": "number", + "meeting": { + "id": "string", + "title": "string", + "dates": "array of Date", + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + } + ] + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + + ``` + + + +
+ +--- + +## Create Meeting + +
+ + `POST` + `/meetings` + + + ##### Parameters + > | name | type | description + > |------------|-------------------------|------| + > | title | string | required | + > | dates | Date[] | required | + > | description | string | optional | + > | location | string | optional | + > | from_time | string | required | + > | to_time | string | required | + > | group_id | string | optional | + > | host_id | string | required | + + + ##### Responses + + + ```json copy + { + "meeting": { + "id": "string", + "title": "string", + "dates": ["Date"], + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + } + + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + + ``` + + + +
+ +--- + +## Update Meeting + +
+ + `PUT` + `/meetings/{id}` + + + ##### Parameters + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + > | title | string | optional | + > | dates | Date[] | required | + > | description | string | optional | + > | location | string | optional | + > | from_time | string | required | + > | to_time | string | required | + > | group_id | string | optional | + > | host_id | string | required | + + ##### Responses + + + ```text copy + Modified Meeting Information + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + + ``` + + + +
+ +--- + +## Delete Meeting + +
+ + `DELETE` + `/meetings/{id}` + + + ##### Parameters + > | name | type | data type + > |-----------|-----------|-------------------------| + > | id | required | string | N/A | + + ##### Responses + + + ```text copy + Deleted Meeting Successfully + ``` + + + + ```json copy + { + "error": + { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +--- diff --git a/pages/zotmeet/api/user.mdx b/pages/zotmeet/api/user.mdx new file mode 100644 index 0000000..46fbf4b --- /dev/null +++ b/pages/zotmeet/api/user.mdx @@ -0,0 +1,641 @@ +import { Tabs } from "nextra/components"; + +# User API Specification + +### Get Multiple Users + +
+ + `GET` + `/users` + + + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | optional | + > | username | string | optional | + > | email | string | optional | + > | created_at | Date | optional | + + ##### Response + + + ```json copy + { + "users": [ + { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + ] + } + + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+ +### Get User + +
+ + `GET` + `/users/{id}` + + + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Response + + + ```json copy + { + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + +
+### Get User's Groups + +
+ + `GET` + `/users/{id}/groups` + + + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + + ##### Response + + + ```json copy + { + "groups": [ + { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + } + ] + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+### Get User's Meetings + +
+ + `GET` + `/users/{id}/meetings` + + + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + + ##### Response + + + ```json copy + { + "meetings": [ + { + "id": "string", + "title": "string", + "dates": "array of Date", + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + ] + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+### Get User's Availabilities + +
+ + `GET` + `/users/{id}/availabilities` + + + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + + ##### Response + + + ```json copy + { + "availabilities": [ + { + "day": "Date", + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + }, + "block_length": "number", + "meeting": { + "id": "string", + "title": "string", + "dates": "array of Date", + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + } + ] + } + + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + + +
+ +### Get User's Availabilities for Meeting + +
+ + `GET` + `/users/{id}/availabilities/{meeting_id}` + + + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + > | meeting_id | string | required | + + + ##### Response + + + ```json copy + { + "availabilities": [ + { + "day": "Date", + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + }, + "availability_string": "string", + "block_length": "number", + "meeting": { + "id": "string", + "title": "string", + "dates": "array of Date", + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + } + ] + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + + +
+ +### Create User + +
+ + + `POST` + `/users` + + + + ##### Request + + > | name | type | required | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | username | string | True | + > | email | string | True | + > | guest | boolean | True | + + ##### Response + + + + ```json copy + { + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date", + "guest": "boolean" + } + } + ``` + + + + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + + + +
+ +### Create User Availabilities + +
+ + `POST` + `/users/{id}/availabilities` + + + ##### Request + > Availability Parameters + >> | name | type | description | + >> |-----------|-------------------------|-----------------------------------------------------------------------| + >> | id | string | Required | + >> | block_length | number | Required + >> | availability_string | string | Required + >> | day | Date | Required + >> | meeting_id | string | False | + > List of Availabilities + >> | name | type | description | + >> |-----------|-------------------------|-----------------------------------------------------------------------| + >> | availabilities | Availability[] | optional | + + ##### Response + + + ```json copy + { + "availabilities": [ + { + "day": "Date", + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + }, + "block_length": "number", + "meeting": { + "id": "string", + "title": "string", + "dates": "array of Date", + "description": "string", + "location": "string", + "from_time": "string", + "to_time": "string", + "group": { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + }, + "host": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + } + ] + } + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+### Update User + +
+ + + `PUT` + `/users/{id}` + + + + ##### Request + + > | name | type | required | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | user_id | string | True | + > | username | string | False | + > | email | string | False | + > | guest | string | False | + + ##### Response + + + + + ```text copy + Saved User Information + ``` + + + + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + + +
+### Update User Availabilities for Meeting + +
+ + `PUT` + `/users/{id}/availabilities/{meeting_id}` + + + ##### Request + > Availability Parameters + >> | name | type | description | + >> |-----------|-------------------------|-----------------------------------------------------------------------| + >> | id | string | Required | + >> | block_length | number | Required + >> | availability_string | string | Required + >> | day | Date | Required + >> | meeting_id | string | False | + > List of Availabilities + >> | name | type | description | + >> |-----------|-------------------------|-----------------------------------------------------------------------| + >> | availabilities | Availability[] | optional | + + ##### Response + + + ```text copy + User-Meeting availability successfully modified + ``` + + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+### Delete User + +
+ + `DELETE` + `/users/{id}` + + + ##### Request + > | name | type | description | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | id | string | Required | + + ##### Response + + + ```text copy + User successfully deleted + ``` + + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
+### Delete User's Availabilities for Meeting + +
+ + `DELETE` + `/users/{id}/availabilities/{meeting_id}` + + + ##### Request required + > | name | type | description | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | id | string | Required | + > | meeting_id | string | Required | + + ##### Response + + + ```text copy + Availability Deleted + ``` + + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + + + + +
diff --git a/pages/zotmeet/getting-started.md b/pages/zotmeet/getting-started.md deleted file mode 100644 index bad5562..0000000 --- a/pages/zotmeet/getting-started.md +++ /dev/null @@ -1 +0,0 @@ -# Getting Started diff --git a/pages/zotmeet/getting-started.mdx b/pages/zotmeet/getting-started.mdx new file mode 100644 index 0000000..21df7d8 --- /dev/null +++ b/pages/zotmeet/getting-started.mdx @@ -0,0 +1,116 @@ +import { Callout, Steps } from "nextra/components"; + +# Getting Started + +## Local Setup + + + ### Clone the repository to a local machine + + ```bash + git clone https://github.com/icssc/ZotMeet.git + ``` + + + ### Navigate to root directory and install the dependencies + Make sure to use only pnpm as your version manager for this project! + ```bash + cd ZotMeet + pnpm Install + ``` + + ### Start the server + + ```bash + pnpm start # add --host if you want to access the server from other devices in your network + ``` + ### Open the website + + The app should be viewable at `localhost:5173` by default. Changes to the code will automatically update the page. If you ran `pnpm start --host`, you can access the app from other devices on your network at `host-ip:5173`. + + + +### Environment Variables + +If you need credentials for the `.env` file, contact the project lead ([Minh](https://github.com/minhxNguyen7/)). + +After changes to the .env file, run `pnpm run check` to update SvelteKit's auto-generated environment variable types. + +## Local Database Setup + + + ### Download Postgres locally + Go to the [postgres official website](https://www.postgresql.org/download/) and download the database for your specific OS. \([Here](https://www.postgresql.org/docs/16/tutorial-start.html) is more information, if you get stuck) + Be sure to install pgAdmin alongside Postgres! + ### Create local database + Once connected to the Postgres Server, Right click on databases -> create -> database, and name it `zotmeet`. + ### Generate migrations folder + In the ZotMeet project root directory, running `drizzle kit generate:pg` will generate a migrations folder which contain scripts you can run to update your database schema. + ### Configure env file + Create a .env file, and set `DATABASE_URL=postgres://yourusername:yourpassword@localhost:5432/zotmeet` + ### Run all migration files + Using pgAdmin, run all the migration files in order of creation. This can be done using the query tool. + 1. Right click on the `zotmeet` database in pgAdmin, and click 'Query Tool' + 2. Once opened, click on the folder button. Select the files in migration. + 3. Click the triangle run button to execute all the scripts. + 4. Your schema is now set up! + + Alternatively, you can use the `psql` command line tool to execute these scripts. + + + +## Commands + +### Dev + +#### Start Website + +```bash +pnpm run start +``` + +#### Start Website as Host + +```bash +pnpm run start --host +``` + +#### Format + +```bash +pnpm run format +``` + +#### Lint + +```bash +pnpm run lint +``` + +#### Run Tests + +```bash +pnpm run test +``` + +#### Update Variables + +```bash +pnpm run check +``` + +#### Run Drizzle Studio + + + Drizzle studio is a visual tool for Drizzle, allowing you to visualize your queries and data.{" "} + + +```bash +pnpm run studio +``` + +#### Create Schema Migration + +```bash +pnpm run migrate +``` diff --git a/pages/zotmeet/index.md b/pages/zotmeet/index.md deleted file mode 100644 index b1bdff9..0000000 --- a/pages/zotmeet/index.md +++ /dev/null @@ -1 +0,0 @@ -# ZotMeet diff --git a/pages/zotmeet/index.mdx b/pages/zotmeet/index.mdx new file mode 100644 index 0000000..ef4769b --- /dev/null +++ b/pages/zotmeet/index.mdx @@ -0,0 +1,12 @@ +# ZotMeet + +## About + +Simple, clean, and efficient meeting scheduling app. + +## Tech Stack + +- [**S**ST](https://sst.dev) +- [**D**rizzle](https://orm.drizzle.team/) +- [Svelte**K**it](https://kit.svelte.dev) +- [**L**ucia](https://lucia-auth.com)