Skip to content

ppinklesh/Stantech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Data Analysis and Reporting System

Overview

This Django-based web application provides a platform for analyzing e-commerce product data and generating comprehensive reports. It includes features for data aggregation, user authentication using JWT tokens, and dynamic CSV report generation.

Features

  • Data Analysis:

    • Calculate total revenue, top-selling products, and quantities sold by category.
    • Utilizes Django ORM for efficient data retrieval and aggregation.
  • Reporting:

    • Generate summary reports in CSV format with categories, total revenue, top products, and quantities sold.
    • Download reports directly from the application.
  • User Authentication:

    • Secure login and sign-up system using JWT tokens.
    • Endpoints for user registration (/signup/) and login (/login/).

Setup Instructions

Requirements

  • Python 3.12
  • Django 5.0.6
  • PostgreSQL (or another supported database) in this sqlite3 is used
  • Git (optional, for cloning the repository)

Installation

  1. Clone the Repository

    git clone https://github.com/ppinklesh/Stantech.git
    cd ecommerce
  2. Setup Python Virtual Environment

    Create and activate a virtual environment:

    python -m venv venv
    # Windows
    venv\Scripts\activate
    # Linux/macOS
    source venv/bin/activate
  3. Install Dependencies

    Install required Python packages:

    pip install -r requirements.txt
  4. Database Configuration

    Configure database settings in ecommerce/settings.py:

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql',
            'NAME': 'your_database_name',
            'USER': 'your_database_user',
            'PASSWORD': 'your_database_password',
            'HOST': 'localhost',
            'PORT': '5432',
        }
    }
  5. Run Migrations

    Apply initial database migrations:

    python manage.py migrate
  6. Start the Development Server

    Launch the Django development server:

    python manage.py runserver

    Access the application at http://localhost:8000/.

Admin Interface

  • Django provides a built-in admin interface for managing database records:

    python manage.py createsuperuser
  • Access the admin interface at http://localhost:8000/admin/ to manage users, products, and other data.

Upload csv file

  • To upload .csv file for product data. follow below command:

  • Make sure the format of csv should be correct. fields should be 'product_name', 'category', 'price', 'quantity_sold', 'rating', 'review_count'

    python manage.py upload_data products.csv

Usage

  • Navigate to /summary_report_csv/ to download the CSV summary report.
  • Navigate to /summary_report/ to display summary report.
  • Use /signup/ and /login/ endpoints for user registration and authentication.

About

Python, django, ecommerce, SQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published