Skip to content

Commit

Permalink
update doco and .env.example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Leong committed Sep 29, 2023
1 parent 9084fdb commit dc44136
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
28 changes: 16 additions & 12 deletions docs/3-run-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ Clone this repository locally or fork to your Github account. Run all of the the

- **History Database**: If you didn't [provision the Azure resources](2-provision-azure-resources.md), you **must** at least deploy an instance of Cosmos DB in your Azure Subscription to store chat history.

- **Identity Provider**: Follow the [instructions](3-run-locally.md) to add one.
- **Identity Provider**: For local development, you have the option of using a username / password. If you prefer to use an Identity Provider, follow the [instructions](3-run-locally.md) to add one.

## Steps

1. Change directory to the `src` folder
2. Create a new file named `.env.local` to store the environment variables add the following variables.

> **Note**
> Do not use double-quotes and do not delete any of the variables.
> **Note**
> Make sure that `NEXTAUTH_URL=http://localhost:3000` has no comments in the same line.
3. <details><summary>Set the following environmnet variables</summary>
2. Copy the file `.env.example` and rename it to `.env.local`.
3. Populate the environment variables in this file.
<details><summary>Environment Variables (ref src/.env.example)</summary>

```bash
# Set your environment details
# NOTES:
# - Do not use double-quotes and do not delete any of the variables.
# - Make sure that NEXTAUTH_URL=http://localhost:3000 has no comments in the same line.

# Update your Azure OpenAI details
# AZURE_OPENAI_API_INSTANCE_NAME should be just the name of azure openai resource and not the full url;
# AZURE_OPENAI_API_DEPLOYMENT_NAME should be deployment name from your azure openai studio and not the model name.
# AZURE_OPENAI_API_VERSION should be Supported versions checkout docs https://learn.microsoft.com/en-us/azure/ai-services/openai/reference
Expand Down Expand Up @@ -71,7 +69,13 @@ Clone this repository locally or fork to your Github account. Run all of the the
5. Start the app by running `npm run dev`
6. Access the app on [http://localhost:3000](http://localhost:3000)

You should now be prompted to login with your chosen OAuth provider. Once successfully logged in, you can start creating new conversations.
You should now be prompted to login with your chosen OAuth provider.
> NOTE: If using Basic Auth (DEV ONLY) any username you enter will create a new user id (hash of username@localhost). You can use this to simulate multiple users.

![Chat Login (DEV)](/images/chat-login-dev.png)


Once successfully logged in, you can start creating new conversations.

![Chat Home](/images/chat-home.png)
![Chat history](/images/chat-history.png)
Expand Down
Binary file added images/chat-login-dev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion src/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# NOTES:
# - Do not use double-quotes and do not delete any of the variables.
# - Make sure that NEXTAUTH_URL=http://localhost:3000 has no comments in the same line.

# Update your Azure OpenAI details
# AZURE_OPENAI_API_INSTANCE_NAME should be just the name of azure openai resource and not the full url;
# AZURE_OPENAI_API_DEPLOYMENT_NAME should be deployment name from your azure openai studio and not the model name.
Expand All @@ -11,7 +15,7 @@ AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=
# Update your admin email addresses - comma separated
ADMIN_EMAIL_ADDRESS="[email protected],[email protected]"

# You must have atleast one of the following auth providers configured
# Identity provider is optional if you are running in development mode locally (npm run dev)
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=

Expand Down

0 comments on commit dc44136

Please sign in to comment.