Skip to content

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.

Notifications You must be signed in to change notification settings

walstanb/Webchat

Repository files navigation

WebChat App

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.

Quick Start with Development Server

  • 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.

Installation Guide to Run Locally

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.

Kubernetes Setup

  1. Install Docker:

Install Docker on your machine by following the instructions for your operating system from the official Docker website.

  1. 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 .
  1. 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 .
  1. 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
  1. 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
  1. Access the app:
minikube service react-app --url

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published