-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/duplicate-person-within-cohort
- Loading branch information
Showing
40 changed files
with
6,352 additions
and
2,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Mintlify Starter Kit | ||
|
||
Click on `Use this template` to copy the Mintlify starter kit. The starter kit contains examples including | ||
|
||
- Guide pages | ||
- Navigation | ||
- Customizations | ||
- API Reference pages | ||
- Use of popular components | ||
|
||
### Development | ||
|
||
Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command | ||
|
||
``` | ||
npm i -g mintlify | ||
``` | ||
|
||
Run the following command at the root of your documentation (where mint.json is) | ||
|
||
``` | ||
mintlify dev | ||
``` | ||
|
||
### Publishing Changes | ||
|
||
Install our Github App to auto propagate changes from your repo to your deployment. Changes will be deployed to production automatically after pushing to the default branch. Find the link to install on your dashboard. | ||
|
||
#### Troubleshooting | ||
|
||
- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies. | ||
- Page loads as a 404 - Make sure you are running in a folder with `mint.json` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: 'Create Plant' | ||
openapi: 'POST /plants' | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: 'Delete Plant' | ||
openapi: 'DELETE /plants/{id}' | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: 'Get Plants' | ||
openapi: 'GET /plants' | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: 'Introduction' | ||
description: 'Example section for showcasing API endpoints' | ||
--- | ||
|
||
<Note> | ||
If you're not looking to build API reference documentation, you can delete | ||
this section by removing the api-reference folder. | ||
</Note> | ||
|
||
## Welcome | ||
|
||
There are two ways to build API documentation: [OpenAPI](https://mintlify.com/docs/api-playground/openapi/setup) and [MDX components](https://mintlify.com/docs/api-playground/mdx/configuration). For the starter kit, we are using the following OpenAPI specification. | ||
|
||
<Card | ||
title="Plant Store Endpoints" | ||
icon="leaf" | ||
href="https://github.com/mintlify/starter/blob/main/api-reference/openapi.json" | ||
> | ||
View the OpenAPI specification file | ||
</Card> | ||
|
||
## Authentication | ||
|
||
All API endpoints are authenticated using Bearer tokens and picked up from the specification file. | ||
|
||
```json | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,188 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI Plant Store", | ||
"description": "A sample API that uses a plant store as an example to demonstrate features in the OpenAPI specification", | ||
"license": { | ||
"name": "MIT" | ||
}, | ||
"version": "1.0.0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://sandbox.mintlify.com" | ||
} | ||
], | ||
"security": [ | ||
{ | ||
"bearerAuth": [] | ||
} | ||
], | ||
"paths": { | ||
"/plants": { | ||
"get": { | ||
"description": "Returns all plants from the system that the user has access to", | ||
"parameters": [ | ||
{ | ||
"name": "limit", | ||
"in": "query", | ||
"description": "The maximum number of results to return", | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Plant response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Plant" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "Unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"description": "Creates a new plant in the store", | ||
"requestBody": { | ||
"description": "Plant to add to the store", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/NewPlant" | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "plant response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Plant" | ||
} | ||
} | ||
} | ||
}, | ||
"400": { | ||
"description": "unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/plants/{id}": { | ||
"delete": { | ||
"description": "Deletes a single plant based on the ID supplied", | ||
"parameters": [ | ||
{ | ||
"name": "id", | ||
"in": "path", | ||
"description": "ID of plant to delete", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"204": { | ||
"description": "Plant deleted", | ||
"content": {} | ||
}, | ||
"400": { | ||
"description": "unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Plant": { | ||
"required": ["name"], | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"description": "The name of the plant", | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"description": "Tag to specify the type", | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"NewPlant": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/components/schemas/Plant" | ||
}, | ||
{ | ||
"required": ["id"], | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"description": "Identification number of the plant", | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"Error": { | ||
"required": ["error", "message"], | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"securitySchemes": { | ||
"bearerAuth": { | ||
"type": "http", | ||
"scheme": "bearer" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: Quickstart | ||
description: 'Get started with the NWD API' | ||
--- | ||
|
||
## Noting to see yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
--- | ||
title: Quickstart | ||
description: 'Get started with local development' | ||
--- | ||
|
||
## Cloning the repository | ||
|
||
To get started with the development environment, clone the repository to your local machine. | ||
|
||
```bash | ||
git clone https://github.com/buchungapp/nationaal-watersportdiploma.git ./nwd | ||
``` | ||
|
||
Navigate to the project directory. | ||
|
||
```bash | ||
cd nwd | ||
``` | ||
|
||
## Installing dependencies | ||
|
||
### Package manager | ||
|
||
The NWD project uses [pnpm v8](https://pnpm.io/8.x/installation) as the package manager. | ||
Please make sure you are using the correct version, to prevent any issues. | ||
|
||
Alternatively, you can use: `npx pnpm@v8 <command>` | ||
|
||
### Initialization | ||
|
||
To install the dependencies and build the api, run the following command: | ||
|
||
```bash | ||
pnpm initialize | ||
``` | ||
|
||
## Setting up Supabase | ||
|
||
The NWD project uses [Supabase](https://supabase.io/) as the database and auth provider. | ||
You can follow the quide at [supabase.io/docs](https://supabase.com/docs/guides/cli/getting-started) to get started. | ||
|
||
We also provide a simplified guide below. | ||
|
||
<Accordion title="Setting up Supabase for local development"> | ||
|
||
To get started, you need to install the [Supabase CLI](https://supabase.com/docs/guides/cli/getting-started). | ||
|
||
```bash | ||
pnpm add -g supabase | ||
``` | ||
|
||
And install [Docker](https://docs.docker.com/engine/install/) or [Docker Desktop](https://docs.docker.com/desktop/) for supabase to run locally. | ||
|
||
</Accordion> | ||
|
||
Then you are ready to start the Supabase server. | ||
|
||
```bash | ||
supabase start | ||
``` | ||
|
||
## Setting up the database | ||
|
||
To set up the database, run the following command: | ||
|
||
<Warning> | ||
This command will run database migrations and **reset** the database. | ||
</Warning> | ||
|
||
```bash | ||
pnpm db:reset | ||
``` | ||
|
||
After this we want to seed the database with some initial data. This will add a simple course and sailing school to the database. | ||
|
||
<Note> | ||
None of the course requirements and users are real and are only for testing | ||
purposes. | ||
</Note> | ||
|
||
```bash | ||
pnpm db:seed | ||
``` | ||
|
||
### Example users add by the seed | ||
|
||
| Name | E-mail | Role | | ||
| :------------ | :--------------------------------- | :------------------------- | | ||
| Jan Jansen | [email protected] | Location admin, instructor | | ||
| Emma de Vries | [email protected] | Instructor | | ||
| Timo Peters | [email protected] | Cursist | | ||
| Lisa Peters | [email protected] | Cursist | | ||
| Lars Peters | [email protected] | Cursist | | ||
| - | [email protected] | Secretariaat | | ||
|
||
### Logging in | ||
|
||
To log in to the application, you can use the users above. When you input the email address, you will receive a magic link in the inbox. | ||
The inbox for local supabase development can be found at [http://localhost:54324/monitor](http://localhost:54324/monitor). | ||
|
||
## Building the core package | ||
|
||
If you made changes to the core package, you need to build it. | ||
|
||
```bash | ||
cd packages/core | ||
pnpm build | ||
``` | ||
|
||
## Starting NWD website | ||
|
||
To start the NDW website, open up a new terminal and run the following command: | ||
|
||
```bash | ||
cd apps/web | ||
pnpm dev | ||
``` | ||
|
||
The site should now be running on [http://localhost:3000](http://localhost:3000). |
Oops, something went wrong.