Setup Development on Linux Environment (Ubuntu)
Run the following commands:
- sudo apt-get update
- sudo apt-get upgrade
- sudo apt-get install libpq-dev
- sudo apt-get install postgresql postgresql-contrib
- sudo -i -u postgres
- psql
- CREATE DATABASE factory_pure_poc;
- ALTER USER postgres WITH PASSWORD 'password found in .env';
- pip install -r requirements.txt
- Place .env file under "ecommerce_poc/ecommerce_poc/.env"
- Ensure you are on "main" branch
- From root directory: python -m venv venv
- source venv/bin/activate
- One directory level above root directory: sudo chmod -R 777 ecommerce-poc
- python manage.py createsuperuser
- python manage.py migrate
- python manage.py (for all scripts that set up test data for all products (in the actual PostgreSQL db), stripe products, and stripe prices)
- python manage.py (add features, manuals and docs, overview, and specifications to existing products)
- curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor | sudo tee /usr/share/keyrings/stripe.gpg
- echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" | sudo tee -a /etc/apt/sources.list.d/stripe.list
- sudo apt update
- sudo apt install stripe
- stripe login
- stripe listen --forward-to http://localhost:8000/send_receipt/
- python manage.py runserver 0.0.0.0:8000
- Find eth0 ip from command "ifconfig" then from host machine you can connect
oAuth Integration:
- Under: venv/lib/python3.10/site-packages/social_core/backends/auth0.py, you will need to remove the line: email: "payload["email"]" from the Auth0OAuth2 Class's return statement.
TODO/TOADD:
- Full oAuth integration
- SSO integration
- Headless CMS
- Kubernetes integration
- Write Unit Tests
- Write Integration Tests
- Build out CICD Pipeline
- Multiple service integration, where syncing between systems is needed
- Modularize code, breaking down functions into smaller functions
- Modularize project structure to have a Django application serve one purpose, i.e., an application for OAuth integration
- Integrate JIRA to track project work and create custom automations and integrations around feature/bugfix/release work, as well as enforce branch naming conventions for workflows.
Bugfixes/Enhancements
Auth0:
- ecommerce/views.py ---> need to properly use user_info = oauth.auth0.parse_id_token(request, token) to grab the user_info in the token because it not only destructures the user info but verifies that the expected Identity Provider signed the JWT