This example app uses:
- The latest version of Next.js app router and server functions.
- Clerk as an authentication provider.
- Prisma for data storage.
- Railway for database hosting.
To run the example locally, follow these steps:
-
Clerk Setup:
- Sign up for a Clerk account at Clerk.
- Create a new Clerk project and obtain your NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY, as well as your webhook secret in the webhook settings for WEBHOOK_SECRET to allow clerk to communicate with the database on user account creation, update, ect.
-
Gemini Setup:
- Sign up for an account at Gemini.
- Obtain your GEMINI_API_KEY for API integration, which is found in settings -> api keys.
-
Clone the Repository:
- Clone this repository:
git clone git@github.com:clerkinc/clerk-prisma-starter.git
- Clone this repository:
-
Set up Environment Variables:
- Fill in the following keys in the
.env
file:DATABASE_URL=your_railway_database_url NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key GEMINI_API_KEY=your_gemini_api_key WEBHOOK_SECRET=your_clerk_webhook_secret
- Fill in the following keys in the
-
Railway Database Setup:
- Sign up at Railway.
- Create a new project, set up a PostgreSQL database, and get your DATABASE_URL from the Railway project settings.
- Add your
DATABASE_URL
to the.env
file.
-
Prisma Setup:
- Run the following command to generate Prisma client and apply the schema to the Railway database:
npx prisma generate npx prisma migrate dev
- Run the following command to generate Prisma client and apply the schema to the Railway database:
-
Install Dependencies:
- Install the required npm packages by running:
npm install
- Install the required npm packages by running:
-
Start Development Server:
- Start the development server by running:
npm run dev
- Your app should now be running locally at http://localhost:3000.
- Start the development server by running:
!