Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
AI_API_KEY="your_api_key"
POSTGRES_URL="postgresql://postgres:example@localhost:5432/postgres"
DATABASE_URL="postgresql://postgres:example@localhost:5432/postgres"
AUTH_GOOGLE_ID=your-google-client-id
AUTH_GOOGLE_SECRET=your-google-client-secret
AUTH_SECRET="your-auth-secret"
GOOGLE_AI_API_KEY="google-ai-api-key"

REDIS_URL="redis://localhost:6379"

Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,30 @@ To configure Google authentication, set the following environment variables in y
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------- |
| `GOOGLE_CLIENT_ID` | Your Google application's Client ID. Obtain this from the [Google Developer Console](https://console.developers.google.com/). | Yes | None |
| `GOOGLE_CLIENT_SECRET` | Your Google application's Client Secret. Obtain this from the [Google Developer Console](https://console.developers.google.com/). | Yes | None |
| `GOOGLE_AI_API_KEY` | Your Google Generative Language API key. Obtain this from the Google Cloud Console as described below. | Yes | None |


**Instructions:**

1. **Obtain Google OAuth Credentials:**
1a. **Obtain Google OAuth Credentials:**

- Navigate to the [Google Developer Console](https://console.developers.google.com/).
- Create a new project or select an existing one.
- Go to the "Credentials" section and create OAuth 2.0 credentials.
- Note down the generated `Client ID` and `Client Secret`.

1b. Obtain Google Generative Language API Key

- Go to the [Google Cloud Console](https://console.cloud.google.com/).
- Select your project or create a new one.
- **Enable billing** on your project (required to use the API).
- Enable the **Generative Language API**:
- Visit [Generative Language API library](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com).
- Click **Enable**.
- Go to the **Credentials** page.
- Click **Create Credentials** → **API Key**.
- Copy the generated API key.

2. **Set Up Your `.env` File:**
- Create a `.env` file in the root directory of your project if it doesn't exist.

Expand All @@ -47,6 +61,7 @@ To configure Google authentication, set the following environment variables in y
```env
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
GOOGLE_AI_API_KEY=your-google-generative-language-api-key
```
- Save the `.env` file. Ensure this file is **not** committed to version control by adding `.env` to your `.gitignore` file.

Expand Down
48 changes: 48 additions & 0 deletions app/(protected)/chatbot/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type { Metadata } from "next";
import "../../globals.css";
import { cn } from "@/lib/utils";
import { Toaster } from "@/components/ui/sonner";
import { ThemeProvider } from "@/components/theme-provider";
import { auth } from "@/auth";
import { SessionProvider } from "next-auth/react";
import { Poppins } from "next/font/google";

export const metadata: Metadata = {
title: "Chatbot - Dark Alpha Capital",
description: "AI Chatbot for Deal Sourcing",
};

const poppins = Poppins({
subsets: ["latin"],
weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
display: "swap",
variable: "--font-poppins",
});

export default async function ChatbotLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const userSession = await auth();

return (
<html lang="en" className={cn(poppins.variable)} suppressHydrationWarning>
<body className={`antialiased`}>
<ThemeProvider
attribute="class"
defaultTheme="light"
enableSystem
disableTransitionOnChange
>
<SessionProvider>
<main className="min-h-screen bg-background">
{children}
</main>
</SessionProvider>
<Toaster />
</ThemeProvider>
</body>
</html>
);
}
Loading