You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-9
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Developing web applications can be a challenging process, especially when dealin
14
14
- Development Best Practices: We apply code formatting, type checking, and static analysis tools to ensure that the code is readable, robust, and reliable.
2.[Run the project using Docker containers and forcing build containers](#run-the-project-using-docker-containers-and-forcing-build-containers)
19
19
3.[Run project using Docker containers](#run-project-using-docker-containers)
20
20
4.[Setup database with initial data](#setup-database-with-initial-data)
@@ -36,10 +36,72 @@ Developing web applications can be a challenging process, especially when dealin
36
36
20.[TODO List](#todo-list)
37
37
21.[License](#license)
38
38
39
+
# Prerequisites
40
+
39
41
## Set environment variables
40
42
41
43
Create an **.env** file on root folder and copy the content from **.env.example**. Feel free to change it according to your own configuration.
42
44
45
+
## Docker engine
46
+
This project utilizes Docker and Docker Compose, so please ensure that you have installed the latest version compatible with your operating system. If you haven't already installed Docker, you can find detailed instructions on how to do so [here](https://docs.docker.com/engine/install/). Docker desktop can be good for a dev computer.
47
+
48
+
You can check if it is installed with this command
49
+
```
50
+
docker --version
51
+
```
52
+
53
+
## Make
54
+
"Make" is a build automation tool that is primarily used to manage the compilation and building of software projects. It reads a file called a "Makefile" which specifies a set of rules and dependencies for building a project, and then executes the necessary commands to build the project according to those rules. Depending of your OS you will requiere to install it in different ways.
55
+
56
+
Mac
57
+
```
58
+
xcode-select --install
59
+
```
60
+
61
+
Ubuntu
62
+
```
63
+
sudo apt-get install build-essential
64
+
sudo apt-get -y install make
65
+
```
66
+
67
+
You can check if it is installed with this command
68
+
```
69
+
make --version
70
+
```
71
+
72
+
## Python ">3.9,<3.12"
73
+
If you haven't already installed Python. You can download and install python from [here](https://www.python.org/downloads/).
74
+
75
+
You can check yu python version:
76
+
```
77
+
python --version
78
+
```
79
+
80
+
## Poetry
81
+
82
+
Python Poetry is a tool for dependency management and packaging in Python. It provides a modern and efficient approach to managing Python projects' dependencies, virtual environments, and packaging. You can find detailed instructions on how install it [here](https://python-poetry.org/docs/#installing-with-the-official-installer). Poetry manages packages in **pyproject.toml** file; In this project you can find it in the folder backend/app.
83
+
84
+
You can check if it is installed with this command
85
+
```
86
+
poetry --version
87
+
```
88
+
89
+
### Dev tip to activate virtual environment
90
+
When you are opening python files do this cna help you to vscode detect installed packages.
91
+
92
+
```
93
+
cd backend/app/
94
+
poetry shell
95
+
```
96
+
97
+
After that you can show the interpreted path. You can copy that path and set as the default for the project in vscode. Press on **Enter interpreter path ..** and past path.
98
+
99
+
<palign="center">
100
+
<imgsrc="static/python_int.png"align="center"/>
101
+
</p>
102
+
103
+
104
+
43
105
## Run the project using Docker containers and forcing build containers
44
106
45
107
*Using docker compose command*
@@ -92,12 +154,7 @@ You can connect to the Database using pgAdmin4 and use the credentials from .env
92
154
make run-pgadmin
93
155
```
94
156
95
-
*Load server configuration (It is required just the first time)*
96
-
```sh
97
-
make load-server-pgadmin
98
-
```
99
-
100
-
This starts pgamin in [http://localhost:15432](http://localhost:15432).
157
+
This starts pgamin in [http://localhost:15432](http://localhost:15432). When connecting to db server introduce the password by default it is **postgres** if you didn't change it in .env file.
101
158
102
159
<palign="center">
103
160
<imgsrc="static/tables.png"align="center"/>
@@ -298,13 +355,13 @@ make mypy
298
355
```
299
356
300
357
## Basic chatbot example with Langchain and OpenAI
301
-
In addition to its core features, this project template demonstrates how to integrate an basic chatbot powered by Langchain and OpenAI through websockets.
358
+
In addition to its core features, this project template demonstrates how to integrate an basic chatbot powered by Langchain and OpenAI through websockets. You can use [PieSocket Websocket Tester](https://chromewebstore.google.com/detail/oilioclnckkoijghdniegedkbocfpnip) to test websockets.
302
359
303
360
To begin experimenting with the basic chatbot, follow these steps:
304
361
305
362
1.**Obtain an OpenAI API Key**: You'll need to set the `OPENAI_API_KEY` environment variable, which you can obtain from [OpenAI's platform](https://platform.openai.com/).
306
363
307
-
2.**Test Websocket Connection**: You can test the websocket connection by using the following URL: [ws://fastapi.localhost/chat/\<USER_ID\>](ws://fastapi.localhost/chat/<USER_ID>). Replace `<USER_ID>` with a user identifier of your choice.
364
+
2.**Test Websocket Connection**: You can test the websocket connection by using the following URL: [ws://fastapi.localhost/chat/\<USER_ID\>](ws://fastapi.localhost/chat/<USER_ID>). Replace `<USER_ID>` with a user identifier of your choice. It should be the ID of your user.
308
365
309
366
3.**Sending and Receiving Messages**: You should be able to send messages to the chatbot using the provided websocket connection. To do this, use the following message structure:
310
367
@@ -313,6 +370,9 @@ To begin experimenting with the basic chatbot, follow these steps:
313
370
```
314
371
Once you send a message, the chatbot will respond with generated responses based on the content of your input.
0 commit comments