A containerized web shopping platform developed As the Main project for COSC 310
- Kithe Kisia
- Coran McColm
- Fraser Muller
- Harrison Kayihura
The system is fully containerized and requires Docker Desktop to run. Follow these steps to set up and run the application.
- Docker Desktop installed on your system
- Git installed on your system
- Terminal or command prompt access
Step 1: Clone the Repository
git clone https://github.com/KitheK/Netflix-and-Coding.git
cd Netflix-and-CodingStep 2: Checkout Main Branch
The main branch is checked out by default, but you can verify with:
git checkout mainStep 3: Build and Start the Application
This command will build and start both the frontend and backend containers:
docker compose up --buildStep 4: Stopping the Application
To shut down the system:
docker compose downA complete list of required packages and libraries is available in requirements.txt.
If you prefer to run the application outside of Docker, we recommend using a virtual environment to avoid package conflicts:
pip3 install -r requirements.txtNote: Instructions for initializing a virtual environment vary by operating system and are outside the scope of this documentation.
- Email: admin@example.com
- Password: AdminPass1
- Email: testing@ubc.ca
- Password: testingtesting1
You can switch between user accounts using the login/logout feature. When logged out, there is no option to add items to the cart.
The system uses JSON files for data storage. All read and write operations include built-in duplicate checks and safety validations.
Use the built-in functions provided by the system to create or remove database entries.
If you need to manually edit the JSON files, follow these guidelines:
- The database uses a HashMap/Dictionary structure
- Each file uses a key (either product code or user code) that maps to related data entries
- The key serves as an umbrella for all associated data
- Review the file structure carefully before making manual changes to understand the specific schema
The system integrates two external APIs:
Endpoint: https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1/currencies/{base_currency_lower}.json
Implementation:
- Configured in external service files (
external_service,external_router) - Retrieves the most recent exchange rates
- Converts prices from native Rupees to target currencies
- Supported currencies: GBP, CAD, EUR, USD
Workflow:
- API call retrieves current exchange rate
- Price conversion function applies the rate to calculate local prices
Purpose: Automatically refreshes product images to avoid Amazon's native image expiry.
Implementation:
- Service Layer:
image_scraper_servicehandles the scraping logic - API Endpoint:
admin_router.post(requires administrator permissions)
Functionality:
- Creates a mimicked request to Amazon using product links from the database
- Extracts the URL of the landing page image
- Updates the database with the new image URL
- Requires admin permissions to request image refreshes for all products
Workflow:
- Scraper retrieves product link from database
- Mimics request to Amazon product page
- Extracts current image URL
- Updates database with refreshed image link
GitHub: https://github.com/KitheK/Netflix-and-Coding
For issues or questions, please refer to the repository's issue tracker or contact the development team.