Merge branch 'readme_revision' into '1DEVT'
readme_revision See merge request !8
Showing
1 changed file
with
22 additions
and
13 deletions
| 1 | # ChatGPT Server | 1 | # ChatGPT AI-Pro Installation |
| 2 | 2 | ||
| 3 | ## Installation | 3 | ## Setting up local development |
| 4 | 4 | ||
| 5 | npm install on the root directory. | 5 | ### Set up ENV Variables |
| 6 | 1. Set up environment variable `.env` file in root and inside */client* folder. In root, duplicate the `env-template` file and rename it to `.env`. Inside the */client* folder, create `.env` file | ||
| 7 | 2. In the root `.env` file, define the needed OpenAI environment variables in your application. | ||
| 6 | 8 | ||
| 7 | ## Create ENV Variables | 9 | * Sign up here [https://beta.openai.com/signup](https://beta.openai.com/signup). You can use your Google or Microsoft account to sign up if you don't want to create using an email/password combination. You may need a valid mobile number to verify your account. |
| 10 | * Now, visit your OpenAI key page [https://beta.openai.com/account/api-keys](https://beta.openai.com/account/api-keys) | ||
| 11 | * Create a new key by clicking the "Create new secret key" button. | ||
| 8 | 12 | ||
| 9 | Create an .env file in the root directory of your application. | 13 | 3. You can Values should be a string, enclosed with ``""`` Example : |
| 10 | Duplicate the env-template and rename to .env | ||
| 11 | In the .env file, define the environment variables you want to use in your application. ex. | ||
| 12 | 14 | ||
| 13 | API_KEY="sk-xxxxxxxx" | 15 | ``` |
| 14 | API_ORG="org-xxxxxxx" | 16 | OPENAI_API_KEY=“sk-xxxxxxx” |
| 15 | SERVER_URL="http://localhost:3080/" | 17 | OPENAI_API_ORG=“org-xxxxxxxx” |
| 18 | ``` | ||
| 16 | 19 | ||
| 17 | ## Run server | 20 | 4. In the `.env` file of the client, define the SERVER_URL environment variable in your application. |
| 21 | 5. Name the variable starting with **REACT_APP_** and Value must **not** enclosed with commas `""` Example : | ||
| 18 | 22 | ||
| 19 | Run server on the root directory | 23 | ``` |
| 24 | REACT_APP_SERVER_URL=http://localhost:3080/ | ||
| 25 | ``` | ||
| 20 | 26 | ||
| 21 | `node index.js` | 27 | ### NPM Install and Run Application |
| 28 | **Note:** Prepare 2 Terminals. | ||
| 29 | 1. On the first terminal, run `npm install` on **root**. After that run `node index.js` | ||
| 30 | 2. On the second terminal, run `npm install` inside the **/client**. Then run `npm run start` | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment