Skip to content

Commit

Permalink
revert pr to do a rebase (#23)
Browse files Browse the repository at this point in the history
This reverts commit d6d0a76.
  • Loading branch information
Nyumat authored Nov 4, 2024
1 parent d6d0a76 commit 4511d88
Show file tree
Hide file tree
Showing 21 changed files with 1,358 additions and 3,891 deletions.
30 changes: 0 additions & 30 deletions .env.example

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,4 @@ jobs:
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
PINECONE_INDEX_NAME: ${{ secrets.PINECONE_INDEX_NAME }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
AUTH_GOOGLE_ID: ${{ secrets.AUTH_GOOGLE_ID }}
AUTH_GOOGLE_SECRET: ${{ secrets.AUTH_GOOGLE_SECRET }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_TOKEN_VALUE: ${{ secrets.R2_TOKEN_VALUE }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_URL: ${{ secrets.R2_URL }}
R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }}
R2_TOKEN_NAME: ${{ secrets.R2_TOKEN_NAME }}
run: npm run build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ yarn-debug.log*
yarn-error.log*

# env files (can opt-in for commiting if needed)
.env.local
.env*

# vercel
.vercel
Expand Down
62 changes: 9 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Beavs AI is an application that provides an AI Chatbot that is knowledgeable abo
2. Navigate to the project directory:

```bash
cd beavsai
cd ./beavsai
```

3. Install all the required dependencies to run our Next.js App
Expand All @@ -27,80 +27,36 @@ Beavs AI is an application that provides an AI Chatbot that is knowledgeable abo
> [!NOTE]
> You may come across an peer dependency error when running this command, try `npm install --legacy-peer-deps`
4. Copy the `.env.example` file to `.env.local`:
4. Create an `.env.local` file in the root directory of the project and add the following environment variables:

```bash
cp .env.example .env.local
DATABASE_URL="postgresql://prisma_user:prisma_password@localhost:5432/prisma_db"
AUTH_GOOGLE_ID=
AUTH_GOOGLE_SECRET=
```

5. Message [@nyumat](https://discord.com/users/700444827287945316) on Discord to get the required credentials for the `.env.local` file.
5. Message [@nyumat](https://discord.com/users/700444827287945316) on Discord to get the OAuth credentials for the application.

> [!WARNING]
> Do not share these credentials with anyone else. Additionally, you will not be able to run the application without them.
> Do not share these credentials with anyone else. You will not be able to run the application without them.
6. Create an AUTH_SECRET environment variable

```bash
npx auth secret
```

7. Start a local instance of our PostgreSQL database using [Docker](https://www.docker.com/):
7. Start a local PostgreSQL database using Docker

```bash
docker-compose up -d
docker compose up -d
```

> [!NOTE]
> Doing this in VSCode's terminal may present you with an error like:
> Error: P1010: User `postgres` was denied access on the database `postgres`.
> To fix this, use your system's terminal to run the command.
8. Run the Next.js App
```bash
npm run dev
```

## Scripts

<!-- Yeah this is messy, but please don't modify it! (since it works) If you do, paper-trail on Discord. Thanks! -->

| Script | Description |
| -------------- | ---------------------------------------------------------------------------------------------- |
| `dev` | Runs database generation, migration, and starts the Next.js dev server with Turbopack enabled. |
| `build` | Builds the Next.js application for production. |
| `start` | Starts the Next.js application in production mode. |
| `lint` | Runs ESLint to check for code quality issues. |
| `format` | Formats the codebase with Prettier. |
| `check-format` | Checks code formatting without making changes. |
| `type-check` | Runs TypeScript type checks based on the configuration in `tsconfig.json`. |
| `db:generate` | Generates Prisma client based on schema and `.env.local` configuration. |
| `db:migrate` | Applies migrations for development using `.env.local` configuration. |
| `db:studio` | Opens Prisma Studio for database management. |

## Troubleshooting

If you encounter any issues while running the application, please refer to the following troubleshooting steps:

1. **Database Connection Issues**: If you are unable to connect to the database, ensure that the Docker container is running. You can check the status of the container by running the following command:

```bash
docker ps
```

If the container is not running, you can start it using the following command:

```bash
docker-compose up -d
```

2. **Environment Variables**: Ensure that you have copied the `.env.example` file to `.env.local` and have filled in the required credentials. If you are missing any credentials, please message [@nyumat](https://discord.com/users/700444827287945316) on Discord.

3. **Prisma Client Generation**: If you are encountering issues with the Prisma client, you can regenerate it by running the following command:

```bash
npm run db:generate
```

## Contributors

<a href="https://github.com/osu-app-club/beavsai/graphs/contributors">
Expand Down
Loading

0 comments on commit 4511d88

Please sign in to comment.