Demo Video: https://youtu.be/jTz1iEvyECA
This project is structured into three main folders: frontend, backend, and server. Each folder contains a different part of the application, and all three components need to be running simultaneously for the project to function correctly. Below are the instructions to set up and run each part of the project.
- frontend: Contains the frontend code for the project.
- backend: Contains the backend code for the project.
- server: Contains the Flask servers (both
bigram_server.pyandflask_server.py).
Before running the project, ensure you have the following installed:
- Node.js and npm (for frontend and backend)
- Python and pip (for Flask servers)
- Conda (for managing Python environments)
- Git (for cloning repositories)
-
Navigate to the
frontendfolder:cd frontend -
Install the required dependencies:
npm install
-
Run the frontend development server:
npm run dev
The frontend should now be running on a local development server (usually
http://localhost:3000).
-
Navigate to the
backendfolder:cd backend -
Install the required dependencies:
npm install
-
Run the backend development server:
npm run dev
The backend should now be running on a local development server (usually
http://localhost:5000).
-
Navigate to the
serverfolder:cd server -
Clone the MaleX repository:
git clone https://github.com/Mayachitra-Inc/MaleX.git
-
navigate to the yml directory with the environment config
cd yml -
Create and activate the Conda environment for the
mainserver using themain.ymlfile in the root directory:conda env create -f main_linux.yml conda activate anaware_flask_server
-
Create and activate the Conda environment for the
malexserver using themalex.ymlfile in the root directory:conda env create -f malex_linux.yml conda activate anaware_bigram_server
-
navigate to the yml directory with the environment config
cd yml -
Create and activate the Conda environment for the
mainserver using themain.ymlfile in the root directory:conda env create -f main_windows.yml conda activate anaware_flask_server
-
Create and activate the Conda environment for the
malexserver using themalex.ymlfile in the root directory:conda env create -f malex_windows.yml conda activate anaware_bigram_server
-
Running the
mainserver (flask_server.py):- Ensure the
mainenvironment is activated. - Run the server:
python flask_server.py
- Note the port on which this server is running (e.g.,
http://localhost:5001).
- Ensure the
-
Running the
malexserver (bigram_server.py):- Ensure the
malexenvironment is activated. - Run the server:
python bigram_server.py
- Note the port on which this server is running (e.g.,
http://localhost:5002).
- Ensure the
- Open the
backend/index.tsfile. - Locate line number 25 where the
FLASK_ENDPOINTvariable is defined. - Update the
FLASK_ENDPOINTvariable with the URL of themainserver (e.g.,http://localhost:5001).
- Ensure all three servers (frontend, backend, and Flask servers) are running.
- The frontend must run on http://localhost:5173.
- The backend must run on http://localhost:8787.
- The project should now be fully functional.
- Port Conflicts: If any of the servers fail to start due to port conflicts, ensure that the ports are free or update the port numbers in the respective server files.
- Environment Issues: If you encounter issues with the Conda environments, try recreating them using the provided
.ymlfiles. - Dependency Issues: If
npm installorpip installfails, ensure that you have the correct versions of Node.js, npm, Python, and pip installed.
Once all the components are set up and running, you should have a fully functional project with a frontend, backend, and Flask servers working together. If you encounter any issues, refer to the troubleshooting section or consult the documentation for the respective technologies used in this project.
Happy coding! 🚀