@@ -17,190 +17,49 @@ docker compose up -d && docker compose logs -f
17
17
#### frontend
18
18
``` bash
19
19
cd frontend
20
- npm i # on initial startup
21
- npm run codegen # on initial startup and when queries or mutations are changed
20
+ npm i
21
+ npm run codegen
22
22
npm run dev
23
23
```
24
24
25
25
#### backend
26
+ > [ !IMPORTANT]
27
+ > In development, the backend creates some example data and creates an admin user:
28
+
29
+ > Password: ` admin `
26
30
``` bash
27
31
cd server
28
- go generate ./... # on initial startup and when schema.graphql is changed
32
+ go generate ./...
29
33
go run server.go
30
34
```
31
35
32
- #### example data
33
- 1 . visit [ localhost:8080/playground] ( http://localhost:8080/playground )
34
- 2 . get a session id for the generated admin user by doing a login query
35
- ```
36
- {
37
- login (
38
-
39
- password: "<generated password from backend logs>"
40
- )
41
- }
42
- ```
43
- 3. in the playground go to the headers tab and paste the session id
44
- ```
45
- {
46
- "SID": "<session id>"
47
- }
48
- ```
49
- <details>
50
- <summary>4. trigger the following mutation</summary>
36
+ ## env vars
51
37
52
- mutation exampleData {
53
- tutor1: addUser(user: {mail: "[email protected] ", fn: "Tutorin", sn: "One", password: "test1"})
54
- tutor2: addUser(user: {mail: "[email protected] ", fn: "Tutor", sn: "Two", password: "test2"})
55
- mmk: addBuilding(
56
- building: {name: "Mathematikon", street: "INF", number: "205", city: "Heidelberg", zip: "69115", latitude: 49.417493, longitude: 8.675197, zoomLevel: 17}
57
- ) {
58
- ID
59
- }
60
- kip: addBuilding(
61
- building: {name: "Kirchhoff-Institut für Physik", street: "INF", number: "227", city: "Heidelberg", zip: "69115", latitude: 49.4162501, longitude: 8.6694734, zoomLevel: 17}
62
- ) {
63
- ID
64
- }
65
- sr1: addRoom(
66
- room: {number: "101", name: "SR 1", capacity: 20, floor: 2, buildingID: 1}
67
- ) {
68
- number
69
- }
70
- sr2: addRoom(room: {number: "2.141", capacity: 35, buildingID: 1}) {
71
- number
72
- }
73
- sr3: addRoom(
74
- room: {number: "503", name: "Labor 1", capacity: 30, floor: 5, buildingID: 2}
75
- ) {
76
- number
77
- }
78
- mathe: addLabel(label: {name: "Mathe", color: "#87cefa", kind: TOPIC}) {
79
- name
80
- }
81
- info: addLabel(label: {name: "Informatik", color: "#FFE31A", kind: TOPIC}) {
82
- name
83
- }
84
- allg: addLabel(label: {name: "Allgemein", color: "#5D737E", kind: TOPIC}) {
85
- name
86
- }
87
- tutorial: addLabel(
88
- label: {name: "Tutorium", color: "#ABBA7C", kind: EVENT_TYPE}
89
- ) {
90
- name
91
- }
92
- vl: addLabel(label: {name: "Vorlesung", color: "#ffbf00", kind: EVENT_TYPE}) {
93
- name
94
- }
95
- vk: addEvent(
96
- event: {title: "Vorkurs 2025", description: "Lorem Ipsum", from: "2030-02-21T00:00:00Z", to: "2030-02-24T00:00:00Z", needsTutors: true}
97
- ) {
98
- ID
99
- }
100
- pvk: addEvent(
101
- event: {title: "Programmiervorkurs 2025", description: "Lorem Ipsum", from: "2030-02-21T00:00:00Z", to: "2030-02-24T00:00:00Z", needsTutors: true}
102
- ) {
103
- ID
104
- }
105
- alda: addEvent(
106
- event: {title: "Algorithmen und Datenstrukturen", description: "Lorem Ipsum dolor sit amed", topicName: "Informatik", typeName: "Tutorium", needsTutors: true, from: "2030-02-21T00:00:00Z", to: "2030-02-21T01:00:00Z", umbrellaID: 1}
107
- ) {
108
- ID
109
- }
110
- ana: addEvent(
111
- event: {title: "Analysis", description: "Lorem Ipsum dolor sit amed", topicName: "Mathe", typeName: "Vorlesung", needsTutors: true, from: "2030-02-28T00:00:00Z", to: "2030-02-28T02:00:00Z", umbrellaID: 1}
112
- ) {
113
- ID
114
- }
115
- sr1vk: addRoomAvailabilityForEvent(
116
- availability: {roomNumber: "101", buildingID: 1, eventID: 3}
117
- ) {
118
- number
119
- }
120
- sr2vk: addRoomAvailabilityForEvent(
121
- availability: {roomNumber: "2.141", buildingID: 1, eventID: 3}
122
- ) {
123
- number
124
- }
125
- sr3pvk: addRoomAvailabilityForEvent(
126
- availability: {roomNumber: "503", buildingID: 2, eventID: 5}
127
- ) {
128
- number
129
- }
130
- t1sr1: addEventAssignmentForTutor(
131
- assignment: {eventID: 3, userMail: "[email protected] ", roomNumber: "101", buildingID: 1}
132
- ) {
133
- ID
134
- }
135
- t2sr1: addEventAssignmentForTutor(
136
- assignment: {eventID: 3, userMail: "[email protected] ", roomNumber: "101", buildingID: 1}
137
- ) {
138
- ID
139
- }
140
- t2sr2: addEventAssignmentForTutor(
141
- assignment: {eventID: 3, userMail: "[email protected] ", roomNumber: "2.141", buildingID: 1}
142
- ) {
143
- ID
144
- }
145
- t1vk: addTutorAvailabilityForEvent(
146
- availability: {userMail: "[email protected] ", eventID: [3, 4]}
147
- ) {
148
- mail
149
- }
150
- t2vk: addTutorAvailabilityForEvent(
151
- availability: {userMail: "[email protected] ", eventID: [3, 4]}
152
- ) {
153
- mail
154
- }
155
- addForm(
156
- form: {title: "Beispielregistrierung", description: "Lorem Ipsum dolor sit amed", questions: [{title: "Wie viel Programmiererfahrung hast du?", type: SCALE, required: true, answers: [{title: "Keine", points: 8}, {title: "Ich arbeite an eigenen Projekten", points: 0}]}, {title: "Welche der folgenden Konzepte kennst du noch nicht?", type: MULTIPLE_CHOICE, required: false, answers: [{title: "Variablen", points: 5}, {title: "If-Bedingungen", points: 4}, {title: "For/While-Schleifen", points: 3}, {title: "Klassen", points: 1}]}]}
157
- ) {
158
- eventID
159
- }
160
- s1: addSetting(setting: {key: "copyright-notice", value: "Copyright © 2024, Fachschaft MathPhysInfo. All rights reserved.", type: STRING}) { key }
161
- s2: addSetting(setting: {key: "email-greeting", value: "Hey", type: STRING}) { key }
162
- s3: addSetting(setting: {key: "email-signature", value: "Dein", type: STRING}) { key }
163
- s4: addSetting(setting: {key: "email-name", value: "Fachschaft MPI", type: STRING}) { key }
164
- s5: addSetting(setting: {key: "email-confirm-subject", value: "Bestätige deine Registrierung", type: STRING}) { key }
165
- s6: addSetting(setting: {key: "email-confirm-intro", value: "Bitte bestätige deine Registrierung.", type: STRING}) { key }
166
- s7: addSetting(setting: {key: "email-confirm-button-instruction", value: "Klicke auf den Button", type: STRING}) { key }
167
- s8: addSetting(setting: {key: "email-confirm-button-text", value: "Bestätigen", type: STRING}) { key }
168
- s9: addSetting(setting: {key: "email-availability-subject", value: "Verfügbarkeit für Tutorien", type: STRING}) { key }
169
- s10: addSetting(setting: {key: "email-availability-intro", value: "Bitte gib deine Verfügbarkeiten an.", type: STRING}) { key }
170
- s11: addSetting(setting: {key: "email-availability-outro", value: "Danke für deine Rückmeldung!", type: STRING}) { key }
171
- s12: addSetting(setting: {key: "email-assignment-subject", value: "Zuteilung zu Tutorien", type: STRING}) { key }
172
- s13: addSetting(setting: {key: "email-assignment-event-title", value: "Veranstaltung", type: STRING}) { key }
173
- s14: addSetting(setting: {key: "email-assignment-kind-title", value: "Art", type: STRING}) { key }
174
- s15: addSetting(setting: {key: "email-assignment-date-title", value: "Datum", type: STRING}) { key }
175
- s16: addSetting(setting: {key: "email-assignment-time-title", value: "Uhrzeit", type: STRING}) { key }
176
- s17: addSetting(setting: {key: "email-assignment-room-title", value: "Raum", type: STRING}) { key }
177
- s18: addSetting(setting: {key: "email-assignment-building-title", value: "Gebäude", type: STRING}) { key }
178
- s19: addSetting(setting: {key: "email-assignment-intro", value: "Hier ist deine Zuteilung", type: STRING}) { key }
179
- s20: addSetting(setting: {key: "email-assignment-outro", value: "Viel Erfolg!", type: STRING}) { key }
180
- }
181
- </details>
38
+ ### required
182
39
183
- ### troubleshooting
184
- If you lost your admin password, delete the database `server/pepp.db` and rerun the server. The admin password is only shown on initial startup in your server logs.
40
+ | Key | Description |
41
+ | - | - |
42
+ | ` PUBLIC_URL ` | The domain under which pepp is deployed |
43
+ | ` PEPPER_KEY ` | Generate a random 64 characters long string for password security |
44
+ | ` SMTP_HOST ` | E-Mail provider, e.g. ` smtp.example.de ` |
45
+ | ` SMTP_USER ` | E.g.
` [email protected] ` |
46
+ | ` SMTP_PASSWORD ` | The password to log into the SMTP Server |
47
+ | ` SMTP_PORT ` | Mostly ` 465 ` |
48
+ | ` FROM_ADDRESS ` | Address from which mails are send, e.g.
` [email protected] ` |
185
49
186
- ## env vars
50
+ ### optional
187
51
188
52
| Key | Description |
189
53
| - | - |
190
- | `LOG_LEVEL` (optional) | Default is `Info`. Set to `Debug` for more information |
191
- | `PUBLIC_URL` (required) | The domain under which pepp is deployed |
192
- | `PEPPER_KEY` (required) | Generate a random 64 characters long string for password security |
193
- | `ADMIN_USER` (optional) | Default is `[email protected] `. Generated on initial startup |
194
- | `POSTGRES_HOST` (optional) | When given tries to connect. Creates a SQLite per default |
195
- | `POSTGRES_PASSWORD` (optional) | Required if `POSTGRES_HOST` is given |
196
- | `POSTGRES_PORT` (optional) | Required if `POSTGRES_HOST` is given |
197
- | `POSTGRES_USER` (optional) | Required if `POSTGRES_HOST` is given |
198
- | `POSTGRES_DB` (optional) | Required if `POSTGRES_HOST` is given |
199
- | `SMTP_HOST` (required) | E-Mail provider, e.g. `smtp.example.de` |
200
- | `SMTP_USER` (required) | E.g. `[email protected] ` |
201
- | `SMTP_PASSWORD` (required) | The password to log into the SMTP Server |
202
- | `SMTP_PORT` (required) | Mostly `465` |
203
- | `FROM_ADDRESS` (required) | Address from which mails are send, e.g. `[email protected] ` |
54
+ | ` LOG_LEVEL ` | Default is ` Info ` . Set to ` Debug ` for more information |
55
+ | ` ENV ` | Set to ` Production ` on deployment |
56
+ | ` ENABLE_TRACING ` | Generate a random 64 characters long string for password security |
57
+ | ` ADMIN_USER ` | Default is
` [email protected] ` . Generated on initial startup
|
58
+ | ` POSTGRES_HOST ` | When given tries to connect. Creates a SQLite per default |
59
+ | ` POSTGRES_PASSWORD ` | Required if ` POSTGRES_HOST ` is given |
60
+ | ` POSTGRES_PORT ` | Required if ` POSTGRES_HOST ` is given |
61
+ | ` POSTGRES_USER ` | Required if ` POSTGRES_HOST ` is given |
62
+ | ` POSTGRES_DB ` | Required if ` POSTGRES_HOST ` is given |
204
63
205
64
## contributions
206
65
1 . [ create an issue] ( https://github.com/FachschaftMathPhysInfo/pepp/issues/new )
0 commit comments