|
1 | 1 | # Codam's Custom Coalition System |
2 | 2 |
|
3 | | -A work in progress. |
| 3 | +The Codam Coalition System is a web application that manages student-coalition competition at Codam Coding College, part of the 42 Network. Students are sorted into teams (coalitions) and compete for points earned through their academic activity — projects, evaluations, logtime, events, and more. Points are awarded automatically via Intra webhooks and synchronized back to Intra. |
4 | 4 |
|
5 | | -## To-do list |
| 5 | +It is a replacement for 42's existing coalition system, intending to make it more fair, engaging, and transparent for students while giving staff more control and flexibility in how the competition is structured. |
6 | 6 |
|
7 | | -### Deployment |
8 | | -- [x] Finalize containerization |
9 | | -- [x] Switch to containerized postgres database |
| 7 | +## Features |
10 | 8 |
|
11 | | -### Questionnaire |
12 | | -- [x] Code questionnaire |
13 | | -- [x] Code questionnaire results |
14 | | -- [x] Only make questionnaire available between specific dates set by admin |
15 | | -- [x] Allow users without an assigned coalition to always fill in the questionnaire |
| 9 | +- **Sorting Hat quiz** — students answer a weighted questionnaire to get placed into a coalition |
| 10 | +- **Points system** — automatic point awards for projects, exams, evaluations, logtime, and event organization |
| 11 | +- **Coalition leaderboard** — coalitions compete based on the mean score of their active contributors |
| 12 | +- **Individual rankings** — cross-coalition leaderboards measuring specific engagement types |
| 13 | +- **Titles** — top-ranked students receive titles that appear on their Intra profile |
| 14 | +- **Season history** — frozen snapshots of final standings at the end of each season |
| 15 | +- **Canvas displays** — server-rendered 1920×1080 PNG images with real-time colorful data for campus screens |
| 16 | +- **Admin interface for staff** — point management, quiz editor, webhook tools, and more |
16 | 17 |
|
17 | | -### Points system & tournament |
18 | | -- [x] Implement Codam's new point system |
19 | | -- [x] Improve Codam's new point system (add custom project point system, rip out Intra's) |
20 | | -- [x] Set up automated points system using Intra webhooks |
21 | | -- [x] Implement Intra's bloc season system |
22 | | -- [x] Implement a way of assigning bonus points to top ranking students in seasons |
| 18 | +## Documentation |
23 | 19 |
|
24 | | -### Student interface |
25 | | -- [x] Create basic dashboard |
26 | | -- [x] Create basic graphs |
27 | | -- [x] Create various rankings |
28 | | -- [x] Create season history overview with historical wins |
| 20 | +Full documentation is in the [`docs/`](docs/) folder: |
29 | 21 |
|
30 | | -### Admin / staff interface |
31 | | -- [x] Create dashboard |
32 | | -- [x] Create interface for editing the questionnaire |
33 | | -- [x] Create interface to manually trigger webhooks (manually re-assign automated points) |
34 | | -- [x] Create interface to fetch potentially missed webhooks between specific dates |
35 | | -- [x] Create point history interface where admin can delete, recalculate and synchronize points with Intra |
36 | | -- [x] Create interface to edit automated point system |
37 | | -- [x] Implement method to recalculate already given points |
38 | | -- [x] Create interface for manually assigning custom points |
39 | | -- [x] Create interface for manually assigning points for organizing events |
| 22 | +| Section | Description | |
| 23 | +|---------|-------------| |
| 24 | +| [Architecture](docs/architecture.md) | Tech stack, directory structure, and database schema | |
| 25 | +| [Configuration](docs/configuration.md) | Environment variables and Docker setup | |
| 26 | +| [Development](docs/development.md) | Local setup, npm scripts, and dev utilities | |
| 27 | +| [Features](docs/features/coalitions.md) | Coalitions, scoring, quiz, rankings, titles, charts, canvas | |
| 28 | +| [Intra Sync](docs/sync/overview.md) | How and when data is synchronized with Intra | |
| 29 | +| [Webhooks](docs/sync/webhooks.md) | Webhook event handlers and the catchup tool | |
| 30 | +| [Admin Interface](docs/admin/overview.md) | Admin routes and tools | |
40 | 31 |
|
41 | | -### Intra connection (API & Webhooks) |
42 | | -- [x] Implement a way of synchronizing points with Intra |
43 | | -- [x] Implement a way of averaging out the points on Intra |
44 | | -- [ ] Implement a way of syncing existing Intra points including historical ones |
45 | | -- [ ] Find a way of blocking Intra's coalitions_user creation |
46 | | -- [x] Implement granting titles for top #1 of each ranking at the end of each season |
47 | | -- [x] Re-implement old [coalition rank titles system](https://github.com/codam-coding-college/coalition-ranks) |
| 32 | +## Quick Start |
48 | 33 |
|
49 | | -If you're a student and want to contribute to this project, talk to the staff about it first to figure out what is possible and discuss implementation ideas. |
| 34 | +See [docs/development.md](docs/development.md) for full setup instructions. In brief: |
50 | 35 |
|
51 | | -## Development |
52 | | -1. Clone the repository |
53 | | -2. Fill the `.env` file with the necessary environment variables (don't forget to change the POSTGRES_HOST in the PRISMA_DB_URL variable to localhost) |
54 | | -3. Run `npm install` to install dependencies |
55 | | -4. Run `npm run build` to build the project |
56 | | -5. Start the PostgreSQL database using Docker: `docker-compose -f docker-compose.dev.yml up -d` |
57 | | -6. Run `npm run start` to start the server and seed the initial database |
58 | | -7. Optional: |
59 | | - - run `node build/dev/create_quiz_questions.js` to seed the database with initial questionnaire questions |
60 | | - - run `node build/dev/create_rankings.js` to seed the database with initial rankings |
61 | | - - synchronize some data from Intra using the Webhook Catch-up tool in the Admin interface |
| 36 | +```bash |
| 37 | +cp .env.example .env # fill in your Intra API credentials and database settings |
| 38 | +npm install |
| 39 | +docker compose -f docker-compose.dev.yml up -d # start PostgreSQL |
| 40 | +npm run build && npm start |
| 41 | +``` |
62 | 42 |
|
63 | | -### Reseed the database |
64 | | -1. Delete the *.sync-timestamp* file in the root directory |
65 | | -2. Run `npm run build && npm run start` |
| 43 | +The application runs on port 4000. Access it at `http://localhost:4000`. |
66 | 44 |
|
67 | | -### Add initial questionnaire questions |
68 | | -Run `node build/dev/create_quiz_questions.js` after running `npm run build` |
| 45 | +## Contributing |
| 46 | + |
| 47 | +If you are a student and want to contribute, talk to the Codam staff first to discuss what is possible and to align on implementation ideas. |
| 48 | + |
| 49 | +If you are a staff member from another campus and want to set up a similar system, we recommend forking this repository and customizing it to your campus's needs. Feel free to reach out to the Codam staff for guidance on how to adapt the system to your context. |
0 commit comments