/shopily

Primary LanguageCSS

shopily

This e-commerce platform is a web application that allows users to browse products, add them to their cart, and make purchases. In addition to these standard e-commerce capabilities, this webapp includes a blog section with articles, guides, and news about our products and related topics.

Features

  • Product Catalogue: A wide range of products categorized for easy navigation.
  • Search and Filter: Search and filter options to help users find their desired products.
  • User Authentication: Secure signup/login processes for a personalized shopping experience.
  • Shopping Cart: A user-friendly cart for managing selected products before purchase.
  • Checkout System: An integrated checkout system with multiple payment options.
  • Blog Section: A dedicated section for articles, guides, and news to engage users and provide value beyond shopping.

Libraries

  • pillow - required since image field is used in the product model.
  • celery - for sending email asynchronously when order is created.
  • flower - for monitoring asynchronous task instead of using rabbitmq management ui.
  • stripe - for processing payment.
  • python-dotenv - for loading configuration.
  • weasyprint - for generating order invoice pdf.
  • redis - stores products for frequently bought together feature.
  • easy-thumbnails - for rendering thumbnails.
  • django-taggit - for working with blog tags.
  • psycopg2-binary - PostgreSQL adapter.
  • django-extensions - this extension also includes the installation of:
    • werkzeug - which is required by RunServerPlus extension of Django extensions.
    • pyOpenSSL - which is required to use SSL/TLS functionality of RunServerPlus.
  • django-allauth - for social authentication(login with google).
  • django-rosetta - interface for translations.
  • django-parler - for translating models.
  • django-localflavor - for country specific localization format.

Note

In case you want to try out or clone this project, you need to carry out the steps below.

  • Run the requirements.txt file to install the packages. you can run this file using the command pip install -r requirements.txt if you are not using a virtual environment or python -m pip install -r requirements.txt if you are using one.

  • This project uses postgresql so you need to install postgresql if you haven't already installed it.

  • redis is also required since it is used to store recommended products.

  • Remember to run the migrations. This can be done by using the command python manage.py migrate.

  • Celery requires a message broker. You can check this part of the documentation on how to install and run it.

  • Add .env file at the root of the project. The root of the project is the folder that contains files like manage.py, .gitignore and etc.

    • Add the stripe configuration.

      • STRIPE_PUBLISHABLE_KEY="your stripe publishable key"
      • STRIPE_SECRET_KEY="your stripe secret key"
      • STRIPE_API_VERSION="your api version"
      • STRIPE_WEBHOOK_SECRET="your webhook secret"

      To get the above values, you can follow the steps below:

      1. Visit stripe.
      2. Create an app. This can be located at the left top corner.
      3. Access the developers page.
      4. You can find the api version on this page.
      5. Checkout the API keys tab for api keys.
      6. Visit webhooks for the stripe webhook secret.

      After getting these values set each variable in the .env file.

    • Along with the stripe configurations, you also need these:

      These for redis configuration.

      • REDIS_HOST= "your redis host"
      • REDIS_PORT= "your redis port"
      • REDIS_DB= "your redis DB name"

      These for DB configuration(postgres)

      • DB_NAME= "your postgres database name"
      • DB_USERNAME= "your postgres database username"
      • DB_PASSWORD= "your postgres database password"
      • DB_HOST= "your postgres host"
      • DB_PORT= "your postgres port"

      In case you want to check out social authentication with google, switch to the social-auth branch. These configurations will be needed for the google social authentication to work.

      • GOOGLE_CLIENT_ID = "your google client id"
      • GOOGLE_SECRET = "your google secret"
      • GOOGLE_KEY = "your google key"

      You can check these pages on how to get them.

  • With your message broker running, Run celery with the command celery -A myshop worker -l info. You also have to run the stripe webhook for the stripe webhook to automatically update order status. This can be done using the command stripe listen --forward-to [your webhook path]. For this project, the stripe webhooks will be forwarded to localhost:8000/payment/webhook/ that is stripe listen --forward-to localhost:8000/payment/webhook/. Then you can run the django project. So in all four things must be running, your chosen message broker, celery, stripe webhook and the django project.

  • You can check this page on stripe for test cards when you get to the payment page.