Skip to content

Serverless cover image generator on Azure Functions (Node.js/Canvas). Users customize text, fonts & colors; exports PNGs + logs preferences to MongoDB for analytics.

License

Notifications You must be signed in to change notification settings

victoriacheng15/cover-craft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cover Craft 🎨

A full-stack cover image generator application with built-in analytics dashboard. Showcases modern web development, cloud deployment, and best practices. Demonstrates end-to-end integration of responsive frontend, serverless backend, MongoDB data persistence, and cloud infrastructure for production-ready applications.

🧰 Tech Stack

TypeScript Next.js React Tailwind%20CSS Azure%20Functions MongoDB Vercel Vitest Biome

🌍 Deployment

  • Frontend: Vercel - Optimized for Next.js with automatic deployments on push
  • Backend: Azure Function App - Serverless execution of image generation and analytics APIs
  • Database: MongoDB - Cloud-hosted for analytics data persistence

πŸ“š Documentation

βš™οΈ What It Does

  1. Cover Image Generation: Create custom cover images with customizable text, colors, fonts, and size presets
  2. Real-time Preview: See changes instantly as you adjust design parameters
  3. Color Contrast Validation: WCAG AA compliance checking ensures all generated images are accessible (β‰₯ 4.5:1 contrast ratio)
  4. Activity Tracking: All generate and download actions are logged to MongoDB
  5. Analytics Dashboard: /analytics route displays comprehensive metrics with interactive charts:
    • Total clicks (combined, generate, download)
    • Monthly trends (12-month line chart)
    • Font and size usage distribution (pie charts)

πŸš€ Key Features & Technical Highlights

Frontend Architecture

  • Full-Stack TypeScript: Type-safe code from frontend to backend
  • React Components: Modular, reusable UI components with proper separation of concerns
  • Real-time Preview: Instant updates as users customize designs
  • Color Contrast Validation: Debounced WCAG AA compliance checking with real-time visual feedback
  • Responsive Design: Mobile-first approach with optimized layouts
  • Custom Hooks: useAnalytics for data fetching, useContrastCheck for accessibility validation
  • Accessibility: WCAG 2.1 AA compliant with semantic HTML, ARIA attributes, and contrast validation

Backend Architecture

  • Serverless Azure Functions: Scalable, cost-efficient image generation
  • Node.js Canvas: High-quality PNG rendering
  • WCAG Color Contrast Validation: Ensures all generated images meet accessibility standards (β‰₯ 4.5:1 ratio)
  • MongoDB Integration: Analytics data persistence and aggregation
  • API Endpoints: RESTful design for image generation and analytics queries

Code Quality & Deployment

  • Comprehensive Testing: Unit tests for both frontend (Vitest) and backend
  • Code Quality: Automated linting and formatting with Biome
  • Multi-Cloud Deployment: Frontend on Vercel, backend on Azure Function App
  • CI/CD Ready: Automated testing and deployment pipelines

🧠 Why This Project

This project demonstrates:

  • βœ… Full-stack TypeScript application with end-to-end type safety
  • βœ… Serverless architecture handling concurrent requests efficiently
  • βœ… Multi-cloud integration (Vercel + Azure) with production-ready configuration
  • βœ… Data analytics from collection to visualization
  • βœ… Comprehensive testing and code quality standards
  • βœ… WCAG 2.1 AA accessibility compliance
  • βœ… Clean, maintainable codebase with clear documentation

πŸ“‚ Project Structure

cover-craft/
β”œβ”€β”€ frontend/                 # Next.js frontend application
β”‚   └── src/
β”‚       β”œβ”€β”€ app/             # Next.js app router pages
β”‚       β”œβ”€β”€ components/      # React components
β”‚       β”œβ”€β”€ hooks/           # Custom React hooks
β”‚       └── lib/             # Utilities and API functions
β”œβ”€β”€ api/                      # Azure Functions backend
β”‚   └── src/
β”‚       β”œβ”€β”€ functions/       # Azure Function endpoints
β”‚       └── assets/          # Fonts for image generation
β”œβ”€β”€ docs/                     # Architecture and development docs
└── README.md                # This file

πŸ“Š Analytics Dashboard

The /analytics page provides real-time insights into user engagement:

Chart Purpose
Total Clicks Bar chart showing combined, generate, and download totals
Monthly Trends 12-month line chart tracking generate/download activity
Font Usage Pie chart of font popularity
Size Usage Pie chart of size preset preferences

All data is persisted in MongoDB and aggregated on-demand. Built with recharts for interactive, responsive visualizations.

πŸƒ Getting Started

Prerequisites

  • Node.js 22+ (LTS recommended, tested on Node 24)
  • npm or yarn
  • Azure Functions Core Tools (for local backend development)
  • MongoDB connection string (for analytics features)

Installation

  1. Clone the repository:
git clone https://github.com/victoriacheng15/cover-craft.git
cd cover-craft
  1. Install dependencies:
# Frontend
cd frontend && npm install && cd ..

# Backend
cd api && npm install && cd ..

Running Locally

Terminal 1 - Frontend:

cd frontend
npm run dev

Visit http://localhost:3000

Terminal 2 - Backend:

cd api
npm run prestart  # Compile TypeScript
npm start         # Start Azure Functions locally

Backend available at http://localhost:7071

πŸ§ͺ Testing & Code Quality

# Frontend
cd frontend
npm run test      # Run tests
npm run lint      # Lint code
npm run format    # Format code

# Backend
cd api
npm run test      # Run tests
npm run lint      # Lint code

β™Ώ Accessibility

This project is built with accessibility in mind:

  • Semantic HTML and ARIA attributes
  • WCAG 2.1 AA color contrast ratios
  • Screen reader announcements for dynamic content
  • Visible focus indicators

See Accessibility Standards in the frontend architecture documentation for details.

About

Serverless cover image generator on Azure Functions (Node.js/Canvas). Users customize text, fonts & colors; exports PNGs + logs preferences to MongoDB for analytics.

Topics

Resources

License

Stars

Watchers

Forks

Languages