{"id":19272286,"url":"https://github.com/sdslabs/studyportal-nexus","last_synced_at":"2025-04-21T22:31:21.824Z","repository":{"id":44705725,"uuid":"181582465","full_name":"sdslabs/studyportal-nexus","owner":"sdslabs","description":"Backend API for studyportal","archived":false,"fork":false,"pushed_at":"2023-01-28T03:23:32.000Z","size":467,"stargazers_count":25,"open_issues_count":5,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-01T16:12:32.525Z","etag":null,"topics":["backend-api","django-rest-framework","elasticesearch","google-drive-api-v3","notifications","python3","redis"],"latest_commit_sha":null,"homepage":"https://www.getpostman.com/collections/cda07b4a8bff6f33a99a","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdslabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-15T23:59:21.000Z","updated_at":"2025-01-02T08:27:02.000Z","dependencies_parsed_at":"2023-02-15T14:16:16.883Z","dependency_job_id":null,"html_url":"https://github.com/sdslabs/studyportal-nexus","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fstudyportal-nexus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fstudyportal-nexus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fstudyportal-nexus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdslabs%2Fstudyportal-nexus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdslabs","download_url":"https://codeload.github.com/sdslabs/studyportal-nexus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250143901,"owners_count":21382109,"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":["backend-api","django-rest-framework","elasticesearch","google-drive-api-v3","notifications","python3","redis"],"created_at":"2024-11-09T20:36:11.496Z","updated_at":"2025-04-21T22:31:21.234Z","avatar_url":"https://github.com/sdslabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Study Portal\n\n# About\n\nThis is the backend API repository for Study Portal intended to be used by Study Portal React Web App and the mobile app.\n\n# Prerequisites\n\n1. Install [PostgreSQL service](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04).\n1. Obtain a credentials.json from the author/generate one yourself and place it in `studyportal/drive`.\n1. Create a `.env` file from `.env.sample` and change the fields as appropriate.\n\n## Optional Prerequisites:\n\u003e These are required to get the auth running for development setup.\n\n1. Setup Arceus and Falcon locally or get a remote instance for development/testing.\n1. Register study as an app in Arceus and make changes to `.env`.\n\nIf you want to skip these steps you can just add a cookie in the browser with the following description:\n```bash\nkey: token,\nvalue: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImRhcmtyaWRlciIsImVtYWlsIjoiZGFya3JpZGVyMjUxMDk5QGdtYWlsLmNvbSJ9.xBwh-abNBZTlxWDRjEs33DN2AjXlf21JkSwlez6dvGM\n```\n\n# Setup Instructions\n\nEnsure that you have installed [Docker](https://docs.docker.com/install/) (with [Docker Compose](https://docs.docker.com/compose/install/) ) and that the [Docker daemon is running](https://docs.docker.com/config/daemon/).\n\n1. Clone the repository\n\n```bash\ngit clone git@github.com:sdslabs/studyportal-nexus.git\n```\n\n2. Setup and start docker containers\n\n```bash\ndocker-compose -f docker-compose-dev.yml up\n```\n\nAfter executing `docker-compose -f docker-compose-dev.yml up`, you will be running:\n\n* A Django API server\n* PostgreSQL instance(serves as the application database)\n* Elasticsearch instance\n* Redis server\n\nOnce everything has initialized, with `docker-compose` still running in the background, load the sample data. You will need to install PostgreSQL client tools to perform this step. On Debian, the package is called `postgresql-client-common`.\n\n```bash\n./ingest.sh\n```\n\nYou are now ready to start sending the API server requests. Hit the API with a request to make sure it is working:\n`curl localhost:8005/api/v1/departments`\n\n# Diagnosing local Elasticsearch issues\n\nIf the API server container failed to start, there's a good chance that Elasticsearch failed to start on your machine. Ensure that you have allocated enough memory to Docker applications, otherwise the container will instantly exit with an error. Also, if the logs mention \"insufficient max map count\", increase the number of open files allowed on your system. For most Linux machines, you can fix this by adding the following line to `/etc/sysctl.conf`:\n\n```bash\nvm.max_map_count = 262144\n```\n\nTo make this setting take effect, run:\n\n```bash\nsudo sysctl -p\n```\n\n# Alternate Setup Instructions\n\nYou can setup the local dev in a virtualenv:\n\n1. Create a virtualenv using your preferred method.\n* Using virtualenv\n\n```bash\nvirtualenv -p python3 venv\nsource venv/bin/activate\n```\n\n* Using virtualenvwrapper\n\n```bash\nmkvirtualenv studyportal\nworkon studyportal\n```\n\n2. Install packages in virtual environment.\n\n```bash\npip install -r requirements.txt\n```\n\n3. Edit the `.env` file.\n\n```bash\nDATABASE_HOST=localhost\nELASTICSEARCH_HOST=localhost\nREDIS_HOST=localhost\n```\n\n4. Initialize the database and create elasticsearch index\n\n```bash\npython manage.py makemigrations\npython manage.py migrate\npython manage.py search_index --rebuild -f\n```\n\n5. Create Django admin user\n\n```bash\npython manage.py createsuperuser\n```\n\n6. Run development server\n\n```bash\npython manage.py runserver 0.0.0.0:8005\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdslabs%2Fstudyportal-nexus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdslabs%2Fstudyportal-nexus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdslabs%2Fstudyportal-nexus/lists"}