Skip to content

Samy-rgb/topcoder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Creative Asset Automation Platform

![React](https://img.shields.io/badge/React-18.2.0-blue?logoon-3.13io/badge/TopCoder for automating creative asset adaptation across multiple platforms using AI*


πŸ“‹ Table of Contents


🎯 Overview

The Creative Asset Automation Platform is a comprehensive solution that streamlines the process of adapting creative assets for different social media platforms and formats. Built for the TopCoder Challenge, this application demonstrates modern full-stack development practices with React.js frontend and Flask backend.

Problem Solved

Marketing teams spend significant time manually adapting creative assets to different channels (Instagram, LinkedIn, YouTube) and formats (Story, Feed, Carousel). This platform automates the entire workflow from upload to download.


✨ Features

  • πŸ” Authentication & Authorization - Role-based access control (Admin/User)
  • πŸ“€ Asset Upload - Drag & drop interface with validation (PNG/JPEG, 50MB limit)
  • ✏️ Manual Editing - Canvas-based editor with text overlay and logo placement
  • πŸ€– AI Integration - Multiple AI provider selection (OpenAI, Midjourney, Stable Diffusion)
  • πŸ“± Multi-Platform Support - Instagram, LinkedIn, YouTube format adaptation
  • ⚑ Batch Processing - Generate multiple variants simultaneously
  • πŸ“Š Progress Tracking - Real-time job monitoring with status updates
  • πŸ’Ύ Download Management - Individual and bulk ZIP downloads
  • πŸ‘¨β€πŸ’Ό Admin Panel - System management and AI provider configuration

πŸ› οΈ Tech Stack

Frontend

  • React 18.2.0 - Component-based UI library
  • React Router v6 - Client-side routing
  • Axios - HTTP client with interceptors
  • Lucide React - Modern icon library
  • React Dropzone - File upload interface
  • Fabric.js - Canvas manipulation
  • React Toastify - Notifications

Backend

  • Flask 2.3.3 - Python web framework
  • Flask-CORS - Cross-origin resource sharing
  • Python 3.13 - Server-side logic

Development

  • Create React App - React development environment
  • ESLint & Prettier - Code formatting and linting
  • Git - Version control

πŸš€ Installation

Prerequisites

  • Node.js >= 16.0.0
  • Python >= 3.8
  • npm or yarn
  • Git

1. Clone Repository

git clone https://github.com/Samy-rgb/topcoder.git
cd topcoder

2. Backend Setup

cd backend
pip install -r requirements.txt
python app.py

The backend will start on http://localhost:8000

3. Frontend Setup

# Return to root directory
cd ..

# Install dependencies
npm install

# Create environment file
echo "REACT_APP_API_URL=http://localhost:8000/api" > .env
echo "REACT_APP_ENVIRONMENT=development" >> .env

# Start development server
npm start

The frontend will start on http://localhost:3000


πŸ“– Usage

Test Credentials

Role Username Password Access Level
Admin admin admin123 Full system access
User user user123 Standard user features

Basic Workflow

  1. Login - Use test credentials to access the system
  2. Upload Assets - Drag and drop high-resolution images
  3. Select Formats - Choose target platforms and formats
  4. Edit Manually (Optional) - Add text overlays or logos
  5. Choose AI Provider - Select from available AI services
  6. Generate Variants - Start batch processing
  7. Monitor Progress - Track generation in real-time
  8. Download Results - Get individual files or bulk ZIP

πŸ“š API Documentation

Authentication

POST /api/auth/login
Content-Type: application/json

{
  "username": "admin",
  "password": "admin123"
}

Asset Management

POST /api/assets/upload
Content-Type: multipart/form-data

# Upload file with metadata

AI Generation

GET /api/generation/providers
# Returns available AI providers

POST /api/generation/generate
Content-Type: application/json

{
  "assetIds": ["asset-id-1"],
  "formatIds": ["format-id-1"],
  "providerId": "openai"
}

πŸ“ Project Structure

topcoder/
β”œβ”€β”€ πŸ“„ README.md
β”œβ”€β”€ πŸ“„ .env
β”œβ”€β”€ πŸ“„ .gitignore
β”œβ”€β”€ πŸ“„ package.json
β”œβ”€β”€ πŸ“ public/
β”œβ”€β”€ πŸ“ src/
β”‚   β”œβ”€β”€ πŸ“ components/
β”‚   β”‚   β”œβ”€β”€ πŸ“ auth/
β”‚   β”‚   β”œβ”€β”€ πŸ“ common/
β”‚   β”‚   β”œβ”€β”€ πŸ“ upload/
β”‚   β”‚   β”œβ”€β”€ πŸ“ editor/
β”‚   β”‚   β”œβ”€β”€ πŸ“ generation/
β”‚   β”‚   └── πŸ“ download/
β”‚   β”œβ”€β”€ πŸ“ pages/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Login.js
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Dashboard.js
β”‚   β”‚   β”œβ”€β”€ πŸ“„ AdminDashboard.js
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Upload.js
β”‚   β”‚   β”œβ”€β”€ πŸ“„ Generation.js
β”‚   β”‚   └── πŸ“„ Downloads.js
β”‚   β”œβ”€β”€ πŸ“ services/
β”‚   β”‚   β”œβ”€β”€ πŸ“„ api.js
β”‚   β”‚   β”œβ”€β”€ πŸ“„ auth.js
β”‚   β”‚   └── πŸ“„ generation.js
β”‚   └── πŸ“ styles/
└── πŸ“ backend/
    β”œβ”€β”€ πŸ“„ app.py
    β”œβ”€β”€ πŸ“„ requirements.txt
    └── πŸ“„ README.md

πŸ–ΌοΈ Screenshots

User Dashboard

![Dashboard Interface showing asset management and generation options]

AI Provider Selection

![Dropdown interface for selecting AI providers before generation]

Admin Panel

![System management interface for administrators]


πŸš€ Deployment

Frontend Deployment (Vercel/Netlify)

npm run build
# Deploy the build/ directory

Backend Deployment (Heroku/Railway)

# Create Procfile
echo "web: python app.py" > Procfile

# Deploy with requirements.txt

Environment Variables

# Production environment
REACT_APP_API_URL=https://your-backend-url/api
REACT_APP_ENVIRONMENT=production

πŸ† TopCoder Challenge Compliance

βœ… Requirements Checklist

  • React.js frontend for user panel
  • User authentication with role-based routing
  • High-resolution asset upload with validation
  • Platform and format selection interface
  • Manual editing capabilities with metadata saving
  • AI Provider dropdown before "Generate With AI" button
  • Batch asset generation workflow
  • Individual and bulk download functionality
  • Real-time job progress tracking
  • Complete backend API integration
  • Admin panel for system management

🎨 Marvel Prototype Compliance

  • All specified UI screens implemented
  • User workflow matches design specifications
  • AI Provider selector positioned as required
  • Complete user journey from upload to download

🀝 Contributing

This project was created for the TopCoder Creative Asset Automation Challenge.

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Style

  • Follow existing code formatting
  • Use meaningful commit messages
  • Add comments for complex logic
  • Test changes before submitting

πŸ› Troubleshooting

Common Issues

CORS Errors

# Ensure Flask-CORS is installed
pip install flask-cors

Port Conflicts

# Change backend port
python app.py --port 8001

# Update .env file
REACT_APP_API_URL=http://localhost:8001/api

Missing Dependencies

# Frontend
npm install

# Backend
pip install -r requirements.txt

πŸ“ž Support

For questions or issues:

  • πŸ“§ Create an issue in this repository
  • πŸ“– Check the documentation
  • πŸ” Review existing issues

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Samy-rgb


🎯 Project Status

![Status](https://img.shields.io/io/badge/TopCoderopCoder evaluation.**


⭐ Star this repository if you found it helpful!

Built with ❀️ for TopCoder Creative Asset Automation Challenge

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published