This Django application provides a comprehensive API for comparing nutritional values of food products, aiding users in making informed dietary decisions.
This API empowers developers to integrate nutritional comparison functionality into various applications, enabling users to search for food items, explore nutritional categories, view detailed product information, and ultimately make health-conscious dietary choices. It simplifies the process of comparing nutritional values across different food items, enhancing the user's experience with meal planning and supporting them in achieving their nutritional goals.
Note
Frontend part: https://github.com/FCTL3314/StoreTracker-Frontend
- RESTful API
- Domain Driven Design
- CI/CD
- Comments reply / Tree structure (Django MPTT)
- Custom objects ordering (Like Drag & Drop sort)
- Celery / Postponed Tasks
- Email Verification
- JWT Authentication / Authorization
- Code Documentation
- Tests (PyTest)
- Project services are divided into 2 levels:
- Domain - Services that are in no way dependent on the current infrastructure, that is, the framework.
- Infrastructure - Services that can call domain services and interact with the project infrastructure.
- EV - EmailVerification
-
Create a nginx.conf file in the docker/production/nginx/conf.d/ directory and fill it with the code below:
upstream core { server django-gunicorn:8000; } server { listen 80; server_name example.com www.example.com; server_tokens off; client_max_body_size 20M; location = /favicon.ico { access_log off; log_not_found off; } location /static/ { alias /opt/HealthNutrition-Backend/static/; } location /media/ { alias /opt/HealthNutrition-Backend/media/; } location /.well-known/acme-challenge/ { root /var/www/certbot/; } location / { proxy_pass http://core; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_redirect off; } }
Change example.com and www.example.com to your domains.
- Generate ssh keys in your local computer:
ssh-keygen -t rsa -b 4096 -C "[email protected]"
- Copy the content of your private and public keys to clipboard:
- Linux: Copy the result of commands:
cat ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
- Windows: Copy the contents of the files:
C:/users/user/.ssh/id_rsa
C:/users/user/.ssh/id_rsa.pub
- Linux: Copy the result of commands:
- Create GitHub repository secrets:
- SSH_HOST: Your remote server host / IP.
- SSH_LOGIN: Your remote server login / username.
- SSH_PORT: Your remote server port.
- SSH_PRIVATE_KEY: Copied SSH private key.
- Access your remote host and add your public key there:
- Execute
nano ~/.ssh/authorized_keys
and paste your copied public key to the next line.
- Execute