{"id":26214726,"url":"https://github.com/webkom/admissions","last_synced_at":"2025-07-19T22:05:02.023Z","repository":{"id":32070448,"uuid":"124935827","full_name":"webkom/admissions","owner":"webkom","description":"👥 Admission system for Abakus","archived":false,"fork":false,"pushed_at":"2025-04-30T12:52:02.000Z","size":6272,"stargazers_count":6,"open_issues_count":28,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-30T13:48:42.729Z","etag":null,"topics":["django","react","styled-components"],"latest_commit_sha":null,"homepage":"https://opptak.abakus.no","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webkom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-12T18:49:23.000Z","updated_at":"2025-04-30T12:52:05.000Z","dependencies_parsed_at":"2023-01-14T20:31:10.976Z","dependency_job_id":"85834db3-1959-4521-a86b-87409cba586a","html_url":"https://github.com/webkom/admissions","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/webkom/admissions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fadmissions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fadmissions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fadmissions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fadmissions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webkom","download_url":"https://codeload.github.com/webkom/admissions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fadmissions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266026271,"owners_count":23866033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","react","styled-components"],"created_at":"2025-03-12T10:18:15.579Z","updated_at":"2025-07-19T22:05:01.220Z","avatar_url":"https://github.com/webkom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# admissions\n\nRecruitment for [Abakus](https://abakus.no/).\n\n**Table of contents**\n\n- [Environments](#environments)\n- [Local development](#local-development)\n- [Creating admissions](#creating-admissions)\n- [Permissions](#permissions)\n- [Run tests](#run-tests)\n- [Code style](#code-style)\n\n\u0026nbsp;\n\n## Environments\n\n### Production\n\n[opptak.abakus.no](https://opptak.abakus.no/)  \nOAuth through [abakus.no](https://abakus.no/)\n\n### Staging\n\n[opptak-staging.abakus.no](https://opptak-staging.abakus.no/)  \nOAuth through [abakus.no](https://abakus.no/)\n\n\u0026nbsp;\n\n## Local development\n\n### Prerequisites\n\nTo run this project, you need\n\n1. python 3.12\n2. Docker OR a `postgresql` database\n3. [poetry](https://python-poetry.org/) ([installation guide](https://python-poetry.org/docs/#installation))\n4. Node and yarn\n\n### Running the project\n\n\u003e When working in development you want to have LEGO running (both frontend and backend). This allows you to create an OAuth2 application from the settings menu in the webapp.\n\nTo do this, you need a total of **4 terminals** (or shells if you like).\n\n### Terminal 1\n\nRun LEGO by following the README [here](https://github.com/webkom/lego#readme).\n\n### Terminal 2\n\nRun LEGO-WEBAPP by following the README [here](https://github.com/webkom/lego-webapp#readme).\n\n### Terminal 3\n\nInstall the projects dependencies with\n\n```sh\n$ poetry install\n```\n\nThis command will also create a virtual environment in which the dependencies are installed, if one has not already been created and activated.\n\nThen, run the following command\n\n```sh\n$ make dev_settings\n```\n\nThe [`docker-compose.yml`](./docker-compose.yml) file provides a `postgresql` database. This uses a different port than LEGO, so you can run it in parallel as follows.\n\n```sh\n$ docker-compose up -d\n```\n\n#### Secrets\n\nThe `.env` file with secret keys is not included, but an [`example.env`](./admissions/settings/example.env) file has been provided in `./admissions/settings`, so that you can simply rename the file and fill in the values.\n\n`example.env` is setup to connect to an Oauth2 application already configured in LEGO, so if you don't need anything special you are good to go with that one.\n\nIf you want to configure another one, go to the OAuth2 tab in the user settings [menu](http://localhost:3000/users/me/settings/oauth2) in the running dev version of lego-webapp. Open or create an application, and enter the values you find into your .env file. If you are creating a new OAuth2 application, enter `http://127.0.0.1:5000/complete/lego/` as the redirect url.\n\n```sh\n# Create a copy of the example env file (run from the root of the project)\n$ cp admissions/settings/example.env admissions/settings/.env\n\n# Edit the file and change the KEY and SECRET\nAUTH_LEGO_KEY=\"Client ID from OAuth2\"\nAUTH_LEGO_SECRET=\"Client Secret from OAuth2\"\nAUTH_LEGO_API_URL=\"http://localhost:8000/\"\n```\n\nAfter creating and configuring your ./admissions/settings/.env file you are ready to migrate the database and run the server.\n\n```sh\n# Migrate the database migrations\n$ poetry run python manage.py migrate\n\n# Run the Django server\n$ poetry run python manage.py runserver\n```\n\n\u003e If coding over long periods of time, or you want to flush the database, run `poetry run python manage.py flush` to flush it, and run the server again with `poetry run python manage.py runserver`.\n\n### Terminal 4\n\nIn the last terminal you are ready to start the frontend. The frontend requires `Node`. You simply need to install the requirements and run the dev-server as follows.\n\n```sh\n# Install dependencies\n$ yarn\n\n# Start the dev-server\n$ yarn dev\n```\n\n\u003e Finally, you can go to [127.0.0.1:5000](http://127.0.0.1:5000/) and view the admissions page.\n\n**NB: The project has to be accessed through 127.0.0.1, and NOT localhost.** This is because accessing both LEGO and admissions from the same hostname creates a conflict some session storage, so the login will not work.\n\nTo create an admission, first, open [127.0.0.1:5000](http://127.0.0.1:5000/) and click the \"Logg inn\" button at the bottom of the page to authorize as a user with [permission to create admissions](#permissions). Then, click \"Administrer opptak\" and create an admission. Phew, now you are ready to start developing!\n\n\u0026nbsp;\n\n## Creating admissions\n\n### GUI\n\nThe simplest way to create an admission is through the GUI.\n\n1. Navigate to [127.0.0.1:5000](http://127.0.0.1:5000/)\n2. Log in as a user with permission to create admissions.\n3. Click \"Administrer opptak\" at the bottom of the screen\n4. Success\n\n### Shell\n\nCurrently when running\n\n```sh\n# Create a custom admission for development\n$ poetry run python manage.py create_admission\n```\n\nyou create an admission connected to all groups, if they exist (they are generated the first time you log in). To connect it to a group, you can either do it through the GUI, or create it in the shell.  \nNote that when creating groups in the shell, you must import the Group model manually, as otherwise it will use the Django Group model instead of our own.\n\n```python\n$ poetry run python manage.py shell_plus\n\u003e from admissions.admissions.models import Group\n\u003e new_group = Group.objects.create(name=\"GroupA\")\n\u003e admission = Admission.objects.get(slug=\"opptak\")\n\u003e admission.groups.add(new_group)\n```\n\n\u0026nbsp;\n\n## Permissions\n\nThe project gives permissions based on group memberships imported from LEGO.\n\n| Model                   | Action        | Requirement                                                                                                               |\n| :---------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------- |\n| Admission               | CREATE        | Either (1) any member of Webkom, (2) leader of Abakus OR (3) leader of RevyStyret. \u003cbr/\u003e (1,2,3) `user.is_staff`          |\n| Admission               | EDIT          | Either (1) member of Webkom OR (2) creator of admission. \u003cbr/\u003e(1) `user.is_member_of_webkom`, (2) `admission.created_by`. |\n| All applications        | VIEW \u0026 DELETE | Member of a group in `admission.admin_groups`                                                                             |\n| Applications to a group | VIEW \u0026 DELETE | Member of a group in `admission.groups` WITH role LEADER or RERUITING                                                     |\n| Group                   | EDIT          | Member of a group in `admission.groups` WITH role LEADER or RERUITING                                                     |\n\n\u0026nbsp;\n\n## Run tests\n\nRun django tests using tox. Note that we point at the admissions database running at :5433 if we are running lego and admissions in parallel\n\n```bash\n$ DATABASE_PORT=5433 poetry run tox -e tests\n```\n\n\u0026nbsp;\n\n## Code style\n\nThis codebase uses the PEP 8 code style. We enforce this with isort, black \u0026 flake8.\nIn addition to the standards outlined in PEP 8, we have a few guidelines\n(see `setup.cfg` for more info):\n\nFormat the code with black \u0026 isort\n\n```bash\n$ make fixme\n```\n\nTo check if it is formatted properly, run:\n\n```bash\n$ DATABASE_PORT=5433 poetry run tox -e isort -e flake8 -e black\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkom%2Fadmissions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebkom%2Fadmissions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkom%2Fadmissions/lists"}