A specialized image captioning and resizing tool designed for The Junior & Senior School Alumni Association (JUSSAA) social media team.
The JUSSAA Captioner Tool is a web-based application that helps social media interns quickly generate engaging captions for photos and resize images to optimal social media dimensions (4:5 aspect ratio). Built with React frontend and Express.js backend, it leverages OpenAI's vision capabilities for intelligent caption generation.
- 🖼️ Smart Image Upload: Drag & drop or click to upload images (PNG, JPG, GIF, WebP)
- 🤖 AI-Powered Captions: Generate contextual captions using OpenAI's vision model
- 📐 Automatic Resizing: Convert images to 4:5 aspect ratio optimized for social media
- 🎨 JUSSAA Branding: Custom branded interface with school colors and logo
- 📱 Responsive Design: Works seamlessly on desktop and mobile devices
- ⚡ Real-time Processing: Instant feedback and processing status updates
-
Start the application
npm start
-
Open your browser Navigate to
http://localhost:3000 -
Upload an image
- Drag and drop a photo onto the upload area, or
- Click to browse and select an image file
-
Generate caption
- Click "Generate Caption" to create an AI-powered description
- The caption will appear in the text area
-
Download resized image
- Click "Download Resized (4x5)" to get the social media optimized version
- Image is automatically converted to 4:5 aspect ratio
jussaa-captionator/
├── package.json # Main application dependencies
├── .env # Environment configuration (OpenAI API key)
├── README.md # This documentation
├── assets/
│ └── jussaa_logo.jpg # JUSSAA school logo
├── src/
│ ├── captioner-app.js # Express server and API routes
│ ├── routes/
│ │ └── captioner-api.js # API endpoints for upload/caption/resize
│ ├── services/
│ │ ├── caption-service.js # OpenAI integration for captions
│ │ └── image-service.js # Image processing and resizing
│ └── utils/
│ └── logger.js # Application logging
├── client/ # React frontend application
│ ├── package.json # Frontend dependencies
│ ├── public/
│ │ └── jussaa_logo.jpg # Logo for web interface
│ └── src/
│ ├── App.js # Main React component
│ ├── components/
│ │ ├── CaptionerTab.js # Main upload/caption interface
│ │ └── RefineTab.js # Caption customization (future)
│ └── api/
│ └── captioner.js # API client for backend
├── uploads/ # Temporary uploaded images
├── build/ # Built React app (served by Express)
└── logs/ # Application logs
- Node.js (v14 or higher)
- OpenAI API key
-
Clone or download the project
git clone <repository-url> cd jussaa-captionator
-
Install dependencies
npm install cd client && npm install && cd ..
-
Configure environment variables Create a
.envfile in the root directory:OPENAI_API_KEY=your_openai_api_key_here NODE_ENV=production PORT=3000
-
Build the React frontend
npm run build
-
Start the application
npm start
-
Access the web interface Open
http://localhost:3000in your browser
-
Navigate to the Captioner Tool
- Open
http://localhost:3000in your web browser - You'll see the JUSSAA-branded interface with the greeting message
- Open
-
Upload Your Photo
- Method 1: Drag your image file directly onto the upload area
- Method 2: Click the upload area and select your image file
- Supported formats: PNG, JPG, GIF, WebP (max 10MB)
-
Generate Caption
- After upload, click the green "Generate Caption" button
- Wait for the AI to analyze your image and create a caption
- The caption will appear in the text box below
-
Download Resized Image
- Click "Download Resized (4x5)" to get the optimized image
- The image is automatically resized to 4:5 aspect ratio
- Perfect for Instagram posts and stories
-
Start Over
- Click "Start Over" at any time to upload a new image
- This clears all current data and resets the interface
- Use clear, well-lit photos for better AI caption generation
- Include people and activities - the AI works best with scenes containing school events, alumni gatherings, and people
- Check and edit captions - Always review the generated caption and modify as needed
- Keep original files - The tool doesn't modify your original images
The application provides REST API endpoints:
POST /api/captioner/upload- Upload image filePOST /api/captioner/caption- Generate caption for uploaded imagePOST /api/captioner/resize- Resize image to 4:5 aspect ratioGET /api/captioner/download/:filename- Download processed imageGET /health- Application health check
cd client
npm start # Starts React dev server on port 3001npm run dev # Starts Express server with debug loggingnpm run build # Builds React app and copies to build/npm start- Start production servernpm run dev- Start development servernpm run build- Build React frontendnpm run build:client- Build client onlynpm run dev:client- Start client development server
# Required
OPENAI_API_KEY=sk-... # Your OpenAI API key
# Optional
NODE_ENV=production # Environment mode
PORT=3000 # Server port
LOG_LEVEL=info # Logging level- Upload limit: 10MB per file
- Output format: JPEG for resized images
- Resize dimensions: 4:5 aspect ratio (optimized for social media)
- Quality: 90% JPEG quality for good balance of size/quality
-
"Image upload failed"
- Check file size (must be under 10MB)
- Ensure file is a valid image format
- Check server logs for detailed error
-
"Caption generation failed"
- Verify OpenAI API key is set correctly in
.env - Check your OpenAI account has available credits
- Review server logs for API errors
- Verify OpenAI API key is set correctly in
-
"Download failed"
- Ensure image was successfully uploaded first
- Check server disk space and permissions
- Verify uploads/ directory exists and is writable
-
Old version showing after changes
- Run
npm run buildto rebuild the frontend - Restart the server with
npm start - Clear browser cache or hard refresh (Ctrl+Shift+R)
- Run
- Visit
http://localhost:3000/healthto check application status - Check logs in the
logs/directory for detailed information
- Memory: 512MB RAM minimum
- Storage: 1GB free space for images and logs
- Network: Internet connection for OpenAI API calls
- Browser: Modern browser with JavaScript enabled
- API keys are stored in environment variables, never in code
- Uploaded images are temporarily stored and can be cleaned up regularly
- No user authentication required for internal use
- Consider network security if deploying on shared networks
For technical issues:
- Check the troubleshooting section above
- Review application logs in
logs/directory - Verify environment configuration
- Contact the development team with specific error messages
Built for The Junior & Senior School Alumni Association
Making social media management easier for our community