A modern React + Flask application that generates social media content using AI. Features a beautiful post editor with integrated AI content generation capabilities.
- Docker and Docker Compose installed
- OpenAI API key
git clone <repository-url>
cd HSI-BOTB
cp env.example .envEdit .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# Build and start containers
docker-compose up -d --build
# View logs
docker-compose logs -f
# Stop containers
docker-compose down- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
- Health Check: http://localhost:5001/api/health
- Node.js 20+
- Python 3.11+
- OpenAI API key
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# Install dependencies
npm install
# Run development server
npm run devbotb2025/
├── 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
- ✅ 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
# 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:integrationSee DOCKER.md for detailed Docker deployment instructions.
- Hetzner Cloud: Full Docker support, cost-effective
- Vercel: Serverless deployment (requires restructuring)
- AWS/GCP/Azure: Container orchestration platforms
# 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 ESLintGET /api/health- Health checkPOST /api/chat- Generate AI content
OPENAI_API_KEY- Your OpenAI API keyOPENAI_API_BASE- OpenAI API base URL (optional)MODEL_NAME- OpenAI model to use (default: gpt-4o)VITE_API_URL- Backend API URL for frontend
The frontend is built with:
- React 19 - UI framework
- Vite - Build tool and dev server
- TailwindCSS - Styling
- DaisyUI - Component library
The backend is built with:
- Flask - Web framework
- Flask-CORS - Cross-origin resource sharing
- OpenAI Python SDK - AI integration
- Python 3.11 - Runtime
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
