Skip to content

Commit 9c1ea92

Browse files
add color validation (#65)
* add UI for live update on color validation * add color validation for backend * update frontend and backend architecture and readme * format files * fix unit test cases and format files
1 parent 78ce6ff commit 9c1ea92

File tree

11 files changed

+613
-36
lines changed

11 files changed

+613
-36
lines changed

README.md

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,39 @@ A full-stack cover image generator application with built-in analytics dashboard
1919
- [DevOps Practices](./docs/devops_practice.md): Deployment strategies, CI/CD pipelines, infrastructure
2020
- [Learning Notes](./docs/learning_note.md): Key insights from development and deployment
2121

22-
2322
## ⚙️ What It Does
2423

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

3333
## 🚀 Key Features & Technical Highlights
3434

3535
### Frontend Architecture
36+
3637
- **Full-Stack TypeScript**: Type-safe code from frontend to backend
3738
- **React Components**: Modular, reusable UI components with proper separation of concerns
3839
- **Real-time Preview**: Instant updates as users customize designs
40+
- **Color Contrast Validation**: Debounced WCAG AA compliance checking with real-time visual feedback
3941
- **Responsive Design**: Mobile-first approach with optimized layouts
40-
- **Custom Hooks**: `useAnalytics` for data fetching and state management
41-
- **Accessibility**: WCAG 2.1 AA compliant with semantic HTML and ARIA attributes
42+
- **Custom Hooks**: `useAnalytics` for data fetching, `useContrastCheck` for accessibility validation
43+
- **Accessibility**: WCAG 2.1 AA compliant with semantic HTML, ARIA attributes, and contrast validation
4244

4345
### Backend Architecture
46+
4447
- **Serverless Azure Functions**: Scalable, cost-efficient image generation
4548
- **Node.js Canvas**: High-quality PNG rendering
49+
- **WCAG Color Contrast Validation**: Ensures all generated images meet accessibility standards (≥ 4.5:1 ratio)
4650
- **MongoDB Integration**: Analytics data persistence and aggregation
4751
- **API Endpoints**: RESTful design for image generation and analytics queries
4852

4953
### Code Quality & Deployment
54+
5055
- **Comprehensive Testing**: Unit tests for both frontend (Vitest) and backend
5156
- **Code Quality**: Automated linting and formatting with Biome
5257
- **Multi-Cloud Deployment**: Frontend on Vercel, backend on Azure Function App
@@ -55,6 +60,7 @@ A full-stack cover image generator application with built-in analytics dashboard
5560
## 🧠 Why This Project
5661

5762
This project demonstrates:
63+
5864
-**Full-stack TypeScript** application with end-to-end type safety
5965
-**Serverless architecture** handling concurrent requests efficiently
6066
-**Multi-cloud integration** (Vercel + Azure) with production-ready configuration
@@ -63,23 +69,20 @@ This project demonstrates:
6369
-**WCAG 2.1 AA accessibility** compliance
6470
-**Clean, maintainable codebase** with clear documentation
6571

66-
6772
## 📂 Project Structure
6873

69-
```
74+
```plaintext
7075
cover-craft/
7176
├── frontend/ # Next.js frontend application
72-
│ ├── src/
73-
│ │ ├── app/ # Next.js app router pages
74-
│ │ ├── components/ # React components (form, layout, UI, preview)
75-
│ │ ├── hooks/ # Custom React hooks (e.g., analytics fetching)
76-
│ │ └── lib/ # Utilities and API functions
77-
│ └── package.json
77+
│ └── src/
78+
│ ├── app/ # Next.js app router pages
79+
│ ├── components/ # React components
80+
│ ├── hooks/ # Custom React hooks
81+
│ └── lib/ # Utilities and API functions
7882
├── api/ # Azure Functions backend
79-
│ ├── src/
80-
│ │ ├── functions/ # Azure Function endpoints
81-
│ │ └── assets/ # Fonts for image generation
82-
│ └── package.json
83+
│ └── src/
84+
│ ├── functions/ # Azure Function endpoints
85+
│ └── assets/ # Fonts for image generation
8386
├── docs/ # Architecture and development docs
8487
└── README.md # This file
8588
```
@@ -100,20 +103,23 @@ All data is persisted in MongoDB and aggregated on-demand. Built with recharts f
100103
## 🏃 Getting Started
101104

102105
### Prerequisites
103-
- Node.js 18+
106+
107+
- Node.js 22+ (LTS recommended, tested on Node 24)
104108
- npm or yarn
105109
- Azure Functions Core Tools (for local backend development)
106110
- MongoDB connection string (for analytics features)
107111

108112
### Installation
109113

110114
1. Clone the repository:
115+
111116
```bash
112117
git clone https://github.com/victoriacheng15/cover-craft.git
113118
cd cover-craft
114119
```
115120

116121
2. Install dependencies:
122+
117123
```bash
118124
# Frontend
119125
cd frontend && npm install && cd ..
@@ -125,18 +131,22 @@ cd api && npm install && cd ..
125131
### Running Locally
126132

127133
**Terminal 1 - Frontend:**
134+
128135
```bash
129136
cd frontend
130137
npm run dev
131138
```
139+
132140
Visit `http://localhost:3000`
133141

134142
**Terminal 2 - Backend:**
143+
135144
```bash
136145
cd api
137146
npm run prestart # Compile TypeScript
138147
npm start # Start Azure Functions locally
139148
```
149+
140150
Backend available at `http://localhost:7071`
141151

142152
## 🧪 Testing & Code Quality
@@ -157,6 +167,7 @@ npm run lint # Lint code
157167
## ♿ Accessibility
158168

159169
This project is built with accessibility in mind:
170+
160171
- Semantic HTML and ARIA attributes
161172
- WCAG 2.1 AA color contrast ratios
162173
- Screen reader announcements for dynamic content

0 commit comments

Comments
 (0)