All Projects → sparcs-kaist → new-ara-api

sparcs-kaist / new-ara-api

Licence: MIT license
KAIST Community Ara Renewal Project - KAIST official BBS

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to new-ara-api

drf-registration
Simple user registration package based on Django Rest Framework. DRF Registration - The easy way to generate registration RESTful APIs
Stars: ✭ 32 (+113.33%)
Mutual labels:  drf
django-project-template
一个django的工程模板,为了快速启动一个工程进行开发
Stars: ✭ 15 (+0%)
Mutual labels:  drf
drf-chat-server-example
A chat server example used Django REST framework with pytest
Stars: ✭ 15 (+0%)
Mutual labels:  drf
ara-web
Stateless web client for the ARA Records Ansible API.
Stars: ✭ 38 (+153.33%)
Mutual labels:  ara
Ara-Server
The server for Ara.
Stars: ✭ 17 (+13.33%)
Mutual labels:  ara
drf-angular-docker-tutorial
Dockerized Django Back-end API using DRF with Angular Front-end Tutorial
Stars: ✭ 53 (+253.33%)
Mutual labels:  drf
django-rest-framework-recaptcha
reCAPTCHA field for Django REST framework serializers
Stars: ✭ 24 (+60%)
Mutual labels:  drf
django-rest-multitokenauth
An extension to Django-Rest-Frameworks Token Authentication, enabling a user to have multiple authorization tokens
Stars: ✭ 13 (-13.33%)
Mutual labels:  drf
django-experience
Tutorial Django Experience 2022
Stars: ✭ 173 (+1053.33%)
Mutual labels:  drf
surveySystem
问卷调查系统
Stars: ✭ 74 (+393.33%)
Mutual labels:  drf
python-django-drf-boilerplate
Django Boilerplate for starting fresh new DRF projects
Stars: ✭ 59 (+293.33%)
Mutual labels:  drf
django-ninja-extra
Django Ninja Extra - Class-Based Utility and more for Django Ninja(Fast Django REST framework)
Stars: ✭ 53 (+253.33%)
Mutual labels:  drf
DjangoStarter
基于Django定制的快速Web开发模板,功能包括:Docker-Compose部署,缓存,业务代码生成器,接口限流,DjangoAdmin验证码,登录次数尝试,屏蔽了RestFramework默认的API主页等
Stars: ✭ 28 (+86.67%)
Mutual labels:  drf
django-rest-framework-datatables-editor
Seamless integration between Django REST framework, Datatables and Datatables Editor.
Stars: ✭ 25 (+66.67%)
Mutual labels:  drf
Ara-android
A virtual assistant for almost any android phone.
Stars: ✭ 71 (+373.33%)
Mutual labels:  ara
ara
The PULP Ara is a 64-bit Vector Unit, compatible with the RISC-V Vector Extension Version 0.10, working as a coprocessor to CORE-V's CVA6 core
Stars: ✭ 116 (+673.33%)
Mutual labels:  ara
JUCE ARA
The JUCE cross-platform C++ framework, augmented with support for the Celemony ARA API
Stars: ✭ 32 (+113.33%)
Mutual labels:  ara
sparcssso
Single Sign On System for SPARCS
Stars: ✭ 15 (+0%)
Mutual labels:  sparcs

SPARCS NewAra API




Logo

Restful API for NewAra @ SPARCS
KAIST 공식 학내 커뮤니티
Go to ARA

Management Information

  • Issue tracking: Notion
  • Credentials: S3 sparcs-credentials
  • Communication: Slack
    • general: #new-ara
    • backend: #new-ara-backend
    • fontend: #new-ara-frontend
    • github commits: #new-ara-noti
    • sentry alerts: #new-ara-sentry
    • notion changes: #new-ara-notion
    • with OB: #ara
  • Contact: [email protected]


Project Setup

Create & Activate Virtual Environment

$ python3 -m venv env  # should be python 3.8
$ source env/bin/activate

Install Requirements

$ pip install poetry
$ poetry install # in production - $ poetry install --no-dev

For macOS, you may need to install openssl & mysqlclient and set LDFLAGS=-L/usr/local/opt/openssl/lib before installing requirements. Only tested for macOS Mojave. See link.

Fill Environment Configuration

Refer to .env.example file and write your own .env file with required informations filled-in. For SPARCS SSO, create a test service or ask SYSOP to deploy production server.

For the test service in SPARCS SSO for local settings, fill in as below.

After this, you should make the information in the .env file as environment variables for local run. (In development or porduction server, we do not use .env file. Rather, we use environment variables in docker-compose.yml file.)

To make the make the information in the .env file as environment variables for local run, you can export each manually, or you can use the below command. Check the Makefile's env command and revise it. The command is written assuming you are using ~/.bashrc. You might want to revise it to ~/.bash_profile or ~/.zshrc according to your settings.

$ make env

❤️ Useful Commands❤️

Most useful commands are already written in the Makefile. Refer to the Makefile and try to understand and use them.

Create and Migrate Database

$ make init

Collect static files

$ python manage.py collectstatic

collectstatic command collects all static files required to run installed apps to selected storage - for this project, static S3 bucket. You should open public access for the static bucket to get appropriate response.

Internationalization (i18n)

xgettext is required in order to generate translation files. Detailed background on this can be found on Django's documentations. To generate translation files, run:

$ make i18n_generate

Translation files are generated under ara/locale/(Locale name)/LC_MESSAGES. After writing translations, run the following command to apply the translations.

$ make i18n_compile

Create log directory

$ sudo mkdir -p /var/log/newara
$ sudo chown $(whoami) /var/log/newara

Run lightweight server for development

$ make run

0 is abbreviation for 0.0.0.0 which refers to 'listening to every incoming hosts'. Do not deploy with runserver command - use WSGI. This command is only for development.


Deployment with Docker

docker-compose.yml

docker-compose.yml file is managed in S3 sparcs-newara bucket docker-compose directory. For simple local deployment, refer to docker-compose.example.yml file and fill in the information needed.

For development server, two docker containsers are up with the docker-compose file. Using AWS RDS for mysql, elastiCache for redis.

  • api container (used gunicorn for serving. celery-beat also here.)
  • celery-worker container

docker image

For managing docker images, we are using AWS ECR, newara repository.

  • Using tag newara:dev for development server.

other docker related files

  • Dockerfile: We use virtual environment also inside the docker container.
  • .docker/run.sh: api container's entrypoint.
  • .docker/run-celery.sh: celery worker container's entrypoint.
  • .docker/supervisor-app.conf
  • .docker/supervisor-celery-worker.conf


Project Stack

Interpreter

  • Python 3.7
  • poetry is used as package manager
    • When adding libraries to the virtual environment, you should not use pip. Rather, use poetry add command. Refer to this link for poetry commands.

Framework

  • Django 3.2.4
  • djangorestframework 3.12.4

Database

  • MySQL (default)
  • mysqlclient 2.0
  • django-mysql 3.2

Works with MySQL for Linux & macOS, not tested in Windows. Timezone is automatically adjusted. It is strongly recommended to set default charset of database or MySQL server to utf8mb4.

Storage

  • AWS S3
  • django-s3-storage 0.12

Two buckets are used - one for storing static files, one for media files that users upload. Go to django-s3-storage documentation for required permissions.

Authentication

  • SPARCS SSO v2 API
  • djangorestframework SessionAuthentication

API Documentation

  • drf-yasg 1.17

Contributors

See contributors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].