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
* Added go server
* Added readme for go server
* Fixed documentation and read me of go files
* Updated readme for go server
* Updated documentation of json.go
* Updated formatting of license in go files
* Added cors middleware handler to go server
* Fixed readme for go server
* Update README.md
Added manual go installation instructions
* Update README.md
Added link for manual Go installation
* Update README.md to skip to manual install for Go
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Updated documentation of main.go
The client for this app is written using [React](https://react.dev/) and served using [Vite](https://github.com/vitejs/vite).
34
36
35
37
### Backend
36
-
The app currently has 2 different backend servers that the user can choose from, [Flask](https://flask.palletsprojects.com/en/3.0.x/quickstart/) and [Node.js](https://Node.js.org/en).
38
+
The app currently has 3 different backend servers that the user can choose from, [Flask](https://flask.palletsprojects.com/en/3.0.x/quickstart/), [Node.js](https://Node.js.org/en) or [Go](https://go.dev)
37
39
38
40
## API documentation
39
41
### Endpoints available
@@ -90,8 +92,8 @@ This is the <b>streaming</b> POST method route. Use this to send the chat messag
90
92
## Installation
91
93
Click [here](#windows) to skip to installation on Windows.
92
94
93
-
For Linux/macOS a setup bash script is available for easy installation. If you prefer installing manually you can skip to [next section](#install-manuallylinuxmacoswindows).
94
-
### Using bash script(Linux/macOS)
95
+
If your choice of backend is Node.js or Flask, for Linux/macOS a setup bash script is available for easy installation. The bash script does not support installation of Go. If you wish to use Go as your backend or prefer installing manually, you can skip to the[next section](#install-manuallylinuxmacoswindows).
96
+
### Using bash script for Node.js/Flask on Linux/macOS
95
97
#### Make the script executable
96
98
```
97
99
chmod +x setup.sh
@@ -167,6 +169,14 @@ You can quickly install the required packages using the `package.json` file.
167
169
pip install -r requirements.txt
168
170
```
169
171
172
+
#### Go installation
173
+
174
+
Check if Go is already installed on your system.
175
+
```
176
+
go version
177
+
```
178
+
If Go is not installed, follow the instructions for your operating system from the [official Go installation guide](https://go.dev/doc/install).
179
+
170
180
## Run the app
171
181
To launch the app you have to perform the following steps:
172
182
1. Run React client
@@ -238,6 +248,22 @@ python app.py
238
248
```
239
249
The server will start on `localhost:9000`.
240
250
251
+
##### Configure and run Go backend
252
+
###### Configuration
253
+
You need a Gemini API key to run the server,
254
+
255
+
If you don't have a Gemini API key ready, you can create a key with one click in [Google AI Studio](https://aistudio.google.com/app/apikey).
256
+
You must set the API key as an environment variable while running the application.
257
+
258
+
###### Running the Application
259
+
1. Navigate to the app directory, `server-go` (i.e. where main.go is located).
260
+
2. Run the application with the following command.
261
+
```
262
+
GOOGLE_API_KEY=<your_api_key> go run .
263
+
```
264
+
The server will start on `localhost:9000`.
265
+
By default, the server starts on port 9000. You can override the default port the server listens on by setting the environment variable `PORT` in the command above.
266
+
241
267
## Usage
242
268
To start using the app, visit [http://localhost:3000](http://localhost:3000/)
0 commit comments