You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ Mad3 is a fork of [mad2](https://github.com/icdocsoc/mad2), re-written for the g
6
6
7
7
This project is open-source and free to look at. If you wish to change something about the website, you can open a PR and we shall review it.
8
8
9
+
Mad3 is written such that future webmasters (and anyone else) should be able to run it purely with an `.env` file, `docker compose up`, and the allocations script. You should never have to edit the code unless you are bugfixing or modifying features.
10
+
9
11
## Project structure
10
12
11
13
Although using Nuxt 3, we have opted to use Nuxt 4 in our build. [`app/`](/app/) contains the frontend while the [`hono/`](/hono/) contains the server.
@@ -23,31 +25,49 @@ docker compose build
23
25
```
24
26
25
27
Now run the postgres image.
28
+
26
29
```bash
27
30
# If you want to run it in the background
28
31
docker compose start postgres
29
-
# You will need to then later run
32
+
# You will need to then later run
30
33
# docker compose stop postgres
31
34
32
35
# If you want to run it in the foreground to see the logs
33
36
docker compose up postgres
34
37
```
35
38
36
39
Finally, run the website.
40
+
37
41
```bash
38
42
# The --bun is required as bunfigs are broken, as of writing this.
39
43
bun run --bun dev
40
44
```
41
45
46
+
We run the website this way rather than using the Docker image as we want hot-reload and other development features.
47
+
42
48
## Production
43
49
44
-
Docker images are made available for easy running on prod.
50
+
Docker images are made available for easy running on prod. See the local development section for an explanation of how to fill out the environment variables.
51
+
52
+
To simulate a production run locally, run
53
+
54
+
```bash
55
+
docker compose build
56
+
57
+
docker compose up
58
+
```
59
+
60
+
Note that published Docker builds are generated from the branch `release/latest`.
45
61
46
-
## Allocations
62
+
## Allocations & more
47
63
48
-
Run `run.py` in the allocations folder.
64
+
Clone the repo locally and run `run.py` in the allocations folder. You can find your auth cookie from the developer tools (CTRL + SHIFT + I) -> Network -> refresh the page and see the Cookie tab of the request.
49
65
50
-
You can find your auth cookie from the developer tools (CTRL + SHIFT + I) -> Network -> refresh the page and see the Cookie tab of the request.
66
+
Once the allocations are done, run `generateCsv.ts` to generate a CSV file that you can import into Excel and print out, for on the day organization. There also exists the admin page to facilitate this, but paper never goes wrong.
67
+
68
+
There also exists an admin page at `/admin` restricted to webmasters as per the env file, where you can search families, see statistics, and change the state of the website.
69
+
70
+
Should you intend to use this code outside of an Imperial context, you will need to change the sign in code, callback code, and `isFresherOrParent` function. These are found in [`hono/auth/auth.ts`](/hono/auth/auth.ts) and [`hono/auth/jwt.ts`](/hono/auth/jwt.ts).
51
71
52
72
## Contributors
53
73
@@ -56,5 +76,6 @@ You can find your auth cookie from the developer tools (CTRL + SHIFT + I) -> Net
authCookie=input("Please insert your auth cookie:\nThis will only be saved in memory to do the allocations.\nSee the README if you're unsure how to get this.\n")
0 commit comments