Skip to content

SiddDevZ/Wittyr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฅ Reddit Profile Roaster

An AI-powered Reddit profile analyzer that creates personalized roasts based on user's comment history and behavior patterns.


โœจ Features

๐ŸŽญ AI-Powered Analysis

  • Extracts and analyzes Reddit comment history
  • Identifies behavioral patterns and personality traits
  • Generates personalized roasts based on user activity
  • Creates detailed breakdowns of strengths, weaknesses, love life, and life purpose

๐ŸŽจ Interactive Experience

  • Chat-style interface with typewriter effects
  • Progressive story-mode interactions
  • Yes/No question sequences that shape the final roast
  • Smooth animations and transitions

๐ŸŒ Multi-language Support

  • Complete internationalization with react-i18next
  • Dynamic language switching without page reload
  • Persistent language preferences

๐Ÿ“ฑ Responsive Design

  • Works seamlessly across all devices
  • Optimized for both desktop and mobile
  • Clean, modern UI with custom animations

๐Ÿ›  Tech Stack

Frontend

  • Next.js 14 - React framework with App Router
  • React 18 - Modern React with hooks
  • Tailwind CSS - Utility-first CSS framework
  • react-i18next - Internationalization

Backend

  • Hono.js - Lightweight web framework
  • Node.js - JavaScript runtime
  • MongoDB - Database with Mongoose ODM

APIs

  • Reddit API - Comment and profile data extraction
  • Google Gemini AI - AI-powered content generation

๐Ÿ“ Project Structure

reddit-profile-roaster/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ page.jsx                  # Main landing page
โ”‚   โ”œโ”€โ”€ roast/page.jsx           # Results page
โ”‚   โ””โ”€โ”€ layout.jsx               # Root layout
โ”œโ”€โ”€ components/                   # React components
โ”‚   โ”œโ”€โ”€ UsernameForm.jsx         # Username input form
โ”‚   โ”œโ”€โ”€ Footer.jsx               # Site footer
โ”‚   โ”œโ”€โ”€ LanguageSwitcher.jsx     # Language selector
โ”‚   โ””โ”€โ”€ magicui/                 # Custom UI components
โ”œโ”€โ”€ Backend/                      # Server-side code
โ”‚   โ”œโ”€โ”€ server.js               # Main server
โ”‚   โ”œโ”€โ”€ routes/                 # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ response.js         # User processing
โ”‚   โ”‚   โ””โ”€โ”€ roast.js           # Roast retrieval
โ”‚   โ””โ”€โ”€ models/                 # Database schemas
โ”œโ”€โ”€ public/                      # Static assets
โ”‚   โ””โ”€โ”€ locales/               # Translation files
โ”œโ”€โ”€ config.json                 # API configuration
โ””โ”€โ”€ package.json               # Dependencies

๐Ÿš€ Setup & Installation

Prerequisites

  • Node.js 18+
  • MongoDB database
  • Google Gemini API keys

Installation

  1. Clone the repository

    git clone <repository-url>
    cd reddit-profile-roaster
  2. Install dependencies

    # Frontend
    npm install
    
    # Backend
    cd Backend
    npm install
  3. Environment setup

    Create .env in the Backend directory:

    DATABASE_URL=your_mongodb_connection_string
    GEMINI_API_KEY_1=your_gemini_api_key_1
    GEMINI_API_KEY_2=your_gemini_api_key_2
    # Add more API keys as needed
  4. Configure API endpoints

    Update config.json in the root directory:

    {
      "url": "http://localhost:3003"
    }
  5. Start the application

    Backend (Terminal 1):

    cd Backend
    npm start

    Frontend (Terminal 2):

    npm run dev
  6. Access the application


๐ŸŽฎ Usage

  1. Enter a Reddit username in the input field
  2. Wait for analysis - The system fetches and analyzes the user's comment history
  3. Interactive chat - Answer questions about the analysis
  4. View results - Get a comprehensive roast with different categories

API Endpoints

  • POST /api/responses - Submit username for analysis
  • GET /api/roast/:username - Retrieve roast data
  • POST /api/roast/:username/seen - Mark questions as viewed

๐Ÿ”ง Configuration

Adding Languages

  1. Create translation file in public/locales/[language-code]/common.json
  2. Update the language switcher component
  3. Test translations across the application

Database Schema

The application uses MongoDB with the following main schema:

{
  username: String,
  avatar: String,
  subreddits: Array,
  questions: String,
  roast: String,
  strength: String,
  weakness: String,
  loveLife: String,
  lifePurpose: String,
  questionsSeen: Boolean,
  updatedAt: Date
}

API Rate Limiting

  • 200 requests per 15-minute window
  • Multiple Gemini API keys for load balancing
  • Automatic fallback between API keys

๐Ÿ›ก๏ธ Error Handling

  • User not found - Clear error messages with retry options
  • API failures - Graceful degradation with fallback responses
  • Network issues - Automatic retry logic with exponential backoff
  • Invalid data - Input validation and sanitization

๐Ÿ“Š Performance

  • Caching - Database caching for repeat users
  • Optimization - Efficient Reddit API usage
  • Loading states - Engaging progress indicators
  • Responsive - Fast loading across all devices

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License.


About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •