Skip to content

Commit 9407704

Browse files
committed
add docs
1 parent f0303a5 commit 9407704

File tree

2 files changed

+59
-3
lines changed

2 files changed

+59
-3
lines changed

.devcontainer/devcontainer.json

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"ghcr.io/rails/devcontainer/features/postgres-client": {
1212
"version": "17"
1313
},
14-
"ghcr.io/code-fabrik/features/dokku-cli:latest": {}
14+
"ghcr.io/code-fabrik/features/dokku-cli:latest": {},
15+
"ghcr.io/georglauterbach/dev-container-features/cache-vscode-extensions:0": {}
1516
},
1617
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1718
// This can be used to network with other containers or with the host.
@@ -27,8 +28,40 @@
2728
"dbaeumer.vscode-eslint",
2829
"motivesoft.vscode-uuid-generator",
2930
"dbaeumer.vscode-eslint",
30-
"esbenp.prettier-vscode"
31-
]
31+
"esbenp.prettier-vscode",
32+
"ms-ossdata.vscode-pgsql",
33+
"GitHub.copilot",
34+
"GitHub.vscode-pull-request-github"
35+
],
36+
"settings": {
37+
"pgsql.serverGroups": [
38+
{
39+
"name": "Servers",
40+
"id": "9B1DBC9B-951B-4E3D-AC65-7D4CDE1773A0",
41+
"isDefault": true
42+
}
43+
],
44+
"pgsql.connections": [
45+
{
46+
"id": "30A5E0E0-9901-4311-913B-98F78549DD64",
47+
"groupId": "9B1DBC9B-951B-4E3D-AC65-7D4CDE1773A0",
48+
"authenticationType": "SqlLogin",
49+
"connectTimeout": 15,
50+
"applicationName": "vscode-pgsql",
51+
"clientEncoding": "utf8",
52+
"sslmode": "disable",
53+
"server": "db",
54+
"user": "postgres",
55+
"port": "5432",
56+
"database": "teaching_api",
57+
"password": "postgres",
58+
"savePassword": true,
59+
"profileName": "TeachingAPI",
60+
"copilotAccessMode": "ro",
61+
"expiresOn": 0
62+
}
63+
]
64+
}
3265
}
3366
},
3467
"remoteEnv": {

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# Teaching Website Backend
22
The backend for our teaching website.
33

4+
## Run the Project with VS Code
5+
6+
The Project is ready to be used with dev containers. You only need a recent version of [Docker](https://www.docker.com/). Then you can reopen the project in a devcontainer (`Ctrl+Shift+P` > `Dev Containers: Reopen in Container`).
7+
8+
Setup your local env - inside the devcontainer **you should not set** `DATABASE_URL` yourself.
9+
10+
```bash
11+
USER_ID="<your uuid>"
12+
USER_EMAIL="<your mail>"
13+
USER_ROLE="ADMIN"
14+
NO_AUTH="true"
15+
```
16+
17+
The `USER_ID` and `USER_EMAIL` are used only for seeding the database and are not strictly needed.
18+
The `USER_ID` is the `ID` attribute from the response of [Graph-Explorer/v1.0/me](https://developer.microsoft.com/en-us/graph/graph-explorer) - you need to log in first...
19+
20+
21+
The Project builds and you can run
22+
1. `yarn run db:migrate && yarn run db:seed` (needed only on the initial startup)
23+
2. `yarn run dev`
24+
25+
And done...
26+
427
## Dev Dependencies
528

629
In order to use `.env` files, the [dotenv-cli](https://www.npmjs.com/package/dotenv-cli) must be installed globally:

0 commit comments

Comments
 (0)