Skip to content

Commit

Permalink
basic docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhooks committed Nov 20, 2023
1 parent f7b0115 commit 4864736
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 49 deletions.
9 changes: 0 additions & 9 deletions apps/course-builder-web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ NEXT_PUBLIC_URL="SITE_URL"
# Postmark
POSTMARK_API_KEY="sk_xxx"

# Next Auth Discord Provider
DISCORD_CLIENT_ID="YOUR_CLIENT_ID"
DISCORD_CLIENT_SECRET="sk_xxx"

# OpenAI Credentials to access gpt-4
OPENAI_API_KEY="sk_xxx"
OPENAI_MODEL_ID="gpt-4"
Expand All @@ -51,11 +47,6 @@ INNGEST_SIGNING_KEY="sk_xxx"
MUX_ACCESS_TOKEN_ID="YOUR_TOKEN_ID"
MUX_SECRET_KEY="sk_xxx"

# Pinecone
PINECONE_API_KEY="sk_xxx"
PINECONE_ENVIRONMENT="YOUR_ENVIRONMENT"
PINECONE_INDEX="YOUR_INDEX"

# Github
GITHUB_CLIENT_ID="YOUR_CLIENT_ID"
GITHUB_CLIENT_SECRET="sk_xxx"
Expand Down
19 changes: 0 additions & 19 deletions apps/course-builder-web/docker-compose.yml

This file was deleted.

21 changes: 4 additions & 17 deletions apps/course-builder-web/src/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,9 @@ export const env = createEnv({
MUX_ACCESS_TOKEN_ID: z.string(),
OPENAI_MODEL_ID: z.string(),
OPENAI_EMBEDDINGS_MODEL: z.string(),
PINECONE_API_KEY: z.string(),
PINECONE_ENVIRONMENT: z.string(),
PINECONE_INDEX: z.string(),
GITHUB_CLIENT_ID: z.string(),
GITHUB_CLIENT_SECRET: z.string(),
DEEPGRAM_API_KEY: z.string(),
AWS_VIDEO_UPLOAD_BUCKET: z.string(),
AWS_VIDEO_UPLOAD_REGION: z.string(),
AWS_VIDEO_UPLOAD_ACCESS_KEY_ID: z.string(),
AWS_VIDEO_UPLOAD_SECRET_ACCESS_KEY: z.string(),
UPLOADTHING_URL: z.string(),
POSTMARK_API_KEY: z.string(),
},
Expand All @@ -61,6 +54,7 @@ export const env = createEnv({
client: {
NEXT_PUBLIC_PARTYKIT_ROOM_NAME: z.string(),
NEXT_PUBLIC_PARTY_KIT_URL: z.string(),
NEXT_PUBLIC_URL: z.string(),
},

/**
Expand All @@ -73,6 +67,8 @@ export const env = createEnv({
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
OPENAI_API_KEY: process.env.OPENAI_API_KEY,
OPENAI_MODEL_ID: process.env.OPENAI_MODEL_ID,
OPENAI_EMBEDDINGS_MODEL: process.env.OPENAI_EMBEDDINGS_MODEL,
SANITY_STUDIO_PROJECT_ID: process.env.SANITY_STUDIO_PROJECT_ID,
SANITY_STUDIO_DATASET: process.env.SANITY_STUDIO_DATASET,
SANITY_STUDIO_API_VERSION: process.env.SANITY_STUDIO_API_VERSION,
Expand All @@ -83,21 +79,12 @@ export const env = createEnv({
NEXT_PUBLIC_PARTY_KIT_URL: process.env.NEXT_PUBLIC_PARTY_KIT_URL,
MUX_ACCESS_TOKEN_ID: process.env.MUX_ACCESS_TOKEN_ID,
MUX_SECRET_KEY: process.env.MUX_SECRET_KEY,
OPENAI_MODEL_ID: process.env.OPENAI_MODEL_ID,
OPENAI_EMBEDDINGS_MODEL: process.env.OPENAI_EMBEDDINGS_MODEL,
PINECONE_API_KEY: process.env.PINECONE_API_KEY,
PINECONE_ENVIRONMENT: process.env.PINECONE_ENVIRONMENT,
PINECONE_INDEX: process.env.PINECONE_INDEX,
GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET,
DEEPGRAM_API_KEY: process.env.DEEPGRAM_API_KEY,
AWS_VIDEO_UPLOAD_BUCKET: process.env.AWS_VIDEO_UPLOAD_BUCKET,
AWS_VIDEO_UPLOAD_REGION: process.env.AWS_VIDEO_UPLOAD_REGION,
AWS_VIDEO_UPLOAD_ACCESS_KEY_ID: process.env.AWS_VIDEO_UPLOAD_ACCESS_KEY_ID,
AWS_VIDEO_UPLOAD_SECRET_ACCESS_KEY:
process.env.AWS_VIDEO_UPLOAD_SECRET_ACCESS_KEY,
UPLOADTHING_URL: process.env.UPLOADTHING_URL,
POSTMARK_API_KEY: process.env.POSTMARK_API_KEY,
NEXT_PUBLIC_URL: process.env.NEXT_PUBLIC_URL,
},
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially
Expand Down
87 changes: 83 additions & 4 deletions docs/src/content/docs/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,67 @@ title: Getting Started
description: This will help you create a new Course Builder project.
---

Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
Writing a good guide requires thinking about what your users are trying to do.
Course Builder is a Turborepo project that includes the website, this docs
site you are reading right now, and the various libraries and packages that
represent the Course Builder platform.

:::note
This guide is a work in progress. It will be updated as the project evolves.
:::

It's non-trivial and these guides are going to make several assumptions:

- You are familiar with [Git](https://git-scm.com/)
- You are familiar with [TypeScript](https://www.typescriptlang.org/)
- You are familiar with [React](https://reactjs.org/)
- You are familiar with [Next.js](https://nextjs.org/)
- You are familiar with [Turborepo](https://turbo.build/)
- You are familiar with [pnpm](https://pnpm.io/)
- You are deploying to [Vercel](https://vercel.com/)

This is a **lot** of assumptions!

There will be plenty of detail and links, but if you are not familiar with
these technologies, you may want to start with some of the links above.

## Next.js and the T3 Stack

The Course Builder website is built with [Next.js](https://nextjs.org/). It
uses [`create-t3-app`](https://create.t3.gg/) to scaffold the project. This
provides a consistent opinionated starting point for Next.js projects.

- NextAuth
- TailwindCSS
- tRPC
- Drizzle ORM
- CASL

Course Builder is using the Next.js App Router which makes use of React
Server Components.

For the sake of simplicity, Course Builder is deployed to Vercel. This might
not be a strict requirement, but hosting on other platforms is left as an
exercise for the reader.

## Integrated Third-Party Services

Course Builder is integrated with several third-party services. These are
all currently required for the project to function. This means that you will
need to create accounts with these services and configure them for your
project by adding the various keys and secrets to your environment variables
in the `course-builder-web` app.

- [Sanity](https://sanity.io): Content management
- [Inngest](https://inngest.com): event-driven workflows
- [Partykit](https://www.partykit.io/): Real-time updates across the system
- [Mux](https://www.mux.com/): Video delivery
- [GitHub](https://github.com/): Authentication
- [uploadthing](https://uploadthing.com): Uploading videos
- [Postmark](https://postmarkapp.com): Sending emails
- [OpenAI](https://openai.com/): AI-powered content generation

It's possible to swap these out to suit your needs and preferences, but the
assumption in these guides is that you will be using these services.

## Clone the Repository

Expand All @@ -18,6 +77,26 @@ git clone https://www.github.com/joelhooks/course-builder
pnpm install
```

## Further reading
## Configure Environment Variables

```bash
cd /apps/course-builder-web
cp .env.example .env
```

They are all required.

:::note
There are 3 (THREE!) different entries for the URL of the project in the
environment:

```dotenv
NEXTAUTH_URL="YOUR_TUNNEL.ngrok-free.app/"
UPLOADTHING_URL="http://localhost:3000"
NEXT_PUBLIC_URL="https://YOUR_TUNNEL.ngrok-free.app/"
```

- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework
This is because the project is using several different services that need to
know the URL of the project. This is a bit of a pain, but it's the way it is
for now.
:::

1 comment on commit 4864736

@vercel
Copy link

@vercel vercel bot commented on 4864736 Nov 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.