Skip to content

JofredG/HSI-BOTB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BotB 2025 - AI Content Generator

BotB 2025 Screenshot

A modern React + Flask application that generates social media content using AI. Features a beautiful post editor with integrated AI content generation capabilities.

🚀 Quick Start with Docker (Recommended)

Prerequisites

  • Docker and Docker Compose installed
  • OpenAI API key

1. Clone and Setup

git clone <repository-url>
cd HSI-BOTB
cp env.example .env

2. Configure Environment

Edit .env file with your OpenAI API key:

OPENAI_API_KEY=your_openai_api_key_here
OPENAI_API_BASE=https://api.openai.com/v1 #you can ignore this my need to update client constructor (allows me to use free token credits)
MODEL_NAME=gpt-4o

3. Run with Docker

# Build and start containers
docker-compose up -d --build

# View logs
docker-compose logs -f

# Stop containers
docker-compose down

4. Access Application

🛠️ Development Setup (Manual)

Prerequisites

  • Node.js 20+
  • Python 3.11+
  • OpenAI API key

Backend Setup

cd backend

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment
echo "OPENAI_API_KEY=your_openai_api_key_here" > .env

# Run backend
python app.py

Frontend Setup

# Install dependencies
npm install

# Run development server
npm run dev

📁 Project Structure

botb2025/
├── backend/                 # Flask API server
│   ├── app.py              # Main Flask application
│   ├── requirements.txt    # Python dependencies
│   └── .env               # Environment variables
├── src/                    # React frontend
│   ├── components/         # React components
│   ├── pages/             # Application pages
│   └── App.jsx            # Main React component
├── docker-compose.yml      # Docker orchestration
├── Dockerfile.frontend     # Frontend container
├── Dockerfile.backend      # Backend container
└── .env                   # Environment configuration

🎯 Features

  • AI Content Generation: Generate social media posts using OpenAI
  • Modern UI: Built with React, Vite, and TailwindCSS
  • Responsive Design: Works on desktop and mobile
  • Post Editor: Rich text editing capabilities
  • Preview Mode: See how your post will look
  • Containerized: Easy deployment with Docker
  • API Health Checks: Monitor backend status

🧪 Testing

# Run all tests
npm run test:all

# Frontend tests only
npm run test:frontend

# Backend tests only
npm run test:backend

# Integration tests
npm run test:integration

🚀 Deployment

Docker Deployment (Recommended)

See DOCKER.md for detailed Docker deployment instructions.

Platform Options

  • Hetzner Cloud: Full Docker support, cost-effective
  • Vercel: Serverless deployment (requires restructuring)
  • AWS/GCP/Azure: Container orchestration platforms

🛠️ Development Commands

# Development
npm run dev              # Start frontend dev server
npm run build           # Build frontend for production
npm run preview         # Preview production build

# Testing
npm run test            # Run tests in watch mode
npm run test:run        # Run tests once
npm run test:ui         # Run tests with UI

# Linting
npm run lint            # Run ESLint

📝 API Endpoints

  • GET /api/health - Health check
  • POST /api/chat - Generate AI content

🔧 Configuration

Environment Variables

  • OPENAI_API_KEY - Your OpenAI API key
  • OPENAI_API_BASE - OpenAI API base URL (optional)
  • MODEL_NAME - OpenAI model to use (default: gpt-4o)
  • VITE_API_URL - Backend API URL for frontend

Frontend Configuration

The frontend is built with:

  • React 19 - UI framework
  • Vite - Build tool and dev server
  • TailwindCSS - Styling
  • DaisyUI - Component library

Backend Configuration

The backend is built with:

  • Flask - Web framework
  • Flask-CORS - Cross-origin resource sharing
  • OpenAI Python SDK - AI integration
  • Python 3.11 - Runtime

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published