/ai-social

Primary LanguageTypeScript

Social AI App

Installation guide

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.

Installation instructions

To run the example locally, follow these steps:

  1. 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.
  2. Gemini Setup:

    • Sign up for an account at Gemini.
    • Obtain your GEMINI_API_KEY for API integration, which is found in settings -> api keys.
  3. Clone the Repository:

    • Clone this repository:
      git clone git@github.com:clerkinc/clerk-prisma-starter.git
  4. 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
      
  5. 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.
  6. 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
  7. Install Dependencies:

    • Install the required npm packages by running:
      npm install
  8. Start Development Server:

    • Start the development server by running:
      npm run dev
    • Your app should now be running locally at http://localhost:3000.

!