- Overview
- Key Features
- Technology Stack
- Project Structure
- Prerequisites
- Getting Started
- Development Environment Setup
- Running the Application
- Admin Access
- Testing
- Deployment
- License
PriceCheck is a Django-based web application designed to help users compare prices of grocery products across different supermarket chains in New Zealand. The project aims to provide a user-friendly interface for customers to find the best deals and manage their shopping preferences. This project is based off and inspired by https://www.grocer.nz and is a price comparison site for New Zealand. Which takes data from the New Zealand grocer website and allows users to compare prices and products across different stores based on the users chosen product and preferred stores and their location. The data is scrapped from the grocer store websites. The project is still in development and is not yet fully functional. The target is to have a fully functional web application that allows users to compare prices and manage their shopping preferences in a user-friendly user interface and a safe and secure environment.
-
Product Comparison: Users can search and view products from various supermarkets, comparing prices and details.
-
User Authentication: The application supports user registration, login, and logout functionalities.
-
Store Preferences: Users can select and manage their preferred supermarket stores.
-
Shopping Cart: Authenticated users can add products to their cart and manage quantities.
-
Favorite Products: Users can mark products as favorites for quick access.
-
Price History Tracking: The application stores historical price data for products.
-
Admin Interface: A Django admin interface is available for managing products, stores, and user data.
-
User Profiles: Each user has a profile with additional information.
-
Order Management: The system supports creating and managing orders.
-
Backend: Django (Python web framework)
-
Database: MySQL
-
Frontend: HTML, CSS (Tailwind CSS for styling)
-
JavaScript: Used for dynamic frontend interactions
-
Authentication: Django's built-in authentication system
-
Additional Libraries:
- django-tailwind for integrating Tailwind CSS
- Pillow for image handling
- python-dotenv for environment variable management
-
Python (3.x recommended)
-
pip (Python package manager)
-
Django (Python web framework)
-
MySQL (Database)
-
HTML, CSS, JavaScript (Frontend)
-
Django's built-in authentication system
-
Pillow for image handling
-
python-dotenv for environment variable management
The PriceCheck project follows a typical Django structure:
PriceCheck/
: Main project directorysettings.py
: Project settings and configurationurls.py
: Main URL routing
super/
: Main application directorymodels.py
: Database models (SupermarketChain, Store, Product, PriceHistory, Profile, UserStorePreference, FavoriteProduct, CartItem, Order, OrderItem)views.py
: View functions/classes for handling requestsurls.py
: URL routing for the super appadmin.py
: Admin interface configurationstemplates/
: HTML templatesstatic/
: Static files (CSS, JavaScript, images)
mytheme/
: Tailwind CSS configurationstatic_src/
: Source files for Tailwind CSSstatic/
: Compiled Tailwind CSS output
manage.py
: Django's command-line utility for administrative tasksrequirements.txt
: List of project dependencies
-
Product Listing and Search: Users can view a list of products, search by name, and filter by category and price.
-
Store Preference Management: Users can select their preferred stores, which are displayed on their dashboard.
-
Shopping Cart: Functionality to add, remove, and update quantities of products in the cart.
-
User Dashboard: Displays user's store preferences and favorite products.
-
Price History Tracking: Stores historical price data for products.
-
User Profile Management: Users can manage their profiles with additional information.
-
Order Processing: Users can create and manage orders.
-
Supermarket Chain and Store Management: Admin can manage supermarket chains and individual stores.
-
Favorite Products: Users can mark and manage their favorite products.
- The project uses environment variables for sensitive information like database credentials.
- It includes configurations for both development and production environments.
- Static files are managed using Django's static file handling, with additional setup for Tailwind CSS.
Based on the current structure, potential areas for enhancement could include:
- Implementing a more robust search and filtering system.
- Implementing a mobile app version for easier access on-the-go.
- Python (3.x recommended)
- pip (Python package manager)
-
Clone the repository:
git clone https://github.com/gracemorganmaxwell/server_side_scripting_IT6006 cd PriceCheck
-
Create a virtual environment:
- Windows:
python -m venv venv
- macOS/Linux:
python3 -m venv venv
- Windows:
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install required packages:
- Windows:
pip install -r requirements.txt
- macOS/Linux:
pip3 install -r requirements.txt
- Windows:
-
Set up environment variables:
- Create a file named
.env
in the project root directory (same level asmanage.py
). - Add the following content to the
.env
file, replacing the values with your actual database information:DB_NAME=your_database_name DB_USER=your_database_user DB_PASSWORD=your_database_password DB_HOST=your_database_host DB_PORT=your_database_port
- Add
.env
to your.gitignore
file to prevent sensitive information from being committed.
- Create a file named
-
Run database migrations:
- Windows:
python manage.py migrate
- macOS/Linux:
python3 manage.py migrate
- Windows:
-
Create a superuser:
- Windows:
python manage.py createsuperuser
- macOS/Linux:
python3 manage.py createsuperuser
- Windows:
-
Start the development server:
- Windows:
python manage.py runserver
- macOS/Linux:
python3 manage.py runserver
- Windows:
-
Access the application at
http://127.0.0.1:8000/
To access the Django admin interface:
- Ensure the server is running
- Visit
http://127.0.0.1:8000/admin/
- Log in with the superuser credentials created in step 7
When deploying the application, ensure that you set the environment variables in your production environment.
Copyright (c) 2024 grace-morganmaxwell
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.