This is a chat application built with React as the frontend and Python FastAPI as the backend. It allows users to communicate in real-time using a chat interface.
- To quickly run the application with the development server, run the following command:
./quick_run.sh
This will automatically start the backend server, install dependencies for the frontend, and start the frontend development server.
Open your web browser and navigate to localhost:3000
to access the application.
Requirements
Both Node.js and MongoDB should be installed on your machine. Ensure that MongoDB is running in the background.
Now install the dependencies:
cd backend_server
pip install -r requirements.txt
Start the backend server. Also, make sure MongoDB is running in the background
python main.py
Open a new terminal window:
cd ..
cd client
yarn
Now start the development server for the frontend:
cd client
yarn start
or you could also build and serve the build:
yarn build
yarn serve build
Done! Now open localhost:3000
in your browser.
- Install Docker:
Install Docker on your machine by following the instructions for your operating system from the official Docker website.
- Build the React app Docker image:
Open a terminal or command prompt and navigate to the root folder of your React application (where the Dockerfile is located).
Run the following command to build the Docker image:
cd client
docker build -t react-app .
- Build the Python API Docker image:
Open a terminal or command prompt and navigate to the root folder of your Python API server (where the second Dockerfile is located).
Run the following command to build the Docker image:
cd ../backend_server
docker build -t python-api .
- Start Minikube:
Install Minikube by following the instructions for your operating system from the official Minikube website.
Open a terminal or command prompt and start Minikube by running the following command:
minikube start
- Apply the Kubernetes configuration:
Open a terminal or command prompt and navigate to the folder where you have the Kubernetes configuration files.
Run the following command to apply the deployments and services:
kubectl apply -f react-app-deployment.yaml
kubectl apply -f python-api-deployment.yaml
kubectl apply -f react-app-service.yaml
kubectl apply -f python-api-service.yaml
- Access the app:
minikube service react-app --url