This project is a web application for a medical cannabis reseller, featuring both a React frontend and a Django backend.
The project is divided into two main parts:
- Frontend (React + TypeScript + Vite)
- Backend (Django + REST Framework)
The frontend is built using React with TypeScript and Vite as the build tool. It's located in the src/frontend
directory.
Key features:
- React components for product display and navigation
- Tailwind CSS and Material UI for styling
- API integration with the backend using Axios
The backend is built using Django and Django REST Framework. It's located in the src/backend
directory.
Key features:
- Django models for products, countries, and product features
- REST API endpoints for fetching product data
- MySQL database integration
-
Navigate to the frontend directory:
cd src/frontend
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
The frontend will be available at http://localhost:5173
.
-
Navigate to the backend directory:
cd src/backend
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Set up the database:
python manage.py migrate
-
Run the development server:
python manage.py runserver
The backend API will be available at http://localhost:8000
.
Make sure to set up the following environment variables for the backend:
SECRET_KEY
: Django secret keyDEBUG
: Set to 'True' for development, 'False' for productionALLOWED_HOSTS
: Comma-separated list of allowed hostsDB_NAME
: Database nameDB_USER
: Database userDB_PASSWORD
: Database passwordDB_HOST
: Database hostDB_PORT
: Database port
This project is licensed under the MIT License - see the LICENSE.md file for details.