This is a collection of AI examples. It uses the Next.js framework with React. Check out the tutorial or follow the instructions below to get set up.
-
If you don’t have Node.js installed, install it from here (Node.js version >= 14.6.0 required)
-
Clone this repository
git clone https://github.com/juancamiloqhz/ai-workshop
-
Creating an account on Replicate to get an API key.
- Go to Replicate to make an account.
- Click on your profile picture in the top right corner, and click on "Dashboard".
- Click on "Account" in the navbar. And, here you can find your API token, copy it.
-
Install the dependencies
npm install
-
Make a copy of the example environment variables file
On Linux systems:
cp .env.example .env
On Windows:
copy .env.example .env
-
Add your OpenAI API key to the newly created
.env
file -
Run the app
npm run dev
-
Auth setup
- Use
openssl rand -base64 32
to generate NEXTAUTH_SECRET - Add DB URL and SHADOW DB URL from Neon
- Create a new project in console.cloud.google.com
- Click configure consent screen in API credentials page and click external
- Add an app name, do not upload logo, add authorized domain
- Publish app
- Create credentials -> Oauth client ID
- Run npx prisma db push && prisma migrate dev && prisma generate
- Use
You should now be able to access the app at http://localhost:3000! For the full context behind this example app.