gainz/ is the backend source code. Building by fastAPI and python For test and code review, please follow below instruction.
-
Install MongoDB, Python, Docker, and related dependencies.
-
Install Python modules. Please view gainz/pyproject.toml.
-
As this is using poetry for virtual environment development, please make sure the modules/dependencies are installed under poetry.
poetry show
can show a list.poetry install
will update the modulespoetry add
[individual modules] -
Copy .env-example in gainz/ to .env. And fill up JWT_SECRET and OPENAI_API_KEY. Either inform [email protected] to get the key, or you create your own.
-
Make sure MongoDB, Docker, Python are up and running. For mongoDB, please stay admin with no password. Then:
cd /gainz/gainz
poetry run python -m gainz
-
Make sure your API url is http://127.0.0.1:8000/api/ As the frontend API Url is hard-code. Otherwise, please change in react manually. (See frontend section)
-
Most of the code are under gainz/gainz/web/api/monitoring/
react_websocket/my-websocket-app is the frontend source code. Building by React and Typescript I havn't test for dist/ built. So, please test both fronend and backend LOCALLY.
-
Node and NPM install in machine (I have just tested in Mac, my Node is 20.x, Apple M1 chipset)
cd react_websocket/my-websocket-app
npm install
-
Make sure your backend is work properly in LOCAL.
npm start
-
Your testing URL generally, is http://localhost:3000/ But may vary in different machine.
-
In frontend, at the first time, you have to register a user for testing.
-
Click "Register", and type your email and password, you account should generally be created instantly. Then use your email and password, you can login and chat with AI.
-
Please use Desktop with chrome browser. The width is no less than 800px, suggested using fullscreen for testing.