Skip to content

SA-K1B/Django_Grocery_recommendation

Repository files navigation

🚀 Grocery Recommendation System

A system that recommends groceries by identifying related products based on user input and preferences.

Check it out live : grocerypicks.onrender.com

📌 Project Highlights

  • Product Recommendation: Developed a machine learning model using Apriori algorithm to suggest products based on customers' purchase histories.

  • API Development with Django: Built an API with Django, enabling smooth integration and user-friendly access to the recommendation system.

  • Unit Testing & Linting: Implemented unit tests to validate functionality and used Flake8 for effective code linting.

  • Containerized Application: Containerized the application using Docker to ensure consistent deployment and performance across multiple environments.

  • Automated CI/CD Pipeline: Configured GitHub Actions to automate the integration and deployment processes to maintain code quality and project integrity.

  • Efficient Deployment Configuration: Deployed using Gunicorn for performance and Whitenoise for efficient static file handling.

  • Live on Render: Successfully deployed the application on Render for easy access and scalability.

🔧 Tech Stack

  • Python
  • Django
  • Docker
  • GitHub Actions
  • HTML
  • CSS
  • Render

⚡🧠️ Machine Learning Model Link

github.com/SA-K1B/Grocery_recommendation_model

⚙️ Installation with Docker

  1. Clone the repo
    git clone https://github.com/SA-K1B/Django_Grocery_recommendation.git
  2. Build Image
    docker compose up --build

⚙️ Installation without Docker

  1. Set up a virtual environment

    python -m venv myenv
  2. Activate the virtual environment

    On macOS/Linux

    source myenv/bin/activate

    On windows

    myenv\Scripts\activate
  3. Upgrade pip

     python -m pip install --upgrade pip
  4. Install the required packages

    pip install -r requirements.txt
  5. Run database migration

    python manage.py migrate
    
  6. Collect static files

    python manage.py collectstatic --noinput
  7. Run the development server

    python manage.py runserver

Now, a HTTP server will start up, listening on port 8000. You will see the app running at https://localhost:8000.

🔄 CI/CD Workflow

  • Every push triggers automated unit tests to validate functionality.

  • Flake8 performs code linting to ensure coding standards.

  • The application is built into a Docker container for consistent deployment and pushed to Docker Hub.

  • The application is hosted on Render, deployed from Docker Hub.

WhiteNoise: Serving Static Files Efficiently

WhiteNoise

A Python package for serving static files directly from web application. While Django includes built-in support for handling static files, it's mainly designed for development purposes and is not optimal for use in production environments.

Gunicorn: Efficient Application Server

Gunicorn

Gunicorn is a WSGI compliant web server for Python Applications that receives requests sent to the Web Server from a Client and forwards them onto the Python applications or Web Frameworks.

About

A product recommendation system using the Apriori algorithm. Built with Django, Dockerized, and set up with CI/CD via GitHub Actions for automatic updates and deployment on Render.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors