Boarding Pass
Make sure you have docker installed and running Docker: https://www.docker.com/
- React
- Python
- Django
- PostgreSQL
- User - a person in the system who can view or manage keys within an organization depending on their role
- Organization - Many to many relationship with users. A user can belong to many organizations, and an organization can have many users. Organization is the entity that owns device keys.
- Device Key - a key consisting of three parts dev_eui, app_eui, and app_key (app_key is encrypted at rest in database)
- General User - Has view access to keys in an organization
- Organization Staff - Can view & transfer keys within an organization
- Super User - Can view and manage all keys within all organizations
In the project directory, you can run:
- Create environment variable config file
touch ./backend/.env
- Set Up your environment variables in ./backend/.env
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_SCHEMA=
DB_PORT=
FIELD_ENCRYPTION_KEY=
You can either point to the container credentials in docker-compose.yml or a remote database
-
Build the contianers with
docker-compose build
-
Run the contianers with
docker-compose up
-
Apply migrations to database
make migrate
-
Create a super User in django
make createsuperuser
-
Go to
http://127.0.0.1:8000/admin
Login with super user credentials -
Create a user with username and password
-
Review Swagger Documentation
http://127.0.0.1:8000/swagger/
-
Go to
http://127.0.0.1:3000/
and sign in with your credentials
- Create EC2 Instance Ubuntu
- SSH into EC2 Instance https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
- Git clone repository
- Run the following commands
sudo apt update & sudo apt upgrade
sudo apt install python3-pip
python3 -m pip install --upgrade pip
- cd into
boardingpass/backend
- Run
touch .env
Add credentials for
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_SCHEMA=
DB_PORT=
FIELD_ENCRYPTION_KEY=
Note: You may need to spin up an RDS instance or point to remote database
- Run
pip install -r requirements.txt
- Run
manage.py collectstatic
- Run
gunicorn --workers 3 --bind 0.0.0.0:8000 api.wsgi:application
- Update AWS Security group to allow anywhere access to port 8000
- View site at http://<ip_address>:8000/swagger/