Welcome to my Django-MySQL-React web application! The project's primary aim is to provide an intuitive platform for movie enthusiasts to explore and discover their favorite films. Leveraging the power of Django, MySQL, and React, I crafted a seamless and enjoyable user experience for movie searching and viewing. πππΏ
Before you get started, ensure you have met the following requirements: πβ
- If you will be running the project with docker compose you just have to copy the env file at the root of the django project and follow this docker compose section.
- Knowlegde of React, Typescript, Python, Cypress , Unit Testing, E2E cypress.
- Python, Node.js, Docker
- I already have a MySQL database set up in the cloud with existing movie data. In your Django project, create an .env file at the root and paste the provided environment variables into this file.
To get your project up and running, follow these steps:
git clone https://github.com/oreoluwadnd/HelloMovie
cd HelloMovie
cd Backend/
python -m venv venv # Create a virtual environment
source venv/bin/activate # On Windows, use venv\Scripts\activate
cd helloMovies/
pip install -r requirements.txt # Install required packages
python manage.py migrate # Skip
python manage.py runserver # Run the server
If you be using this method you will have to change the url e2e and utils/constant
API_URL = "http://0.0.0.0:8000/"
---> http://127.0.0.1:8000/
cd Frontend/HelloMovies/
npm install # Install Pakages
npm run dev # start development
a. ποΈBuild the django image
To run the Django container individually, you need update the Dockerfile
COPY Backend/helloMovies/requirements.txt /app
-> COPY /requirements.txt /app
COPY Backend/helloMovies .
-> COPY . .
cd Backend/helloMovies
docker build -t <image-name> . # Build Image
docker run -p 8000:8000 <image-name> # Run the instance
b. ποΈBuild and Run Docker Containers
To run the Django container individually, you need update the Dockerfile
COPY Frontend/HelloMovies/package.json /client/app
-> COPY package.json /client/app
COPY Frontend/HelloMovies/package-lock.json /client/app
-> COPY package-lock.json /client/app
COPY Frontend/HelloMovies /client/app
-> COPY . /client/app
cd Frontend/HelloMovies
docker build -t <image-name> . # Build Image
docker run -p 5173:5173 <image-name>
a. ποΈ Build and Run Docker Containers
docker compose up
You can run tests for the Django back-end using the following commandsπ§ͺπ§βπ¬πΌ
cd /path/to/django/project
python manage.py test
You can run tests for the Django back-end using the following commandsπ§ͺπ§βπ¬π πΏ
cd /path/to/react/app
npm test
You can run tests for the Django back-end using the following commands π§ͺπ§βπ¬
cd Frontend/HelloMovies
npx cypress run