This repository contains a Next.js application integrated with Clerk Authentication, BAAS (Backend as a Service) features from Convex, and GROQ Cloud Inference for AI-powered functionalities. The project is bootstrapped using create-next-app
.
- Clerk Authentication: Seamless user authentication and management.
- Convex BAAS: Simplified backend data handling and storage.
- GROQ Cloud Inference: Leverages AI capabilities for advanced cloud inference.
Follow the steps below to set up and run the application locally:
Start the development server using one of the following commands:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 in your browser to see the running application.
You can edit the pages by modifying the app/page.tsx
file. Changes will be reflected instantly thanks to hot reloading.
- Complete the Convex setup to obtain the Convex Deployment URL and Convex Public URL.
- Add these URLs to your environment configuration.
- Set up Clerk for authentication.
- Obtain the following keys:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
CLERK_SECRET_KEY
- Add these keys to your environment configuration.
- Acquire your OpenAI API Key (recommended: GROQ Cloud Inference).
- Add the API key to your environment variables for enabling AI functionalities.
- To store organization logs from Clerk in the Convex DB:
- Use Clerk's webhook feature.
- Set the Convex HTTP-Action endpoint as the webhook URL.
- Whitelist this endpoint in Clerk, appending your preferred webhook API path.
- Note the Clerk Webhook Secret Key to verify incoming requests.
- For production deployment:
- Acquire the production details from Convex.
- Set up environment variables in the Convex deployment environment.
- Proceed with the deployment in your preferred hosting platform.
Ensure you configure the following environment variables:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your-clerk-publishable-key
CLERK_SECRET_KEY=your-clerk-secret-key
CONVEX_DEPLOYMENT_URL=your-convex-deployment-url
CONVEX_PUBLIC_URL=your-convex-public-url
OPENAI_API_KEY=your-openai-api-key
CLERK_WEBHOOK_SECRET=your-clerk-webhook-secret
- Ensure proper whitelisting of webhook endpoints in Clerk.
- Use secure storage for sensitive environment variables.
- Refer to official documentation for advanced configurations:
Happy developing!