Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sebiweise committed Nov 22, 2023
1 parent c0160c4 commit ad08e40
Show file tree
Hide file tree
Showing 424 changed files with 440 additions and 429 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
node_modules
.pnp
.pnp.js

# testing
/coverage
/test-results
coverage
test-results

# next.js
.next/
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="./packages/unsaged/public/icon-256.svg" alt="unSAGED logo" width="200px">
<img src="./apps/unsaged/public/icon-256.svg" alt="unSAGED logo" width="200px">
</p>

[![Join our Discord](https://discordapp.com/api/guilds/1124558062171209771/widget.png?style=banner2)](https://discord.gg/rMH2acSEzq)
Expand Down Expand Up @@ -59,8 +59,8 @@ Follow the installation instructions in the [Getting Started](https://unsaged.co

## 🚀 Upgrading unSAGED

* On November 13th, 2023, we released a major update to unSAGED, which introduced more settings to the conversation. It requires that you update some database table columns. If you are upgrading from a version of unSAGED released before this date, you will need to run the [Upgrade Script](./packages/unsaged/db/UpgradeScript.sql) in the [Supabase SQL editor](https://app.supabase.com/project/_/sql).
* On November 16th, 2023, we released a major update to unSAGED, which converts this repo into monorepo to support the documentation website. It requires that you change a setting in your Vercel project, if you have one. If you do have one, you need to set `packages/unsaged` as the [Root Directory](https://vercel.com/docs/deployments/configure-a-build#root-directory) in your Vercel project's settings.
* On November 13th, 2023, we released a major update to unSAGED, which introduced more settings to the conversation. It requires that you update some database table columns. If you are upgrading from a version of unSAGED released before this date, you will need to run the [Upgrade Script](./apps/unsaged/db/UpgradeScript.sql) in the [Supabase SQL editor](https://app.supabase.com/project/_/sql).
* On November 16th, 2023, we released a major update to unSAGED, which converts this repo into monorepo to support the documentation website. It requires that you change a setting in your Vercel project, if you have one. If you do have one, you need to set `apps/unsaged` as the [Root Directory](https://vercel.com/docs/deployments/configure-a-build#root-directory) in your Vercel project's settings.

## 📝 License

Expand All @@ -74,13 +74,13 @@ We welcome contributions to the unSAGED project! If you're interested in contrib

## 📸 Screenshots

![Screenshot-1](./packages/unsaged/public/screenshots/screenshot-1.png)
![Screenshot-1](./apps/unsaged/public/screenshots/screenshot-1.png)

![Screenshot-2](./packages/unsaged/public/screenshots/screenshot-2.png)
![Screenshot-2](./apps/unsaged/public/screenshots/screenshot-2.png)

![Screenshot-4](./packages/unsaged/public/screenshots/screenshot-4.png)
![Screenshot-4](./apps/unsaged/public/screenshots/screenshot-4.png)

![Screenshot-5](./packages/unsaged/public/screenshots/screenshot-5.png)
![Screenshot-5](./apps/unsaged/public/screenshots/screenshot-5.png)

## 📚 Built With

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 7

To give everyone using your instance of unSAGED access to Anthropic models like Claude 2, set the following environment variables:

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
ANTHROPIC_API_KEY=your_anthropic_api_key
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To give everyone using your instance of unSAGED access to OpenAI models hosted o

## Global Access Configuration

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
OPENAI_API_URL=the_url_of_your_azure_api
OPENAI_API_KEY=your_api_key
OPENAI_API_TYPE=azure
Expand Down
11 changes: 11 additions & 0 deletions apps/docs/docs/configuration/how-it-works.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
sidebar_position: 1
---

# How it Works

To make it easy to configure unSAGED, we use environment variables as the main configuration format. This allows anyone deploying unSAGED to Vercel to easily configure their instance of unSAGED without having to modify the source code.

When building locally, use `apps/unsaged/.env.local` to set your environment variables. When deploying to Vercel, use the Vercel dashboard to set your environment variables.

Also, set `apps/unsaged` as the [Root Directory](https://vercel.com/docs/deployments/configure-a-build#root-directory) in your Vercel project's settings.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To give everyone using your instance of unSAGED access to self hosted models lik
Use `127.0.0.1` instead of `localhost` if you are running locally.
:::

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
OLLAMA_HOST="http://127.0.0.1:11434"
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 5

To give everyone using your instance of unSAGED access to OpenAI models like GPT-4, set the following environment variables:

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
OPENAI_API_KEY=your_openai_api_key
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 8

To give everyone using your instance of unSAGED access to Google's PaLM 2 models like Bard, set the following environment variables:

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
PALM_API_KEY=your_palm_api_key
```

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git clone https://github.com/jorge-menjivar/unSAGED.git

## Generate Supabase Tables

Run the [Generation Script](https://github.com/jorge-menjivar/unSAGED/packages/unsaged/db/GenerationScript.sql) in the [Supabase SQL editor](https://app.supabase.com/project/_/sql).
Run the [Generation Script](https://github.com/jorge-menjivar/unSAGED/apps/unsaged/db/GenerationScript.sql) in the [Supabase SQL editor](https://app.supabase.com/project/_/sql).

This will do the following:

Expand All @@ -29,18 +29,18 @@ More information [here](https://authjs.dev/reference/adapter/supabase#expose-the

Then copy the output and save it for the next step.

## Switch to the `packages/unsaged` directory
## Switch to the `apps/unsaged` directory

The `packages/unsaged` directory contains the unSAGED app. All following commands should be run from this directory.
The `apps/unsaged` directory contains the unSAGED app. All following commands should be run from this directory.

```sh
cd packages/unsaged
cd apps/unsaged
```

## Set Environment Variables

The `.env.local` file is the main configuration file for unSAGED. It should be located in the `packages/unsaged` directory of the project.
Create the `packages/unsaged/.env.local` file to set your environment variables.
The `.env.local` file is the main configuration file for unSAGED. It should be located in the `apps/unsaged` directory of the project.
Create the `apps/unsaged/.env.local` file to set your environment variables.

### Set Auth Secret

Expand All @@ -52,15 +52,15 @@ openssl rand -base64 32

Set the `NEXTAUTH_SECRET` environment variable to the secret you just created.

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
NEXTAUTH_SECRET=my_secret
```

See [Auth.js Documentation](https://next-auth.js.org/configuration/options#nextauth_secret) for more information.

### Set Supabase Variables

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
NEXT_PUBLIC_SUPABASE_URL="https://xxxxxxxxxxxxxxxx.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY=supabase_anon_key
SUPABASE_JWT_SECRET=supabase_jwt_secret
Expand Down Expand Up @@ -96,6 +96,6 @@ To run in production, you will need to set the following environment variable.

See [Auth.js Documentation](https://next-auth.js.org/configuration/options#nextauth_url) for more information.

```sh title="packages/unsaged/.env.local"
```sh title="apps/unsaged/.env.local"
NEXTAUTH_URL=https://yourdomain.com
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions apps/unsaged/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: ["custom"],
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions packages/unsaged/package.json → apps/unsaged/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "next dev",
"build": "next build",
"start": "next start",
Expand Down Expand Up @@ -73,14 +74,14 @@
"@vitest/coverage-c8": "^0.29.8",
"autoprefixer": "^10.4.16",
"endent": "^2.1.0",
"eslint": "8.36.0",
"eslint-config-next": "^13.5.6",
"eslint-config-custom": "workspace:*",
"jsdom": "^21.1.2",
"postcss": "^8.4.31",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.2.8",
"supabase": "^1.112.0",
"tailwindcss": "^3.3.5",
"tsconfig": "workspace:*",
"vitest": "^0.29.8"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ad08e40

Please sign in to comment.