From e562677eb784a1ca51d95d879d1272564f041b38 Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan <66127119+adi-lux@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:20:20 -0700 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20=E2=9C=A8=20added=20getting-started?= =?UTF-8?q?.mdx=20details?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/_meta.json | 3 + pages/zotmeet/api/_meta.json | 5 ++ pages/zotmeet/getting-started.md | 1 - pages/zotmeet/getting-started.mdx | 107 ++++++++++++++++++++++++++ pages/zotmeet/{index.md => index.mdx} | 0 5 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 pages/zotmeet/api/_meta.json delete mode 100644 pages/zotmeet/getting-started.md create mode 100644 pages/zotmeet/getting-started.mdx rename pages/zotmeet/{index.md => index.mdx} (100%) 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..9bca01f --- /dev/null +++ b/pages/zotmeet/api/_meta.json @@ -0,0 +1,5 @@ +{ + "index": { + "title": "Overview" + } +} 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..48c5605 --- /dev/null +++ b/pages/zotmeet/getting-started.mdx @@ -0,0 +1,107 @@ +import { Callout, Steps } from "nextra/components"; + +# Getting Started + +## Local Setup + + + ### Clone the repository to a local machine + + `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! + 1. `cd ZotMeet` + 2. `pnpm install` + + ### Start the server + + `pnpm start` (run `pnpm start --host` if you want to access the server from other devices on 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.mdx similarity index 100% rename from pages/zotmeet/index.md rename to pages/zotmeet/index.mdx From 11537f77c484c3b05c6495dc469ce90706675791 Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan <66127119+adi-lux@users.noreply.github.com> Date: Mon, 11 Mar 2024 19:29:54 -0700 Subject: [PATCH 2/9] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20added=20so?= =?UTF-8?q?me=20enhancements=20to=20getting-started.mdx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/getting-started.mdx | 21 +++++++++++++++------ pages/zotmeet/index.mdx | 11 +++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pages/zotmeet/getting-started.mdx b/pages/zotmeet/getting-started.mdx index 48c5605..21df7d8 100644 --- a/pages/zotmeet/getting-started.mdx +++ b/pages/zotmeet/getting-started.mdx @@ -7,17 +7,23 @@ import { Callout, Steps } from "nextra/components"; ### Clone the repository to a local machine - `git clone https://github.com/icssc/ZotMeet.git` + ```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! - 1. `cd ZotMeet` - 2. `pnpm install` + ```bash + cd ZotMeet + pnpm Install + ``` ### Start the server - `pnpm start` (run `pnpm start --host` if you want to access the server from other devices on your network) - + ```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`. @@ -98,7 +104,10 @@ pnpm run check Drizzle studio is a visual tool for Drizzle, allowing you to visualize your queries and data.{" "} -```bash pnpm run studio ``` + +```bash +pnpm run studio +``` #### Create Schema Migration diff --git a/pages/zotmeet/index.mdx b/pages/zotmeet/index.mdx index b1bdff9..ef4769b 100644 --- a/pages/zotmeet/index.mdx +++ b/pages/zotmeet/index.mdx @@ -1 +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) From ffb32ce9ca7f51c6929f411b23e4e3d96f774576 Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan <66127119+adi-lux@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:19:00 -0700 Subject: [PATCH 3/9] =?UTF-8?q?feat:=20=E2=9C=A8=20set=20up=20api=20struct?= =?UTF-8?q?ure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/_meta.json | 15 ++++++++++++++- pages/zotmeet/api/availability/_meta.json | 9 +++++++++ .../api/availability/get_shared_availability.mdx | 0 pages/zotmeet/api/availability/index.mdx | 1 + pages/zotmeet/api/group/_meta.json | 6 ++++++ pages/zotmeet/api/group/index.mdx | 1 + pages/zotmeet/api/index.mdx | 0 pages/zotmeet/api/meeting/_meta.json | 6 ++++++ pages/zotmeet/api/meeting/index.mdx | 1 + pages/zotmeet/api/user/_meta.json | 9 +++++++++ pages/zotmeet/api/user/get_user.mdx | 1 + pages/zotmeet/api/user/index.mdx | 1 + 12 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 pages/zotmeet/api/availability/_meta.json create mode 100644 pages/zotmeet/api/availability/get_shared_availability.mdx create mode 100644 pages/zotmeet/api/availability/index.mdx create mode 100644 pages/zotmeet/api/group/_meta.json create mode 100644 pages/zotmeet/api/group/index.mdx create mode 100644 pages/zotmeet/api/index.mdx create mode 100644 pages/zotmeet/api/meeting/_meta.json create mode 100644 pages/zotmeet/api/meeting/index.mdx create mode 100644 pages/zotmeet/api/user/_meta.json create mode 100644 pages/zotmeet/api/user/get_user.mdx create mode 100644 pages/zotmeet/api/user/index.mdx diff --git a/pages/zotmeet/api/_meta.json b/pages/zotmeet/api/_meta.json index 9bca01f..e194301 100644 --- a/pages/zotmeet/api/_meta.json +++ b/pages/zotmeet/api/_meta.json @@ -1,5 +1,18 @@ { "index": { - "title": "Overview" + "title": "Overview", + "display": "hidden" + }, + "user": { + "title": "User" + }, + "meeting": { + "title": "Meeting" + }, + "group": { + "title": "Group" + }, + "availability": { + "title": "Availability" } } diff --git a/pages/zotmeet/api/availability/_meta.json b/pages/zotmeet/api/availability/_meta.json new file mode 100644 index 0000000..65d12d2 --- /dev/null +++ b/pages/zotmeet/api/availability/_meta.json @@ -0,0 +1,9 @@ +{ + "index": { + "title": "Specification", + "display": "hidden" + }, + "get_shared_availability": { + "title": "Get Shared Availability" + } +} diff --git a/pages/zotmeet/api/availability/get_shared_availability.mdx b/pages/zotmeet/api/availability/get_shared_availability.mdx new file mode 100644 index 0000000..e69de29 diff --git a/pages/zotmeet/api/availability/index.mdx b/pages/zotmeet/api/availability/index.mdx new file mode 100644 index 0000000..a8fcf59 --- /dev/null +++ b/pages/zotmeet/api/availability/index.mdx @@ -0,0 +1 @@ +# Availability diff --git a/pages/zotmeet/api/group/_meta.json b/pages/zotmeet/api/group/_meta.json new file mode 100644 index 0000000..1d45fe7 --- /dev/null +++ b/pages/zotmeet/api/group/_meta.json @@ -0,0 +1,6 @@ +{ + "index": { + "title": "Specification", + "display": "hidden" + } +} diff --git a/pages/zotmeet/api/group/index.mdx b/pages/zotmeet/api/group/index.mdx new file mode 100644 index 0000000..98792e4 --- /dev/null +++ b/pages/zotmeet/api/group/index.mdx @@ -0,0 +1 @@ +# Group diff --git a/pages/zotmeet/api/index.mdx b/pages/zotmeet/api/index.mdx new file mode 100644 index 0000000..e69de29 diff --git a/pages/zotmeet/api/meeting/_meta.json b/pages/zotmeet/api/meeting/_meta.json new file mode 100644 index 0000000..1d45fe7 --- /dev/null +++ b/pages/zotmeet/api/meeting/_meta.json @@ -0,0 +1,6 @@ +{ + "index": { + "title": "Specification", + "display": "hidden" + } +} diff --git a/pages/zotmeet/api/meeting/index.mdx b/pages/zotmeet/api/meeting/index.mdx new file mode 100644 index 0000000..9a44e47 --- /dev/null +++ b/pages/zotmeet/api/meeting/index.mdx @@ -0,0 +1 @@ +# Meeting diff --git a/pages/zotmeet/api/user/_meta.json b/pages/zotmeet/api/user/_meta.json new file mode 100644 index 0000000..cd664ca --- /dev/null +++ b/pages/zotmeet/api/user/_meta.json @@ -0,0 +1,9 @@ +{ + "index": { + "title": "Specification", + "display": "hidden" + }, + "get_user": { + "title": "Get User Information" + } +} diff --git a/pages/zotmeet/api/user/get_user.mdx b/pages/zotmeet/api/user/get_user.mdx new file mode 100644 index 0000000..a1ecbdf --- /dev/null +++ b/pages/zotmeet/api/user/get_user.mdx @@ -0,0 +1 @@ +# Get User Information diff --git a/pages/zotmeet/api/user/index.mdx b/pages/zotmeet/api/user/index.mdx new file mode 100644 index 0000000..f591e12 --- /dev/null +++ b/pages/zotmeet/api/user/index.mdx @@ -0,0 +1 @@ +# User From 88cd19ba7b1400601198686c1efe84d7a6cbd5cc Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan Date: Mon, 11 Mar 2024 22:49:07 -0700 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20=E2=9C=A8=20set=20up=20sample=20api?= =?UTF-8?q?=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/_meta.json | 3 + .../availability/get_shared_availability.mdx | 33 ++++++++ pages/zotmeet/api/example.mdx | 84 +++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 pages/zotmeet/api/example.mdx diff --git a/pages/zotmeet/api/_meta.json b/pages/zotmeet/api/_meta.json index e194301..933b4a8 100644 --- a/pages/zotmeet/api/_meta.json +++ b/pages/zotmeet/api/_meta.json @@ -14,5 +14,8 @@ }, "availability": { "title": "Availability" + }, + "example": { + "title": "Example Documentation" } } diff --git a/pages/zotmeet/api/availability/get_shared_availability.mdx b/pages/zotmeet/api/availability/get_shared_availability.mdx index e69de29..8788ec4 100644 --- a/pages/zotmeet/api/availability/get_shared_availability.mdx +++ b/pages/zotmeet/api/availability/get_shared_availability.mdx @@ -0,0 +1,33 @@ +# Get Shared Availability + +--- + +#### Creating new/overwriting existing stubs & proxy configs + +
+ + `POST` + `/` + `(overwrites all in-memory stub and/or proxy-config)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | None | required | object (JSON or YAML) | N/A | + + ##### Responses + + > | http code | content-type | response | + > |---------------|-----------------------------------|---------------------------------------------------------------------| + > | `201` | `text/plain;charset=UTF-8` | `Configuration created successfully` | + > | `400` | `application/json` | `{"code":"400","message":"Bad Request"}` | + > | `405` | `text/html;charset=utf-8` | None | + + ##### Example cURL + + > ```javascript + > curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/ + > ``` + +##
diff --git a/pages/zotmeet/api/example.mdx b/pages/zotmeet/api/example.mdx new file mode 100644 index 0000000..3ff52ad --- /dev/null +++ b/pages/zotmeet/api/example.mdx @@ -0,0 +1,84 @@ +import { Tabs } from "nextra/components"; + +# Example API Documentation Structure + +## Overview + +The following is to assist those who want to edit or implement their own documentation for the ZotMeet API. The template can be found below. + + + + #### Create New User + +
+ + `POST` + `/` + `(creates a new user)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | None | required | object (JSON or YAML) | N/A | + + ##### Responses + + > | http code | content-type | response | + > |---------------|-----------------------------------|---------------------------------------------------------------------| + > | `201` | `text/plain;charset=UTF-8` | `Configuration created successfully` | + > | `400` | `application/json` | `{"code":"400","message":"Bad Request"}` | + > | `405` | `text/html;charset=utf-8` | None | + + ##### Example cURL + + > ```javascript + > curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/ + > ``` + +
+ ------------------------------------------------------------------------------------------ +
+ + ```md copy + ------------------------------------------------------------------------------------------ + #### Create New User + + + +
+ + `POST` + `/` + `(creates a new user)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | None | required | object (JSON or YAML) | N/A | + + ##### Responses + + > | http code | content-type | response | + > |---------------|-----------------------------------|---------------------------------------------------------------------| + > | `201` | `text/plain;charset=UTF-8` | `Configuration created successfully` | + > | `400` | `application/json` | `{"code":"400","message":"Bad Request"}` | + > | `405` | `text/html;charset=utf-8` | None | + + ##### Example cURL + + > ```javascript + > curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/ + > ``` + +
+ ------------------------------------------------------------------------------------------ + ``` +
+ +
+ +#### Sources + +- Inspired by: https://gist.github.com/azagniotov/a4b16faf0febd12efbc6c3d7370383a6 From 5478832f679eee6c9586f4e5ed6d804fb60c35dd Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan Date: Mon, 11 Mar 2024 23:59:34 -0700 Subject: [PATCH 5/9] =?UTF-8?q?feat:=20=E2=9C=A8=20implemented=20user=20sp?= =?UTF-8?q?ec=20for=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/example.mdx | 143 ++++++++++++++++++---------- pages/zotmeet/api/user/get_user.mdx | 108 +++++++++++++++++++++ 2 files changed, 199 insertions(+), 52 deletions(-) diff --git a/pages/zotmeet/api/example.mdx b/pages/zotmeet/api/example.mdx index 3ff52ad..61ed808 100644 --- a/pages/zotmeet/api/example.mdx +++ b/pages/zotmeet/api/example.mdx @@ -8,75 +8,114 @@ The following is to assist those who want to edit or implement their own documen - #### Create New User + # Get User Information -
- - `POST` - `/` - `(creates a new user)` - - - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | None | required | object (JSON or YAML) | N/A | - - ##### Responses - - > | http code | content-type | response | - > |---------------|-----------------------------------|---------------------------------------------------------------------| - > | `201` | `text/plain;charset=UTF-8` | `Configuration created successfully` | - > | `400` | `application/json` | `{"code":"400","message":"Bad Request"}` | - > | `405` | `text/html;charset=utf-8` | None | - - ##### Example cURL - - > ```javascript - > curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/ - > ``` - -
- ------------------------------------------------------------------------------------------ -
- - ```md copy ------------------------------------------------------------------------------------------ - #### Create New User - - + ### Get Users
- `POST` - `/` - `(creates a new user)` + `GET` + `/users/{id}` + `(gets user matching id)` ##### Parameters > | name | type | data type | description | > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | None | required | object (JSON or YAML) | N/A | + > | id | required | uuid / string | N/A | ##### Responses - - > | http code | content-type | response | - > |---------------|-----------------------------------|---------------------------------------------------------------------| - > | `201` | `text/plain;charset=UTF-8` | `Configuration created successfully` | - > | `400` | `application/json` | `{"code":"400","message":"Bad Request"}` | - > | `405` | `text/html;charset=utf-8` | None | - - ##### Example cURL - - > ```javascript - > curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/ - > ``` + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example Request + ```js + const id = "0000-0000-0000-0000" + const res = await fetch(`api/users/${id}`, + { + method: 'GET', + headers: { "Content-Type": "application/json"} + }) + + user = res.json() + ```
------------------------------------------------------------------------------------------ - ```
+ + ```md copy +
+ + `GET` + `/users/{id}` + `(gets user matching id)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | required | uuid / string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example Request + ```js + const id = "0000-0000-0000-0000" + const res = await fetch(`api/users/${id}`, + { + method: 'GET', + headers: { "Content-Type": "application/json"} + }) + + user = res.json() + !``` + +
+ ``` + +
+
#### Sources diff --git a/pages/zotmeet/api/user/get_user.mdx b/pages/zotmeet/api/user/get_user.mdx index a1ecbdf..be42401 100644 --- a/pages/zotmeet/api/user/get_user.mdx +++ b/pages/zotmeet/api/user/get_user.mdx @@ -1 +1,109 @@ +import { Tabs } from "nextra/components"; + # Get User Information + +--- + +## Get Users + +
+ + `GET` + `/users` + `(gets users matching parameters)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example fetch + ```js + const res = await fetch(`api/users?created_at=3213214`, + { + method: 'GET', + headers: { "Content-Type": "application/json"} + }) + + user = res.json() + ``` + +
+ +--- + +## Get User from ID + +
+ + `GET` + `/users/{id}` + `(gets user matching id)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | required | uuid / string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example fetch + ```js + const id = "0000-0000-0000-0000" + const res = await fetch(`api/users/${id}`, + { + method: 'GET', + headers: { "Content-Type": "application/json"} + }) + + user = res.json() + ``` + +
From 9e009a96c29980ef214c59ce330c95b485151ac7 Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan Date: Tue, 12 Mar 2024 02:58:40 -0700 Subject: [PATCH 6/9] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20minor=20di?= =?UTF-8?q?rectory=20restructure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/_meta.json | 3 +- pages/zotmeet/api/availability.mdx | 1 + pages/zotmeet/api/availability/_meta.json | 9 - .../availability/get_shared_availability.mdx | 33 --- pages/zotmeet/api/availability/index.mdx | 1 - pages/zotmeet/api/group.mdx | 1 + pages/zotmeet/api/group/_meta.json | 6 - pages/zotmeet/api/group/index.mdx | 1 - pages/zotmeet/api/index.mdx | 55 +++++ pages/zotmeet/api/meeting.mdx | 204 ++++++++++++++++++ pages/zotmeet/api/meeting/_meta.json | 6 - pages/zotmeet/api/meeting/index.mdx | 1 - .../api/{user/get_user.mdx => user.mdx} | 4 +- pages/zotmeet/api/user/_meta.json | 9 - pages/zotmeet/api/user/index.mdx | 1 - 15 files changed, 264 insertions(+), 71 deletions(-) create mode 100644 pages/zotmeet/api/availability.mdx delete mode 100644 pages/zotmeet/api/availability/_meta.json delete mode 100644 pages/zotmeet/api/availability/get_shared_availability.mdx delete mode 100644 pages/zotmeet/api/availability/index.mdx create mode 100644 pages/zotmeet/api/group.mdx delete mode 100644 pages/zotmeet/api/group/_meta.json delete mode 100644 pages/zotmeet/api/group/index.mdx create mode 100644 pages/zotmeet/api/meeting.mdx delete mode 100644 pages/zotmeet/api/meeting/_meta.json delete mode 100644 pages/zotmeet/api/meeting/index.mdx rename pages/zotmeet/api/{user/get_user.mdx => user.mdx} (98%) delete mode 100644 pages/zotmeet/api/user/_meta.json delete mode 100644 pages/zotmeet/api/user/index.mdx diff --git a/pages/zotmeet/api/_meta.json b/pages/zotmeet/api/_meta.json index 933b4a8..0b5949e 100644 --- a/pages/zotmeet/api/_meta.json +++ b/pages/zotmeet/api/_meta.json @@ -1,7 +1,6 @@ { "index": { - "title": "Overview", - "display": "hidden" + "title": "Overview" }, "user": { "title": "User" diff --git a/pages/zotmeet/api/availability.mdx b/pages/zotmeet/api/availability.mdx new file mode 100644 index 0000000..329d24c --- /dev/null +++ b/pages/zotmeet/api/availability.mdx @@ -0,0 +1 @@ +# Availability Specification diff --git a/pages/zotmeet/api/availability/_meta.json b/pages/zotmeet/api/availability/_meta.json deleted file mode 100644 index 65d12d2..0000000 --- a/pages/zotmeet/api/availability/_meta.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "index": { - "title": "Specification", - "display": "hidden" - }, - "get_shared_availability": { - "title": "Get Shared Availability" - } -} diff --git a/pages/zotmeet/api/availability/get_shared_availability.mdx b/pages/zotmeet/api/availability/get_shared_availability.mdx deleted file mode 100644 index 8788ec4..0000000 --- a/pages/zotmeet/api/availability/get_shared_availability.mdx +++ /dev/null @@ -1,33 +0,0 @@ -# Get Shared Availability - ---- - -#### Creating new/overwriting existing stubs & proxy configs - -
- - `POST` - `/` - `(overwrites all in-memory stub and/or proxy-config)` - - - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | None | required | object (JSON or YAML) | N/A | - - ##### Responses - - > | http code | content-type | response | - > |---------------|-----------------------------------|---------------------------------------------------------------------| - > | `201` | `text/plain;charset=UTF-8` | `Configuration created successfully` | - > | `400` | `application/json` | `{"code":"400","message":"Bad Request"}` | - > | `405` | `text/html;charset=utf-8` | None | - - ##### Example cURL - - > ```javascript - > curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/ - > ``` - -##
diff --git a/pages/zotmeet/api/availability/index.mdx b/pages/zotmeet/api/availability/index.mdx deleted file mode 100644 index a8fcf59..0000000 --- a/pages/zotmeet/api/availability/index.mdx +++ /dev/null @@ -1 +0,0 @@ -# Availability diff --git a/pages/zotmeet/api/group.mdx b/pages/zotmeet/api/group.mdx new file mode 100644 index 0000000..3c34835 --- /dev/null +++ b/pages/zotmeet/api/group.mdx @@ -0,0 +1 @@ +# Group API Specification diff --git a/pages/zotmeet/api/group/_meta.json b/pages/zotmeet/api/group/_meta.json deleted file mode 100644 index 1d45fe7..0000000 --- a/pages/zotmeet/api/group/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "index": { - "title": "Specification", - "display": "hidden" - } -} diff --git a/pages/zotmeet/api/group/index.mdx b/pages/zotmeet/api/group/index.mdx deleted file mode 100644 index 98792e4..0000000 --- a/pages/zotmeet/api/group/index.mdx +++ /dev/null @@ -1 +0,0 @@ -# Group diff --git a/pages/zotmeet/api/index.mdx b/pages/zotmeet/api/index.mdx index e69de29..c263f25 100644 --- a/pages/zotmeet/api/index.mdx +++ b/pages/zotmeet/api/index.mdx @@ -0,0 +1,55 @@ +# APIs to Write: + +# Whittle down to essential ones + +-[ ] `GET api/users` [Get all users] + +-[ ] `GET api/users/{id}` [Get specific user] + +-[ ] `GET api/users/{id}/groups` [Get all of user's groups] + +-[ ] `GET api/users/{id}/meetings` [Get all of user's meetings] + +-[ ] `GET api/users/{id}/availabilities` [Personal Availability] + +-[ ] `PUT api/users/{id}` [Update user id] + +-[ ] `PUT api/users/{id}/availabilities` [Update user availability] + +-[ ] `POST api/users` Add user + +-[ ] `POST api/users/availability` Add user availability + +-[ ] `PUT api/users/availability` Update user availability + +-[ ] `DELETE api/users/{id}` Delete user + +-[ ] `GET api/meetings` Get meetings + +-[ ] `GET api/meetings/{id}` Get meeting with id + +-[ ] `GET api/meetings/{id}/users` Get meeting with id's specific users + +-[ ] `GET api/meetings/{id}/availabilities` Get meeting with id's specific availabilities + +-[ ] `GET api/meetings/{id}/availabilities/{user_id}` Get meeting with id's specific availabilities for certain user + +-[ ] `POST api/meetings` Add meeting + +-[ ] `POST api/meetings/{id}/availabilities` Add meeting availability + +-[ ] `PUT api/meetings/{id}` Update meeting + +-[ ] `PUT api/meetings/{id}/availabilities/{user_id}` Update meeting-specific availability + +-[ ] `DELETE api/meetings/{id}` Delete meeting + +-[ ] `GET api/availabilities/{user_id}` Get specific user availability + +-[ ] `GET api/availabilities/{user_id}/meetings/{meeting_id}` + +-[ ] `POST api/availabilities/` Adds availability + +-[ ] `PUT api/availabilities/{user_id}` Edits availability for user + +-[ ] `DELETE api/availabilities/{user_id}` Deletes availabilities for user diff --git a/pages/zotmeet/api/meeting.mdx b/pages/zotmeet/api/meeting.mdx new file mode 100644 index 0000000..022cd06 --- /dev/null +++ b/pages/zotmeet/api/meeting.mdx @@ -0,0 +1,204 @@ +import { Tabs } from "nextra/components"; + +# Meeting API Specification + +--- + +## Gets Meetings + +
+ + `GET` + `/meetings` + `(gets meetings matching parameters)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | title | optional | string | N/A | + > | date | optional | date | N/A | + > | description | optional | string | N/A | + > | location | optional | string | N/A | + > | from_time | optional | date | N/A | + > | to_time | optional | date | N/A | + > | group_id | optional | uuid / string | N/A | + > | host_id | optional | uuid / string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | title | string | N/A | + > | date | date | N/A | + > | description | string | N/A | + > | location | string | N/A | + > | from_time | date | N/A | + > | to_time | date | N/A | + > | group_id | uuid / string | N/A | + > | host_id | uuid / string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example fetch + ```js + const res = await fetch(`api/meetings?title=ZotMeeting`, + { + method: 'GET', + headers: { "Content-Type": "application/json"} + }) + + user = res.json() + ``` + +
+ +--- + +## Gets Specific Meeting + +
+ + `GET` + `/meetings/{id}` + `(gets meeting matching specific id)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | required | uuid / string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | title | string | N/A | + > | date | date | N/A | + > | description | string | N/A | + > | location | string | N/A | + > | from_time | date | N/A | + > | to_time | date | N/A | + > | group_id | uuid / string | N/A | + > | host_id | uuid / string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example fetch + ```js + const id = "0000-0000-0000-0000" + const res = await fetch(`api/meetings/${id}`, + { + method: 'GET', + headers: { "Content-Type": "application/json"} + }) + + user = res.json() + ``` + +
+ +--- + +## Creates a Meeting + +
+ + `POST` + `/meetings` + `(creates a new meeting with host id of creator)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | title | optional | string | N/A | + > | date | optional | date | N/A | + > | description | optional | string | N/A | + > | location | optional | string | N/A | + > | from_time | optional | date | N/A | + > | to_time | optional | date | N/A | + > | group_id | optional | uuid / string | N/A | + > | host_id | optional | uuid / string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | Created meeting id | + > | title | string | N/A | + > | date | date | N/A | + > | description | string | N/A | + > | location | string | N/A | + > | from_time | string | N/A | + > | to_time | string | N/A | + > | group_id | uuid / string | N/A | + > | host_id | uuid / string | N/A | + + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + + ##### Example fetch + ```js + const body = { + "id": "3333-333-333-3333", + "title": "meeting", + "date": Date("2024-02-03").toDateString(), + "description": "meeting 1", + "location": "science library", + "from_time": "08:00", + "to_time": "15:00", + "group_id": "4444-2214-f2qw-2239" + "host_id": "2144-1214-fcqw-2439" + } + + const res = await fetch(`api/meetings?title=ZotMeeting`, + { + method: 'POST', + headers: { "Content-Type": "application/json"}, + body: JSON.stringify(body) + }) + + user = res.json() + ``` + +
+ +--- diff --git a/pages/zotmeet/api/meeting/_meta.json b/pages/zotmeet/api/meeting/_meta.json deleted file mode 100644 index 1d45fe7..0000000 --- a/pages/zotmeet/api/meeting/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "index": { - "title": "Specification", - "display": "hidden" - } -} diff --git a/pages/zotmeet/api/meeting/index.mdx b/pages/zotmeet/api/meeting/index.mdx deleted file mode 100644 index 9a44e47..0000000 --- a/pages/zotmeet/api/meeting/index.mdx +++ /dev/null @@ -1 +0,0 @@ -# Meeting diff --git a/pages/zotmeet/api/user/get_user.mdx b/pages/zotmeet/api/user.mdx similarity index 98% rename from pages/zotmeet/api/user/get_user.mdx rename to pages/zotmeet/api/user.mdx index be42401..3eecfae 100644 --- a/pages/zotmeet/api/user/get_user.mdx +++ b/pages/zotmeet/api/user.mdx @@ -1,6 +1,6 @@ import { Tabs } from "nextra/components"; -# Get User Information +# User API Specification --- @@ -106,4 +106,4 @@ import { Tabs } from "nextra/components"; user = res.json() ``` - + diff --git a/pages/zotmeet/api/user/_meta.json b/pages/zotmeet/api/user/_meta.json deleted file mode 100644 index cd664ca..0000000 --- a/pages/zotmeet/api/user/_meta.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "index": { - "title": "Specification", - "display": "hidden" - }, - "get_user": { - "title": "Get User Information" - } -} diff --git a/pages/zotmeet/api/user/index.mdx b/pages/zotmeet/api/user/index.mdx deleted file mode 100644 index f591e12..0000000 --- a/pages/zotmeet/api/user/index.mdx +++ /dev/null @@ -1 +0,0 @@ -# User From e237222565f0b07fe84077e8057aed3ed5bfe864 Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan Date: Tue, 12 Mar 2024 19:58:34 -0700 Subject: [PATCH 7/9] =?UTF-8?q?feat:=20=E2=9C=A8=20set=20up=20all=20/users?= =?UTF-8?q?=20api=20route=20definitions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/_meta.json | 3 - pages/zotmeet/api/availability.mdx | 1 - pages/zotmeet/api/example.mdx | 2 +- pages/zotmeet/api/index.mdx | 57 ++-- pages/zotmeet/api/user.mdx | 419 +++++++++++++++++++++++++++-- 5 files changed, 421 insertions(+), 61 deletions(-) delete mode 100644 pages/zotmeet/api/availability.mdx diff --git a/pages/zotmeet/api/_meta.json b/pages/zotmeet/api/_meta.json index 0b5949e..f9c0c93 100644 --- a/pages/zotmeet/api/_meta.json +++ b/pages/zotmeet/api/_meta.json @@ -11,9 +11,6 @@ "group": { "title": "Group" }, - "availability": { - "title": "Availability" - }, "example": { "title": "Example Documentation" } diff --git a/pages/zotmeet/api/availability.mdx b/pages/zotmeet/api/availability.mdx deleted file mode 100644 index 329d24c..0000000 --- a/pages/zotmeet/api/availability.mdx +++ /dev/null @@ -1 +0,0 @@ -# Availability Specification diff --git a/pages/zotmeet/api/example.mdx b/pages/zotmeet/api/example.mdx index 61ed808..94243bc 100644 --- a/pages/zotmeet/api/example.mdx +++ b/pages/zotmeet/api/example.mdx @@ -6,7 +6,7 @@ import { Tabs } from "nextra/components"; The following is to assist those who want to edit or implement their own documentation for the ZotMeet API. The template can be found below. - + # Get User Information diff --git a/pages/zotmeet/api/index.mdx b/pages/zotmeet/api/index.mdx index c263f25..ed46af5 100644 --- a/pages/zotmeet/api/index.mdx +++ b/pages/zotmeet/api/index.mdx @@ -1,55 +1,56 @@ -# APIs to Write: +# s to Write: -# Whittle down to essential ones +APIs marked with an X are completed --[ ] `GET api/users` [Get all users] +- [ ] `GET /users` `Get Multiple Users` --[ ] `GET api/users/{id}` [Get specific user] +- [ ] `POST /users` `Create User` --[ ] `GET api/users/{id}/groups` [Get all of user's groups] +- [ ] `GET /users/{id}` `Get User` --[ ] `GET api/users/{id}/meetings` [Get all of user's meetings] +- [ ] `PUT /users/{id}` `Update User` --[ ] `GET api/users/{id}/availabilities` [Personal Availability] +- [ ] `DELETE /users/{id}` `Delete User` --[ ] `PUT api/users/{id}` [Update user id] +- [ ] `GET /users/{id}/groups` `Get User's Groups` --[ ] `PUT api/users/{id}/availabilities` [Update user availability] +- [ ] `GET /users/{id}/meetings` `Get User's Meetings +` --[ ] `POST api/users` Add user +- [ ] `GET /users/{id}/availabilities` `Get User's Availabilities` --[ ] `POST api/users/availability` Add user availability +- [ ] `POST /users/{id}/availabilities` `Add User's Availabilities` --[ ] `PUT api/users/availability` Update user availability +- [ ] `GET /users/{id}/availabilities/{meeting_id}` `Get User's Availabilities for Meeting` --[ ] `DELETE api/users/{id}` Delete user +- [ ] `PUT /users/{id}/availabilities/{meeting_id}` `Update User's Availabilities for Meeting` --[ ] `GET api/meetings` Get meetings +- [ ] `DELETE /users/{id}/availabilities/{meeting_id}` `Deletes User's Availabilities for Meeting` --[ ] `GET api/meetings/{id}` Get meeting with id +- [ ] `GET /meetings` `Get Multiple Meetings` --[ ] `GET api/meetings/{id}/users` Get meeting with id's specific users +- [ ] `POST /meetings` `Create Meeting` --[ ] `GET api/meetings/{id}/availabilities` Get meeting with id's specific availabilities +- [ ] `GET /meetings/{id}` `Get Meeting` --[ ] `GET api/meetings/{id}/availabilities/{user_id}` Get meeting with id's specific availabilities for certain user +- [ ] `PUT /meetings/{id}` `Update meeting` --[ ] `POST api/meetings` Add meeting +- [ ] `DELETE /meetings/{id}` `Delete Meeting` --[ ] `POST api/meetings/{id}/availabilities` Add meeting availability +- [ ] `GET /meetings/{id}/users` `Get Meeting's Users` --[ ] `PUT api/meetings/{id}` Update meeting +- [ ] `GET /meetings/{id}/shared-availability` `Get Meeting's Shared Availability` --[ ] `PUT api/meetings/{id}/availabilities/{user_id}` Update meeting-specific availability +- [ ] `GET /groups` `Get Multiple Groups` --[ ] `DELETE api/meetings/{id}` Delete meeting +- [ ] `POST /groups` `Create Group` --[ ] `GET api/availabilities/{user_id}` Get specific user availability +- [ ] `GET /groups/{id}` `Get Group` --[ ] `GET api/availabilities/{user_id}/meetings/{meeting_id}` +- [ ] `PUT /groups/{id}` `Update Group` --[ ] `POST api/availabilities/` Adds availability +- [ ] `DELETE /groups/{id}` `Delete Group` --[ ] `PUT api/availabilities/{user_id}` Edits availability for user +- [ ] `GET /groups/{id}/meetings` `Get Group's Meetings` --[ ] `DELETE api/availabilities/{user_id}` Deletes availabilities for user +- [ ] `GET /groups/{id}/users` `Get Group's Users` diff --git a/pages/zotmeet/api/user.mdx b/pages/zotmeet/api/user.mdx index 3eecfae..64c603b 100644 --- a/pages/zotmeet/api/user.mdx +++ b/pages/zotmeet/api/user.mdx @@ -2,15 +2,49 @@ import { Tabs } from "nextra/components"; # User API Specification ---- - -## Get Users +### Get Multiple Users
`GET` `/users` - `(gets users matching parameters)` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > | name | data type | description | + > |------------|-------------------------|----| + > | id | string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+### Get User + +
+ + `GET` + `/users/{id}` ##### Parameters @@ -43,34 +77,336 @@ import { Tabs } from "nextra/components"; - ##### Example fetch - ```js - const res = await fetch(`api/users?created_at=3213214`, - { - method: 'GET', - headers: { "Content-Type": "application/json"} - }) +
+### Get User's Groups + +
+ + `GET` + `/users/{id}/groups` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + - user = res.json() - ``` + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + +
+### Get User's Meetings ---- +
+ + `GET` + `/users/{id}/meetings` + -## Get User from ID + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+### Get User's Availabilities
`GET` + `/users/{id}/availabilities` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+ +### Get User's Availabilities for Meeting + +
+ + `GET` + `/users/{id}/availabilities/{meeting_id}` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+ +### Create User + +
+ + `POST` + `/users` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+### Create User Availabilities + +
+ + `POST` + `/users/{id}/availabilities` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+### Update User + +
+ + `PUT` + `/users/{id}` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+### Update User Availabilities for Meeting + +
+ + `PUT` + `/users/{id}/availabilities/{meeting_id}` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + + + +
+### Delete User + +
+ + `DELETE` `/users/{id}` - `(gets user matching id)` ##### Parameters > | name | type | data type | description | > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | required | uuid / string | N/A | + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | ##### Responses @@ -94,16 +430,43 @@ import { Tabs } from "nextra/components"; - ##### Example fetch - ```js - const id = "0000-0000-0000-0000" - const res = await fetch(`api/users/${id}`, - { - method: 'GET', - headers: { "Content-Type": "application/json"} - }) - - user = res.json() - ``` +
+### Delete User's Availabilities for Meeting + +
+ + `DELETE` + `/users/{id}/availabilities/{meeting_id}` + + + ##### Parameters + > | name | type | data type | description | + > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| + > | id | optional | uuid / string | N/A | + > | username | optional | string | N/A | + > | email | optional | string | N/A | + > | created_at | optional | string | N/A | + + ##### Responses + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | id | uuid / string | N/A | N/A | + > | username | string | N/A | + > | email | string | N/A | + > | created_at | string | N/A | + + + + > Content-Type: `application/json` + > | name | data type | description | + > |------------|-------------------------|----| + > | code | string | "400" | + > | message | string | "Bad Request" | + + +
From 940317132c4f050a0b11f91146498d87100fb9a9 Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan Date: Wed, 13 Mar 2024 04:25:29 -0700 Subject: [PATCH 8/9] =?UTF-8?q?feat:=20=E2=9C=A8=20added=20meeting=20speci?= =?UTF-8?q?fications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/_meta.json | 3 - pages/zotmeet/api/example.mdx | 123 ------- pages/zotmeet/api/index.mdx | 12 +- pages/zotmeet/api/meeting.mdx | 454 ++++++++++++++++------- pages/zotmeet/api/user.mdx | 676 +++++++++++++++++++++------------- 5 files changed, 754 insertions(+), 514 deletions(-) delete mode 100644 pages/zotmeet/api/example.mdx diff --git a/pages/zotmeet/api/_meta.json b/pages/zotmeet/api/_meta.json index f9c0c93..5c32c3b 100644 --- a/pages/zotmeet/api/_meta.json +++ b/pages/zotmeet/api/_meta.json @@ -10,8 +10,5 @@ }, "group": { "title": "Group" - }, - "example": { - "title": "Example Documentation" } } diff --git a/pages/zotmeet/api/example.mdx b/pages/zotmeet/api/example.mdx deleted file mode 100644 index 94243bc..0000000 --- a/pages/zotmeet/api/example.mdx +++ /dev/null @@ -1,123 +0,0 @@ -import { Tabs } from "nextra/components"; - -# Example API Documentation Structure - -## Overview - -The following is to assist those who want to edit or implement their own documentation for the ZotMeet API. The template can be found below. - - - - # Get User Information - - ------------------------------------------------------------------------------------------ - ### Get Users - -
- - `GET` - `/users/{id}` - `(gets user matching id)` - - - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | required | uuid / string | N/A | - - ##### Responses - - - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | - - - - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | - - - - - ##### Example Request - ```js - const id = "0000-0000-0000-0000" - const res = await fetch(`api/users/${id}`, - { - method: 'GET', - headers: { "Content-Type": "application/json"} - }) - - user = res.json() - ``` - -
- ------------------------------------------------------------------------------------------ -
- - - ```md copy -
- - `GET` - `/users/{id}` - `(gets user matching id)` - - - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | required | uuid / string | N/A | - - ##### Responses - - - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | - - - - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | - - - - - ##### Example Request - ```js - const id = "0000-0000-0000-0000" - const res = await fetch(`api/users/${id}`, - { - method: 'GET', - headers: { "Content-Type": "application/json"} - }) - - user = res.json() - !``` - -
- ``` - -
- -
- -#### Sources - -- Inspired by: https://gist.github.com/azagniotov/a4b16faf0febd12efbc6c3d7370383a6 diff --git a/pages/zotmeet/api/index.mdx b/pages/zotmeet/api/index.mdx index ed46af5..aa2c6b7 100644 --- a/pages/zotmeet/api/index.mdx +++ b/pages/zotmeet/api/index.mdx @@ -29,18 +29,18 @@ APIs marked with an X are completed - [ ] `GET /meetings` `Get Multiple Meetings` -- [ ] `POST /meetings` `Create Meeting` - - [ ] `GET /meetings/{id}` `Get Meeting` -- [ ] `PUT /meetings/{id}` `Update meeting` - -- [ ] `DELETE /meetings/{id}` `Delete 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` diff --git a/pages/zotmeet/api/meeting.mdx b/pages/zotmeet/api/meeting.mdx index 022cd06..9860fb4 100644 --- a/pages/zotmeet/api/meeting.mdx +++ b/pages/zotmeet/api/meeting.mdx @@ -4,200 +4,398 @@ import { Tabs } from "nextra/components"; --- -## Gets Meetings +## Get Multiple Meetings
`GET` `/meetings` - `(gets meetings matching parameters)` ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | title | optional | string | N/A | - > | date | optional | date | N/A | - > | description | optional | string | N/A | - > | location | optional | string | N/A | - > | from_time | optional | date | N/A | - > | to_time | optional | date | N/A | - > | group_id | optional | uuid / string | N/A | - > | host_id | optional | uuid / string | N/A | + > | name | type | description + > |------------|-------------------------|------| + > | id | string | optional | + > | title | string | optional | + > | dates | Date[] | optional | + > | description | string | optional | + > | location | string | optional | + > | from_time | string | optional | + > | to_time | string | optional | + > | group_id | string | optional | + > | host_id | string | optional | ##### Responses - + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | title | string | N/A | - > | date | date | N/A | - > | description | string | N/A | - > | location | string | N/A | - > | from_time | date | N/A | - > | to_time | date | N/A | - > | group_id | uuid / string | N/A | - > | host_id | uuid / string | N/A | + ```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" + } + } + ] + } + ``` + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` - ##### Example fetch - ```js - const res = await fetch(`api/meetings?title=ZotMeeting`, - { - method: 'GET', - headers: { "Content-Type": "application/json"} - }) +
+ +--- + +## 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" + } + } + } + ``` + - user = res.json() - ``` + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + +
--- -## Gets Specific Meeting +## Gets Meeting's Users
`GET` - `/meetings/{id}` - `(gets meeting matching specific id)` + `/meetings/{id}/users` ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | required | uuid / string | N/A | + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | ##### Responses - + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | title | string | N/A | - > | date | date | N/A | - > | description | string | N/A | - > | location | string | N/A | - > | from_time | date | N/A | - > | to_time | date | N/A | - > | group_id | uuid / string | N/A | - > | host_id | uuid / string | N/A | + ```json copy + { + "users": [ + { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + ] + } + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` - ##### Example fetch - ```js - const id = "0000-0000-0000-0000" - const res = await fetch(`api/meetings/${id}`, - { - method: 'GET', - headers: { "Content-Type": "application/json"} - }) +
+ +--- + +## Gets Meeting's Shared Availability + +
+ + `GET` + `/meetings/{id}/shared-availability` + - user = res.json() - ``` + ##### 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" + } + } + + ``` + +
--- -## Creates a Meeting +## Create Meeting
`POST` `/meetings` - `(creates a new meeting with host id of creator)` ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | title | optional | string | N/A | - > | date | optional | date | N/A | - > | description | optional | string | N/A | - > | location | optional | string | N/A | - > | from_time | optional | date | N/A | - > | to_time | optional | date | N/A | - > | group_id | optional | uuid / string | N/A | - > | host_id | optional | uuid / string | N/A | + > | 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 - + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | Created meeting id | - > | title | string | N/A | - > | date | date | N/A | - > | description | string | N/A | - > | location | string | N/A | - > | from_time | string | N/A | - > | to_time | string | N/A | - > | group_id | uuid / string | N/A | - > | host_id | uuid / string | N/A | + ```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 + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```text copy + Modified Meeting Information + ``` + + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + + ``` - ##### Example fetch - ```js - const body = { - "id": "3333-333-333-3333", - "title": "meeting", - "date": Date("2024-02-03").toDateString(), - "description": "meeting 1", - "location": "science library", - "from_time": "08:00", - "to_time": "15:00", - "group_id": "4444-2214-f2qw-2239" - "host_id": "2144-1214-fcqw-2439" - } - - const res = await fetch(`api/meetings?title=ZotMeeting`, - { - method: 'POST', - headers: { "Content-Type": "application/json"}, - body: JSON.stringify(body) - }) - - user = res.json() - ``` +
+ +--- + +## 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 index 64c603b..67cf3fd 100644 --- a/pages/zotmeet/api/user.mdx +++ b/pages/zotmeet/api/user.mdx @@ -10,31 +10,41 @@ import { Tabs } from "nextra/components"; `/users` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | - - ##### Responses - + ##### Request + + > | name | type | description + > |------------|-------------------------|------| + > | id | string | optional | + > | username | string | optional | + > | email | string | optional | + > | created_at | Date | optional | + + ##### Response + - > | name | data type | description | - > |------------|-------------------------|----| - > | id | string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```json copy + { + "users": [ + { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + ] + } + + ``` - - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | - + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -47,33 +57,35 @@ import { Tabs } from "nextra/components"; `/users/{id}` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | - ##### Responses - + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```json copy + { + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date" + } + } + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | - + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -86,32 +98,38 @@ import { Tabs } from "nextra/components"; `/users/{id}/groups` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | - ##### Responses - + + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```json copy + { + "groups": [ + { + "id": "string", + "name": "string", + "description": "string", + "created_at": "Date" + } + ] + } + ``` - - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -125,32 +143,53 @@ import { Tabs } from "nextra/components"; `/users/{id}/meetings` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | - ##### Responses - + + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```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" + } + } + ] + } + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -164,32 +203,64 @@ import { Tabs } from "nextra/components"; `/users/{id}/availabilities` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | - ##### Responses - + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```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" + } + } + } + ] + } + + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + @@ -204,32 +275,66 @@ import { Tabs } from "nextra/components"; `/users/{id}/availabilities/{meeting_id}` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request + > | name | type | description + > |------------|-------------------------|------| + > | id | string | required | + > | meeting_id | string | required | - ##### Responses - + + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```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" + } + } + } + ] + } + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + @@ -239,42 +344,58 @@ import { Tabs } from "nextra/components"; ### Create User
+ `POST` `/users` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | - ##### Responses + ##### Request + + > | name | type | required | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | username | string | True | + > | email | string | True | + > | guest | boolean | True | + + ##### Response - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + + ```json copy + { + "user": { + "id": "string", + "username": "string", + "email": "string", + "created_at": "Date", + "guest": "boolean" + } + } + ``` + + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + +
+ ### Create User Availabilities
@@ -283,32 +404,71 @@ import { Tabs } from "nextra/components"; `/users/{id}/availabilities` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | - - ##### Responses + ##### 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 - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```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" + } + } + } + ] + } + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -317,37 +477,45 @@ import { Tabs } from "nextra/components"; ### Update User
+ `PUT` `/users/{id}` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | - ##### Responses + ##### Request + + > | name | type | required | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | user_id | string | True | + > | username | string | False | + > | email | string | False | + > | guest | string | False | + + ##### Response + + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```text copy + Saved User Information + ``` + + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` + @@ -361,32 +529,38 @@ import { Tabs } from "nextra/components"; `/users/{id}/availabilities/{meeting_id}` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | - - ##### Responses - + ##### 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 + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```text copy + User-Meeting availability successfully modified + ``` + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -400,32 +574,29 @@ import { Tabs } from "nextra/components"; `/users/{id}` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request + > | name | type | description | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | id | string | Required | - ##### Responses - + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```text copy + User successfully deleted + ``` + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` @@ -439,32 +610,29 @@ import { Tabs } from "nextra/components"; `/users/{id}/availabilities/{meeting_id}` - ##### Parameters - > | name | type | data type | description | - > |-----------|-----------|-------------------------|-----------------------------------------------------------------------| - > | id | optional | uuid / string | N/A | - > | username | optional | string | N/A | - > | email | optional | string | N/A | - > | created_at | optional | string | N/A | + ##### Request required + > | name | type | description | + > |-----------|-------------------------|-----------------------------------------------------------------------| + > | id | string | Required | + > | meeting_id | string | Required | - ##### Responses - + ##### Response + - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | id | uuid / string | N/A | N/A | - > | username | string | N/A | - > | email | string | N/A | - > | created_at | string | N/A | + ```text copy + Availability Deleted + ``` - > Content-Type: `application/json` - > | name | data type | description | - > |------------|-------------------------|----| - > | code | string | "400" | - > | message | string | "Bad Request" | + ```json copy + { + "error": { + "status": "number", + "message": "string" + } + } + ``` From ba3222d02a4513609724960e52464606a465838e Mon Sep 17 00:00:00 2001 From: Adithya Anandsaikrishnan Date: Wed, 13 Mar 2024 04:45:42 -0700 Subject: [PATCH 9/9] =?UTF-8?q?feat:=20=E2=9C=A8=20added=20groups=20spec?= =?UTF-8?q?=20for=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adithya Anandsaikrishnan --- pages/zotmeet/api/group.mdx | 311 ++++++++++++++++++++++++++++++++++ pages/zotmeet/api/index.mdx | 4 +- pages/zotmeet/api/meeting.mdx | 1 - pages/zotmeet/api/user.mdx | 1 + 4 files changed, 314 insertions(+), 3 deletions(-) diff --git a/pages/zotmeet/api/group.mdx b/pages/zotmeet/api/group.mdx index 3c34835..d019498 100644 --- a/pages/zotmeet/api/group.mdx +++ b/pages/zotmeet/api/group.mdx @@ -1 +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 index aa2c6b7..4c3fb13 100644 --- a/pages/zotmeet/api/index.mdx +++ b/pages/zotmeet/api/index.mdx @@ -1,6 +1,6 @@ -# s to Write: +# API List -APIs marked with an X are completed +Attached is a list of all API Routes for ZotMeet. Subject to Change. - [ ] `GET /users` `Get Multiple Users` diff --git a/pages/zotmeet/api/meeting.mdx b/pages/zotmeet/api/meeting.mdx index 9860fb4..571764e 100644 --- a/pages/zotmeet/api/meeting.mdx +++ b/pages/zotmeet/api/meeting.mdx @@ -18,7 +18,6 @@ import { Tabs } from "nextra/components"; > | id | string | optional | > | title | string | optional | > | dates | Date[] | optional | - > | description | string | optional | > | location | string | optional | > | from_time | string | optional | > | to_time | string | optional | diff --git a/pages/zotmeet/api/user.mdx b/pages/zotmeet/api/user.mdx index 67cf3fd..46fbf4b 100644 --- a/pages/zotmeet/api/user.mdx +++ b/pages/zotmeet/api/user.mdx @@ -49,6 +49,7 @@ import { Tabs } from "nextra/components";
+ ### Get User