Skip to content
Merged
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
161 changes: 115 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,139 @@
# Project Setup Guide
<p align="left">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRpPlI1P7SK3pemg67VMPbvNzxYyk0UtlmJiQ&s" alt="Aossie Logo" height="120"/>
</p>

## Backend Setup
<h1 align="right">
<b>AOSSIE | DebateAI</b>
</h1>

1. Navigate to the backend directory:
```sh
---

## About DebateAI

**DebateAI** is an AI-enhanced, real-time debating platform designed to sharpen communication skills. Whether competing against human opponents or LLM-powered AI challengers, users can participate in structured debates that mimic formal competitions.

### Key Features

- **User vs. User Debates**
- Real-time debates via **WebSockets**, **WebRTC** (audio/video/text)
- Structured formats: **opening**, **cross-exam**, and **closing**

- **User vs. AI Debates**
- LLM-generated counterarguments that adapt to your input

- **Custom Debate Rooms**
- Create private, topic-specific debate spaces

---

## Project Setup Guide

### Backend Configuration

1. Create a file named `config.prod.yml` in the `backend/config/` directory.

Paste the following configuration:
```
server:
port: 1313 # The port number your backend server will run on

database:
uri: "mongodb+srv://<username>:<password>@<cluster-url>/<database-name>"
# Replace with your MongoDB Atlas connection string
# Get this from your MongoDB Atlas dashboard after creating a cluster and database

gemini:
apiKey: "<YOUR_GEMINI_API_KEY>"
# API key for OpenAI / Gemini model access
# Obtain from your OpenRouter.ai or OpenAI account dashboard

jwt:
secret: "<YOUR_JWT_SECRET>"
# A secret string used to sign JWT tokens
# Generate a strong random string (e.g. use `openssl rand -hex 32`)

expiry: 1440
# Token expiry time in minutes (e.g. 1440 = 24 hours)

smtp:
host: "smtp.gmail.com"
# SMTP server host for sending emails (example is Gmail SMTP)

port: 587
# SMTP server port (587 for TLS)

username: "<YOUR_EMAIL_ADDRESS>"
# Email username (your email address)

password: "<YOUR_EMAIL_PASSWORD_OR_APP_PASSWORD>"
# Password for the email or app-specific password if 2FA is enabled

senderEmail: "<YOUR_EMAIL_ADDRESS>"
# The 'from' email address used when sending mails

senderName: "DebateAI Team"

googleOAuth:
clientID: "<YOUR_GOOGLE_OAUTH_CLIENT_ID>"
# Google OAuth Client ID for OAuth login
# Obtain from Google Cloud Console (APIs & Services > Credentials > OAuth 2.0 Client IDs)
```

> **Note**: Do **not** commit this file to a public repository. Use `.gitignore`.

---

### Running the Backend (Go)

1. Navigate to the backend folder:
```
cd backend
```
2. Run the backend server:
```sh

2. Initialize Go modules (if not already done):
```
go mod tidy
```

3. Run the server:
```
go run cmd/server/main.go
```

## Frontend Setup
---

### Running the Frontend (React + Vite)

1. Navigate to the frontend directory:
```sh
1. Open a new terminal and navigate to the frontend directory:
```
cd frontend
```

2. Install dependencies:
```sh
```
npm install
```
3. Create an environment file:
- Create a `.env` file in the frontend directory.
- Add the following environment variables:
```sh
VITE_BASE_URL="http://localhost:<BACKEND_SERVER_PORT>"
```

3. Create a `.env` file and add:
```
VITE_BASE_URL="http://localhost:1313"
```

4. Start the development server:
```sh
```
npm run dev
```

## Setting Up Amazon Cognito

Follow these steps to configure Amazon Cognito for authentication:

1. **Navigate to Cognito**
- Go to the [AWS Management Console](https://aws.amazon.com/console/) and open Cognito.

2. **Create a User Pool**
- Configure authentication settings as per your requirements.

3. **Retrieve Credentials**
- Once the User Pool is set up, obtain the necessary credentials:
- **User Pool ID**
- **App Client ID**
---

4. **Update Application Configuration**
- Add the retrieved credentials to your application's configuration file (e.g., `config.yml`).
- Enable the following settings in Cognito's app-client:
- Choice-based sign-in
- Username and password authentication
- Get user tokens from existing authenticated sessions
- Secure Remote Password (SRP) protocol
## Contributing

For more details, refer to the [official AWS documentation](https://docs.aws.amazon.com/cognito/).
Want to contribute to DebateAI? Reach out to [Bhavik Mangla](https://github.com/bhavik-mangla) and [Rishit Tiwari](https://github.com/rixitgithub). Contributions that enhance accessibility, features, or performance are always welcome.

## Setting Up OpenAI API Key
---

To use OpenAI services, obtain an API key from OpenRouter:
## License

1. Visit [OpenRouter](https://openrouter.ai/) and sign up if you don't have an account.
2. Generate an API key from your OpenRouter dashboard.
3. Add the API key to your `config.yml` file.
MIT © [AOSSIE](https://aossie.org)

---

This guide follows the project implementation approach. If you encounter any issues, check the AWS documentation or relevant project files.