Skip to content

Commit eadeca5

Browse files
committed
update readme.md
1 parent 52d64d6 commit eadeca5

File tree

2 files changed

+67
-25
lines changed

2 files changed

+67
-25
lines changed

README.md

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,28 @@ Some key features include:
1010

1111
## Development
1212

13+
Quickstart:
14+
1315
- Install npm, docker and docker compose
1416
- Clone the repository
1517
- Copy `.env.template` as `.env` file and fill in the required values
1618
- Run `npm i` and `npm start` to setup and start the development environment
1719

18-
## Azure setup
20+
## Environment setup
21+
22+
See `compose.yaml` for local development. In short, in addition to the CC server, you need
23+
24+
- PostgreSQL (docker)
25+
- Redis (docker)
26+
- Ollama (docker)
27+
- Azure
28+
- S3
29+
30+
### Azure
1931

20-
Create an AI foundry resource (or something) and create deployment for the models you want to use (gpt4.1 for example).
32+
Azure is used for OpenAI LLMs.
33+
34+
Create an AI foundry resource (or something) and create deployment for the models you want to use (gpt4.1 for example).
2135

2236
Then populate .env with the following:
2337
```
@@ -26,6 +40,18 @@ AZURE_API_KEY=<asd>
2640
GPT_41=<name-of-the-deployment-you-created>
2741
```
2842

43+
### S3
44+
45+
S3 is used for storing user-uploaded files and their processed versions.
46+
47+
Create an S3 bucket and populate .env with the following:
48+
```
49+
S3_HOST=<host-url>
50+
S3_BUCKET=<name-of-the-bucket-you-created>
51+
S3_ACCESS_KEY=<access-key>
52+
S3_SECRET_KEY=<secret-key>
53+
```
54+
2955
## Developers: things to know
3056

3157
### Debugging in production
@@ -35,7 +61,7 @@ In browser console, run
3561
toggleDevtools()
3662
```
3763

38-
### Troubleshooting
64+
### Common issues
3965

4066
Getting `Error: Cannot find module @rollup/rollup-linux-arm64-musl` on MacOS?
4167
This is likely because you ran `npm i` locally.
@@ -46,6 +72,43 @@ docker compose build
4672

4773
If then you're getting `concurrently not found`, prepend the `npm run dev` script with `npm i` and run once with that.
4874

49-
### Trivia
75+
## E2E Testing
76+
77+
Playwright e2e tests are located in `e2e`. `playwright.config.ts` is also important.
78+
79+
Run the tests with
80+
```bash
81+
npm run e2e
82+
```
83+
84+
To run just one test, mark it with `.only`:
85+
86+
```ts
87+
test.only('test name', async ({ page }) => {
88+
// test code
89+
});
90+
```
91+
92+
When writing new spec file, make sure to import the test function from the fixtures file, like this:
93+
```ts
94+
import { teacherTest as test } from './fixtures'
95+
```
96+
97+
So that the global foreach function runs for your tests. For different user roles (`studentTest`, `teacherTest`, `adminTest`), import the corresponding test function:
98+
```ts
99+
import { studentTest as test } from './fixtures'
100+
```
101+
102+
### Test setup and data
103+
104+
Test user headers are defined in `src/shared/testData.ts`. TEST_COURSES are also defined there.
105+
106+
Before each test, the test data of a test user is reset by calling the `/test/reset-test-data` endpoint. It is found at `src/server/routes/testUtils.ts`.
107+
108+
When running the tests, the headers `x-test-user-idx` and `x-test-user-role` are set, defining the test user's id and iam-based role. They are read at `src/server/middleware/user.ts`.
109+
110+
The tests are isolated so that each (should at least) modifies their own data discriminated by the user's id. This allows parallel execution.
111+
112+
## Trivia
50113

51114
The terms `course` and `chatInstance` refer to the same thing in the codebase. However, only `chatInstance` is correct, always prefer it.

e2e/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)