β ALL TASKS COMPLETED - October 4, 2025
The Canva-like visual editor is now fully functional!
π Try it:npm run dev
β http://localhost:3000/editor
What's New:
- β Canvas editor with Fabric.js
- β Text & Shape tools
- β Properties & Layers panels
- β Undo/Redo, Copy/Paste
- β Zoom, Pan, Grid system
- β Full keyboard shortcuts
π Docs: Quick Start | Full Details | Phase 2 Summary
## π¦ Overview DocMagic is a TypeScript-based documentation utility built with Next.js and Tailwind CSS. It helps teams manage, preview, and share docs with ease.
- Modular component structure
- Custom hooks for dynamic behavior
- Tailwind-powered styling
- Type-safe architecture with clear folder separation
git clone https://github.com/Muneerali199/DocMagic.git
cd DocMagic
npm install
npm run dev
<div align="center">
[](https://nextjs.org/)
[](https://reactjs.org/)
[](https://www.typescriptlang.org/)
[](https://tailwindcss.com/)
[](https://supabase.com/)
[](https://ai.google.dev/)
[](https://stripe.com/)
[](https://www.framer.com/motion/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/docmagic-ai/docmagic)
[](https://docmagic1.netlify.app)
[](https://github.com/docmagic-ai/docmagic/releases)
[](http://makeapullrequest.com)
[](./CONTRIBUTING.md)
<br />

### π **Transform Ideas into Professional Documents with AI Magic**
**DocMagic** is a **100% open source**, cutting-edge AI-powered document creation platform that revolutionizes how professionals create stunning documents. Built by the community, for the community - simply describe what you need, and watch as our advanced AI transforms your ideas into polished resumes, captivating presentations, comprehensive CVs, and professional letters in seconds.
<br />
### π― **50,000+ Documents Created** β’ π **99% Success Rate** β’ β **4.9/5 User Rating** β’ π **50+ Countries**
> _"Create professional documents in seconds with AI magic β¨"_
<br />
[](https://docmagic1.netlify.app)
[](https://docmagic1.netlify.app/about)
[](https://github.com/docmagic-ai/docmagic/fork)
[](./CONTRIBUTING.md)
[](./API.md)
</div>
---
## β¨ Core Features & Capabilities
### π€ **AI-Powered Document Generation**
- **π― Smart Resume Builder**: Create professional resumes with Gemini AI 2.0 Flash and 9-step guided workflow

- **π Presentation Generator**: Generate complete slide decks with outlines, themes, and shareable public URLs

- **π CV Creator**: Build comprehensive curriculum vitae with intelligent formatting

- **βοΈ Letter Composer**: Draft professional letters for any purpose

- **π ATS Resume Analyzer**: Advanced ATS compatibility scoring with detailed optimization feedback
<p float="left">
<img src="screenshots/ATS.png" width="49%" />
<img src="screenshots/AtsAnalysis.png" width="49%" />
</p>
- **π¨ Professional Templates**: ATS-optimized templates with modern glass morphism design

- **π Progress Tracking**: Visual progress indicators and step-by-step completion tracking

- **π Presentation Sharing**: Share presentations via public URLs with privacy controls and anonymous viewing
### π¨ **Modern UI/UX Design**
- **β¨ Glass Morphism Interface**: Modern glass-effect components with subtle transparency and blur effects
- **π Gradient Magic**: Dynamic bolt gradients and shimmer effects throughout the interface
- **π Floating Animations**: Smooth floating orbs and animated background elements powered by Framer Motion
- **π± Responsive Excellence**: Mobile-first design optimized for all screen sizes
- **π Dark/Light Theme**: Seamless theme switching with next-themes
- **βΏ Accessibility First**: WCAG 2.1 AA compliant components
- **π― Magical Professionalism**: Design philosophy combining cutting-edge visual effects with professional usability
- **Micro-Interactions**: Hover effects, scale transitions, and pulse animations for enhanced user engagement
### π€ **AI-Powered Document Generation**
- **Smart Text Processing**: Advanced Gemini AI integration for intelligent content generation
- **Context-Aware Creation**: AI understands industry standards and target audience requirements
- **Multiple Document Types**:
- π **Professional Resumes** with ATS optimization
- π― **Stunning Presentations** with smart layouts, charts, and shareable public URLs
- π **Shareable Presentations** with privacy controls and anonymous viewing support
- π **Comprehensive CVs** for academic and research positions
- βοΈ **Business Letters** with perfect tone and formatting
### π οΈ **Professional Tools & Features**
- **Progressive Web App (PWA)**: Install DocMagic as a native app on any device with offline support and enhanced performance
- **Advanced ATS Analyzer**: Comprehensive resume scanning with detailed scoring and optimization suggestions
- **Professional Template Library**: Curated collection of ATS-optimized, modern templates with glass morphism design
- **Guided Resume Builder**: 9-step workflow with progress tracking and intelligent navigation
- **Smart Editing**: Intuitive WYSIWYG editor with real-time preview and mobile-first design
- **Enhanced Export Options**: Download as PDF, DOCX, or PPTX with improved formatting and ATS compatibility
- **Presentation Sharing**: Generate shareable public URLs with one-click sharing and privacy controls
- **Anonymous Viewing**: Public presentations viewable without authentication for seamless sharing
- **Chart Integration**: Automatic data visualization for presentations using Recharts
- **Mobile-Responsive Navigation**: Touch-optimized interface that works perfectly on all devices
- **π Comprehensive About Page**: Detailed information about features, technology, security, and roadmap accessible at `/about`
- **π§ Intuitive Navigation**: Clean header with easy access to Resume, Presentation, Letter tools, and About page
- **Image Integration**: Professional stock photos from Pexels API
## π οΈ Tech Stack & Architecture
### π¨ **Frontend Excellence**
- **Next.js 15** - Latest React framework with App Router and Server Components
- **TypeScript 5.2** - Full type safety and enhanced developer experience
- **Tailwind CSS 3.3** - Utility-first styling with custom animations and gradients
- **Radix UI** - Accessible, unstyled component primitives for maximum customization
- **Framer Motion 12** - Smooth animations and micro-interactions
- **Lucide React** - 1000+ beautiful, customizable SVG icons
- **React Hook Form** - Performant forms with validation
- **Zustand** - Lightweight state management
### π§ **Advanced Component System**
- **π¨ Radix UI Foundation**: 25+ accessible components including dialogs, dropdowns, and forms
- **π Form Management**: React Hook Form with Zod validation for type-safe forms
- **π Data Visualization**: Recharts integration for analytics and progress tracking
- **πͺ Interactive Elements**: Carousels, accordions, and collapsible content
- **π― Smart Inputs**: OTP inputs, date pickers, and file upload with drag-and-drop
- **π Toast Notifications**: Sonner-powered notifications for user feedback
### π **Authentication & Security**
- **π‘οΈ Supabase Auth**: Secure user authentication with JWT tokens
- **π€ User Management**: Registration, login, password reset, and profile management
- **π Protected Routes**: Client-side route protection and redirects
- **π Session Management**: Persistent sessions with automatic token refresh
- **π Environment Security**: Secure API key management and environment variables
### π³ **Payment & Subscription System**
- **π° Stripe Integration**: Secure payment processing with Stripe
- **π Subscription Management**: Pro/Free tier management with usage limits
- **πͺ Customer Portal**: Self-service billing and subscription management
- **π Usage Tracking**: Monitor document generation limits and analytics
- **π Webhook Handling**: Real-time payment and subscription status updates
- **Glass Morphism Design**: Custom CSS with backdrop-blur and transparency effects
- **Responsive Grid System**: Mobile-first approach with breakpoint optimization
- **Custom Animations**: Floating orbs, shimmer effects, and gradient transitions
- **Accessibility First**: ARIA compliance and keyboard navigation support
- **Theme System**: Dark/light mode with system preference detection
### ποΈ **Backend & Database**
- **Supabase** - PostgreSQL with real-time subscriptions and Row Level Security
- **Supabase Auth** - OAuth providers, magic links, and secure session management
- **Database Migrations** - Version-controlled schema changes
- **Real-time Updates** - Live collaboration features
### π€ **AI & External Services**
- **Google Gemini AI** - Advanced language model for intelligent content generation
- **Pexels API** - Professional stock photography integration
- **Document Parsers** - PDF, DOCX parsing with Mammoth.js and pdf-parse
- **Export Libraries** - jsPDF, docx, and pptxgenjs for multi-format downloads
### π³ **Payments & Subscriptions**
- **Stripe Integration** - Secure payment processing with webhooks
- **Subscription Management** - Tiered pricing with usage tracking
- **Customer Portal** - Self-service billing and subscription management
### π **Deployment & Performance**
- **Netlify** - Edge deployment with automatic builds and previews
- **Vercel Ready** - Alternative deployment configuration included
- **Performance Optimized** - Image optimization, code splitting, and caching strategies
## π¨ UI/UX Design Philosophy
### β¨ **Modern Glass Morphism Interface**
DocMagic features a cutting-edge design system built around glass morphism principles, creating a sophisticated and intuitive user experience:
- **Glass Effects**: Subtle transparency and backdrop-blur effects throughout the interface
- **Dynamic Gradients**: Custom "bolt gradients" that create visual depth and energy
- **Floating Elements**: Animated orbs and particles that respond to user interactions
- **Shimmer Animations**: Subtle shine effects that guide user attention
- **Responsive Typography**: Fluid text scaling that adapts to all screen sizes
### π― **User Experience Highlights**
#### π± **Mobile-First Responsive Design**
- Optimized touch targets for mobile devices
- Swipe gestures and touch-friendly interactions
- Progressive enhancement for larger screens
- Consistent experience across all devices
#### π **Intelligent Theme System**
- Automatic dark/light mode detection based on system preferences
- Smooth theme transitions with preserved user state
- High contrast ratios for accessibility compliance
- Custom color schemes for different document types
#### β‘ **Performance-Optimized Interactions**
- 60fps animations using hardware acceleration
- Lazy loading for optimal page speed
- Debounced search and form inputs
- Optimistic UI updates for instant feedback
## πΈ Platform Screenshots
<div align="center">
### π **Landing Page with Glass Morphism Design**
<img src="https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg?auto=compress&cs=tinysrgb&w=1200&h=600" alt="DocMagic Landing Page" width="90%"/>
<p><em>Hero section with floating animations and gradient effects</em></p>
### π **AI Resume Generator Interface**
<img src="https://images.pexels.com/photos/3184292/pexels-photo-3184292.jpeg?auto=compress&cs=tinysrgb&w=1200&h=600" alt="Resume Generator" width="90%"/>
<p><em>Intelligent resume builder with real-time ATS optimization</em></p>
### π― **Presentation Studio with Smart Layouts**
<img src="https://images.pexels.com/photos/3184293/pexels-photo-3184293.jpeg?auto=compress&cs=tinysrgb&w=1200&h=600" alt="Presentation Creator" width="90%"/>
<p><em>Professional slide creator with automatic chart generation</em></p>
## ποΈ **Technical Architecture**
### π **Frontend Stack**
```typescript
// Core Framework
Next.js 15.4.0 // React framework with App Router
React 18.3.1 // UI library with concurrent features
TypeScript 5.8.3 // Type-safe development
// Styling & UI
Tailwind CSS 3.4.17 // Utility-first CSS framework
Radix UI // Accessible component primitives
Framer Motion 12.23.6 // Animation library
next-themes 0.4.6 // Theme management
// Forms & Validation
React Hook Form 7.60.0 // Performant forms
Zod 3.25.76 // Schema validation
// Database & Auth
Supabase // PostgreSQL database + Auth
@supabase/auth-helpers-nextjs 0.10.0
@supabase/supabase-js 2.52.0
// AI & Generation
Google Gemini AI // Document generation
@google/generative-ai 0.3.1 // Official Gemini SDK
// Payments
Stripe 14.25.0 // Payment processing
@stripe/stripe-js 3.5.0 // Client-side Stripe
// Document Processing
mammoth 1.9.1 // DOCX parsing
pdf-parse 1.1.1 // PDF parsing
docx 8.5.0 // DOCX generation
jspdf 2.5.2 // PDF generation
pptxgenjs 3.12.0 // PowerPoint generation
graph LR
A[User Input] --> B[AI Processing]
B --> C[Gemini AI 2.0]
C --> D[Content Generation]
D --> E[Template Application]
E --> F[Export Options]
F --> G[PDF/DOCX/PPTX]
Real-time resume analysis with actionable insights
docmagic/
βββ app/ # Next.js app directory
β βββ api/ # API routes
β β βββ analyze/ # Resume analysis endpoints
β β βββ auth/ # Authentication endpoints
β β βββ generate/ # Document generation endpoints
β β βββ send-email/ # Email sending functionality
β β βββ stripe/ # Stripe payment integration
β β βββ user/ # User data endpoints
β βββ auth/ # Authentication pages
β βββ cv/ # CV generator page
β βββ letter/ # Letter generator page
β βββ presentation/ # Presentation generator page
β βββ resume/ # Resume generator pages
β βββ settings/ # User settings page
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout component
β βββ page.tsx # Home page
βββ components/ # React components
β βββ auth-provider.tsx # Authentication context provider
β βββ document-card.tsx # Document type card component
β βββ features-section.tsx # Features showcase section
β βββ hero-section.tsx # Landing page hero section
β βββ letter/ # Letter-specific components
β βββ presentation/ # Presentation-specific components
β βββ resume/ # Resume-specific components
β βββ site-header.tsx # Navigation header
β βββ sponsor-banner.tsx # Sponsor information banner
β βββ subscription-button.tsx # Subscription management
β βββ testimonials-section.tsx # User testimonials
β βββ theme-provider.tsx # Dark/light theme provider
β βββ theme-toggle.tsx # Theme toggle button
β βββ ui/ # UI components (shadcn/ui)
βββ hooks/ # Custom React hooks
β βββ use-subscription.ts # Subscription state management
β βββ use-toast.ts # Toast notifications
βββ lib/ # Utility libraries
β βββ gemini.ts # Google Gemini AI integration
β βββ parsers/ # Document parsing utilities
β βββ stripe.ts # Stripe payment configuration
β βββ supabase/ # Supabase client configuration
β βββ utils.ts # General utility functions
βββ public/ # Static assets
βββ supabase/ # Supabase configuration
β βββ migrations/ # Database migration files
βββ types/ # TypeScript type definitions
β βββ supabase.ts # Supabase database types
βββ .env.local # Environment variables (not in repo)
βββ .eslintrc.json # ESLint configuration
βββ .gitignore # Git ignore file
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # MIT license
βββ README.md # Project documentation
βββ middleware.ts # Next.js middleware
βββ netlify.toml # Netlify deployment configuration
βββ next.config.js # Next.js configuration
βββ package.json # Project dependencies
βββ postcss.config.js # PostCSS configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
Visit our comprehensive About Page at https://docmagic1.netlify.app/about to explore:
- π― Mission & Vision - Our commitment to democratizing document creation
- β‘ Core Features - AI-powered tools and capabilities
- π οΈ Technology Stack - Modern tech powering DocMagic
- π¨ Design Philosophy - "Magical Professionalism" approach
- π Security & Quality - Enterprise-grade security measures
- πΊοΈ Product Roadmap - Exciting features coming in 2025-2026
- π₯ Community - Join our open source community
Make sure to install these before setting up the project:
- Git β for cloning the repository
- Node.js (LTS version) β includes npm for package management
- (Optional) Docker Desktop β for local database/testing (if needed)
- (Recommended) Visual Studio Code β code editor
After installing the prerequisites, open your Command Prompt, PowerShell, or Windows Terminal and run the following commands to clone the DocMagic repository and navigate into the project folder:
git clone https://github.com/Muneerali199/DocMagic.git
cd DocMagic
This will download the project's source code to your local machine and prepare you to install dependencies in the next step.
Once you have cloned the repository and navigated into the project folder, install the necessary packages by running one of the following commands in your terminal:
Using npm:
npm install
This command will download and install all the required dependencies for the DocMagic project.
After installing the project dependencies, you need to set up your environment variables for local development.
-
Copy the example environment file to a new file named
.env.local
using this command in Command Prompt:copy .env.example .env.local
(If you're using PowerShell or WSL, you can use
cp .env.example .env.local
instead.) -
Open the
.env.local
file in your code editor and add the required API keys, database URLs, or other credentials as needed for your setup.
Make sure to save .env.local
βthis file allows your app to connect to external services and databases during development.
Now that your environment variables are configured, you can launch the project locally.
Using npm:
npm run dev
π That's it ! Open http://localhost:3000 to see DocMagic in action.
Create a .env.local
file in the root directory:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_key
# Stripe Configuration
STRIPE_SECRET_KEY=your_stripe_secret_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_WEBHOOK_SECRET=your_webhook_secret
# Application URL
NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Create Supabase Project:
# Visit https://supabase.com/dashboard # Create new project # Copy your project URL and anon key
-
Run Migrations:
-- The migrations are in /supabase/migrations/ -- They will be automatically applied when you set up Supabase
-
Set up Authentication:
# Enable Email/Password auth in Supabase dashboard # Configure email templates (optional) # Set up OAuth providers (optional)
-
Get Gemini API Key:
# Visit https://ai.google.dev/ # Create API key # Add to GEMINI_API_KEY in .env.local
-
Configure AI Models:
// lib/gemini.ts already configured with: // - gemini-2.0-flash for fast generation // - Error handling and retries // - JSON parsing and validation
-
Stripe Configuration:
# Visit https://dashboard.stripe.com/ # Get your API keys # Set up webhook endpoint: /api/stripe/webhook
-
Webhook Events:
// Configure these events in Stripe dashboard: customer.subscription.created; customer.subscription.updated; customer.subscription.deleted; invoice.payment_succeeded; invoice.payment_failed;
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript checks
# Database
npx supabase start # Start local Supabase
npx supabase stop # Stop local Supabase
npx supabase reset # Reset local database
# Deployment
npm run deploy # Deploy to Netlify
vercel --prod # Deploy to Vercel
docmagic/
βββ π app/ # Next.js App Router
β βββ π api/ # API routes
β β βββ π generate/ # AI generation endpoints
β β βββ π stripe/ # Payment webhooks
β β βββ π auth/ # Authentication
β βββ π resume/ # Resume pages
β βββ π presentation/ # Presentation pages
β βββ π letter/ # Letter pages
β βββ π cv/ # CV pages
βββ π components/ # React components
β βββ π ui/ # Radix UI components
β βββ π resume/ # Resume-specific components
β βββ π presentation/ # Presentation components
β βββ π letter/ # Letter components
βββ π lib/ # Utility libraries
β βββ π gemini.ts # AI integration
β βββ π stripe.ts # Payment processing
β βββ π supabase.ts # Database client
β βββ π parsers/ # Document parsers
βββ π hooks/ # Custom React hooks
βββ π types/ # TypeScript definitions
βββ π supabase/ # Database migrations
βββ π public/ # Static assets
POST /api/generate/resume
Content-Type: application/json
{
"prompt": "Software engineer with 5 years React experience",
"name": "John Doe",
"email": "[email protected]",
"phone": "+1234567890",
"location": "San Francisco, CA"
}
POST /api/generate/presentation
Content-Type: application/json
{
"prompt": "Marketing strategy for Q1 2025",
"pageCount": 10,
"template": "modern-business"
}
POST /api/generate/diagram
Content-Type: application/json
{
"prompt": "User authentication flow with OAuth",
"diagramType": "flowchart"
}
POST /api/analyze/resume
Content-Type: multipart/form-data
{
"file": File,
"jobDescription": "Job requirements text"
}
POST /api/stripe/create-checkout
Content-Type: application/json
{
"priceId": "price_xxx",
"successUrl": "https://app.com/success",
"cancelUrl": "https://app.com/cancel"
}
For complete API documentation, see API.md.
DocMagic is optimized for Netlify deployment:
# Automatic deployment
git push origin main
# Manual deployment
npm run build
netlify deploy --prod --dir=.next
Configuration: The netlify.toml
file is pre-configured with:
- Next.js plugin
- API route handling
- CORS headers
- Environment variables
Alternative deployment to Vercel:
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel --prod
# Dockerfile included for containerized deployment
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]
# Unit tests
npm run test
# E2E tests
npm run test:e2e
# Coverage report
npm run test:coverage
For detailed testing guidelines, see TESTING.md.
Ensure you have the following installed:
- Node.js: Version 18 or higher (includes npm). Download from nodejs.org.
- Git: For cloning the repository. Install from git-scm.com.
- A Supabase account for database and authentication. Sign up at supabase.com.
- A Google Gemini API key for AI-powered document generation. Obtain from Google AI Studio.
- A Stripe account for payment processing (optional for local testing without payments). Sign up at stripe.com.
-
Clone the Repository: Clone the project to your local machine and navigate to the project directory:
git clone https://github.com/yourusername/docmagic.git cd docmagic
-
Install dependencies:
npm install
-
Set Up Supabase:
- Log in to your Supabase dashboard and create a new project.
- In the Supabase project, go to Settings > API to find your NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY.
- Go to SQL Editor and run the SQL migrations found in the supabase/migrations/ directory to set up the database schema (Users, Subscriptions, Documents tables).
- Enable Supabase Auth in the Supabase dashboard under Authentication > Settings and configure email authentication.
- Obtain Google Gemini API Key:
- Visit Google AI Studio and create an API key for Gemini 2.0 Flash.
- Save the key as GEMINI_API_KEY for use in the environment variables.
-
Set up environment variables: Create a
.env.local
file with:NEXT_PUBLIC_SUPABASE_URL=your_supabase_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key GEMINI_API_KEY=your_gemini_api_key STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret STRIPE_PRICE_ID=your_stripe_price_id NEXT_PUBLIC_APP_URL=http://localhost:3000
-
Run Database Migrations: If you havenβt already applied migrations via the Supabase dashboard, you can use the Supabase CLI:
npm install -g supabase supabase init supabase login supabase db push
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
The application is deployed on Netlify. To deploy your own instance:
- Push your code to GitHub
- Connect your repository to Netlify
- Configure the build settings:
- Build command:
npm run build
- Publish directory:
.next
- Build command:
- Add your environment variables in the Netlify dashboard
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/generate/resume |
POST | Generate a resume | { prompt, name, email } |
Resume JSON |
/api/generate/guided-resume |
POST | Generate guided resume | { personalInfo, workExperience, ... } |
Resume JSON |
/api/generate/presentation |
POST | Generate presentation | { prompt, pageCount } |
Slides array |
/api/generate/presentation-outline |
POST | Generate outline | { prompt, pageCount } |
Outline array |
/api/generate/presentation-full |
POST | Generate full presentation | { outlines, template, prompt } |
Slides array |
/api/generate/letter |
POST | Generate letter | { prompt, fromName, toName, letterType, ... } |
Letter JSON |
/api/generate/resume-guidance |
POST | Get resume guidance | { step, targetRole, existingData } |
Guidance JSON |
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/analyze/resume |
POST | Analyze resume for ATS | FormData with file and jobDescription |
Analysis JSON |
DocMagic is proudly open source! We believe in the power of community-driven development and welcome contributions from developers, designers, and users worldwide. Whether you're a seasoned developer or just starting your open source journey, there's a place for you in our community!
- Report bugs using our issue template
- Fix existing bugs and earn contributor recognition
- Help improve stability and user experience
- Check our roadmap for planned features
- Propose new features via GitHub Discussions
- Implement features that benefit the entire community
- Improve documentation and tutorials
- Help other users in discussions and issues
- Create blog posts, videos, or tutorials about DocMagic
- Translate the interface to new languages
- Contribute to UI/UX improvements
- Design new templates and themes
- Improve accessibility features
- Help maintain dependencies by testing pull requests created by Dependabot
- Validate automated updates using the GitHub Actions workflow to ensure build stability.
- Report any issues with updates or suggest improvements to the automation process.
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/yourusername/docmagic.git
- Set up development environment: Follow our setup guide
- Find an issue: Check good first issues
- Create a branch:
git checkout -b feature/your-feature-name
- Make your changes and test thoroughly
- Submit a pull request with a clear description
We celebrate our contributors! Every contribution gets:
- π Public recognition in our README and releases
- π Contributor badge on your GitHub profile
- π Priority support for your own issues
- π Exclusive swag for significant contributions
- πΌ Portfolio showcase opportunities
For detailed guidelines, see CONTRIBUTING.md.
Made with contrib.rocks.
DocMagic is free and open source software licensed under the MIT License. This means you can:
- β Use DocMagic for any purpose (personal, commercial, educational)
- β Modify the source code to fit your needs
- β Distribute your own versions
- β Contribute back to the community
- β Fork and create your own variants
MIT License
Copyright (c) 2025 DocMagic Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
See the LICENSE file for the complete license text.
Encountering setup or runtime issues? Here are some common problems and how to fix them quickly:
π« 1. Environment Variables Not Loaded Symptoms: Blank pages, failed API calls, authentication not working. Fix:
-
Make sure .env.local exists in the root directory.
-
Confirm youβve filled in all required variables (e.g. NEXT_PUBLIC_SUPABASE_URL, GEMINI_API_KEY, STRIPE_SECRET_KEY, etc.).
-
Restart your dev server after updating .env.local.
π 2. Supabase Auth Not Working Symptoms: Login/Signup not working, "invalid credentials" error. Fix:
-
Ensure Supabase email/password auth is enabled in your project dashboard.
-
Double-check NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY.
-
Check browser console for CORS or network errors.
π§ 3. Gemini AI API Errors Symptoms: Resume/Letter/Presentation generation fails or gives 500 error. Fix:
-
Ensure your GEMINI_API_KEY is correct and has usage quota.
-
Check the Gemini model being used (gemini-2.0-flash).
-
Review logs in lib/gemini.ts for response or validation errors.
π³ 4. Stripe Integration Issues Symptoms: Subscription not created, payment failed, webhook not triggering. Fix:
-
Verify all Stripe keys are added correctly in .env.local.
-
Ensure your webhook endpoint /api/stripe/webhook is configured in the Stripe dashboard.
-
Use Stripe CLI (stripe listen) for local testing.
π 5. Document Generation Fails or Times Out Symptoms: Resume/Presentation not rendering or returning empty content. Fix:
-
Check if Gemini AI prompt structure is valid (non-empty fields).
-
Ensure your system has internet access (required to call external APIs).
-
Inspect console and network tab for failed API calls.
π§ͺ 6. Tests Not Running or Failing Unexpectedly Symptoms: npm run test crashes or gives missing module errors. Fix:
-
Ensure all dependencies are installed via npm install.
-
Try running npm run type-check to validate your types.
-
If using Supabase locally, ensure it's running: npx supabase start.
π 7. "Failed to fetch" or 500 Errors in API Routes Symptoms: API routes return 404 or 500 errors. Fix:
-
Make sure you're using npm run dev to run the Next.js server (not just npm start).
-
Ensure folder structure inside app/api/ is correct and follows Next.js App Router format.
-
Check logs in the terminal for specific stack traces.
π¦ 8. Netlify/Vercel Deployment Errors Symptoms: Build fails, blank screen after deployment. Fix:
-
Confirm NEXT_PUBLIC_APP_URL and other env vars are set in Netlify/Vercel dashboard.
-
Set build command as npm run build and publish directory to .next.
-
Make sure next.config.js has output: "standalone" if using serverless deploys.
π³ 9. Docker Build Fails Symptoms: Errors during npm ci or npm run build inside Docker container. Fix:
-
Use the production image by copying only essential files before install.
-
Ensure you are using Node 18+ in your Dockerfile.
-
Clear Docker cache and rebuild: docker system prune -a
docker build --no-cache -t docmagic .
Still Need Help? Check GitHub Issues
Ask in our Discord Community
Contact us at [email protected]
- Next.js Team - For the amazing React framework
- Vercel - For hosting and deployment platform
- Supabase - For the backend-as-a-service platform
- Google AI - For Gemini AI integration
- Radix UI - For accessible component primitives
- Tailwind CSS - For the utility-first CSS framework
- Stripe - For payment processing
- Open Source Community - For the amazing tools and libraries
Got questions? Check out our comprehensive FAQ for answers to common questions about using and contributing to DocMagic.
- π Documentation: docs.docmagic.com
- π¬ Discord Community: Join our Discord
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- General: [email protected]
- Support: [email protected]
- Business: [email protected]
- Security: [email protected]
- Twitter: @DocMagicAI
- LinkedIn: DocMagic Company
- GitHub: DocMagic Organization
Made with β€οΈ by the DocMagic Team
Transforming ideas into professional documents, one AI generation at a time.
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/send-email |
POST | Send email | { to, subject, content, letterContent, ... } |
Success status |
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/auth/register |
POST | Register user | { name, email, password } |
User data |
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/stripe/check-subscription |
GET | Check subscription status | - | Subscription status |
/api/stripe/create-checkout |
POST | Create checkout session | - | Checkout URL |
/api/stripe/create-portal |
POST | Create customer portal | - | Portal URL |
/api/stripe/webhook |
POST | Handle Stripe webhooks | Stripe event | Success status |
DocMagic uses Stripe for handling subscription payments. This section provides a comprehensive guide to setting up and managing the Stripe integration.
Add the following environment variables to your .env.local
file:
# Stripe
STRIPE_SECRET_KEY=your_stripe_secret_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret
STRIPE_PRICE_ID=your_stripe_price_id # The ID of the price for your subscription plan
NEXT_PUBLIC_APP_URL=http://localhost:3000 # Your application URL
-
Create a Stripe Account
- Sign up at Stripe
- Retrieve your API keys from the Stripe Dashboard under Developers > API keys
-
Configure Products and Prices
- Go to Products in the Stripe Dashboard
- Create a new product (e.g., "Pro Subscription")
- Add a price for the product (e.g., $9.99/month)
- Note down the Price ID (e.g.,
price_abc123
)
-
Set Up Webhooks
- Go to Developers > Webhooks in the Stripe Dashboard
- Add an endpoint URL:
https://your-domain.com/api/stripe/webhook
- Add these events to listen for:
checkout.session.completed
invoice.payment_succeeded
customer.subscription.updated
customer.subscription.deleted
- Retrieve the webhook signing secret
-
Update Environment Variables
- Update
.env.local
with your Stripe keys and webhook secret - Set
STRIPE_PRICE_ID
to your subscription price ID
- Update
- Navigate to
/payment-demo
in your browser - Use one of the test card numbers below
- Enter any future expiry date, any 3-digit CVC, and any postal code
- Submit the form to test the payment flow
Card Number | Description |
---|---|
4242 4242 4242 4242 |
Successful payment |
4000 0025 0000 3155 |
3D Secure authentication required |
4000 0000 0000 0002 |
Payment failed |
4000 0082 6000 3178 |
Insufficient funds |
To test webhooks during development:
- Install the Stripe CLI: https://stripe.com/docs/stripe-cli
- Log in to your Stripe account:
stripe login
- Forward webhooks to your local server:
stripe listen --forward-to localhost:3000/api/stripe/webhook
- The CLI will provide a webhook signing secret. Add it to your
.env.local
:STRIPE_WEBHOOK_SECRET=whsec_...
- Successful Payment: Use card
4242 4242 4242 4242
- 3D Secure Flow: Use card
4000 0025 0000 3155
- Payment Failure: Use card
4000 0000 0000 0002
- Insufficient Funds: Use card
4000 0082 6000 3178
- Test Webhooks Locally
- Use the Stripe CLI to forward webhooks to your local server:
stripe listen --forward-to localhost:3000/api/stripe/webhook
- This will give you a webhook signing secret to use in your
.env.local
- Use the Stripe CLI to forward webhooks to your local server:
checkout.session.completed
: Creates a new subscription in the databaseinvoice.payment_succeeded
: Updates subscription details after successful paymentcustomer.subscription.updated
: Updates subscription status if changed in Stripecustomer.subscription.deleted
: Handles subscription cancellation
The main subscription flow is handled by the SubscriptionButton
component:
<SubscriptionButton isPro={isPro} />
- Never expose Stripe secret keys in client-side code
- Always verify webhook signatures
- Use environment variables for sensitive data
- Implement proper error handling and user feedback
-
Webhook Failures
- Verify the webhook signing secret matches your Stripe dashboard
- Check server logs for detailed error messages
- Ensure your server's clock is synchronized (NTP)
-
Checkout Issues
- Verify the Price ID exists in your Stripe account
- Check the browser console for JavaScript errors
- Ensure your Stripe API keys are in the correct mode (test/live)
-
Subscription Status
- Check the
subscriptions
table in your database - Verify the webhook events are being received and processed
- Check the
- Always use the latest version of the Stripe API
- Implement idempotency keys for critical operations
- Log all webhook events for debugging
- Set up monitoring for failed webhook deliveries
- Regularly test your integration with test cards
Endpoint | Method | Description | Request Body | Response |
---|---|---|---|---|
/api/user |
GET | Get user data | - | User data with subscription |
Authentication is handled by Supabase Auth. The system includes:
- User registration with email/password
- Secure login
- Protected routes with middleware
- User profile management
- Session persistence
The Supabase database includes the following tables:
id
(UUID, primary key)email
(text, unique)name
(text)password
(text, hashed)stripe_customer_id
(text, optional)created_at
(timestamp)updated_at
(timestamp)
id
(UUID, primary key)user_id
(UUID, foreign key to users)stripe_subscription_id
(text, unique)stripe_price_id
(text)stripe_current_period_end
(timestamp)status
(text)created_at
(timestamp)updated_at
(timestamp)
id
(UUID, primary key)user_id
(UUID, foreign key to users)title
(text)type
(text) - resume, presentation, letter, cvcontent
(jsonb) - document dataprompt
(text) - original user promptcreated_at
(timestamp)updated_at
(timestamp)
DocMagic offers a freemium model:
- Free tier: Basic document generation with limited features
- Pro tier: Unlimited documents, premium templates, and advanced features
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
See the CONTRIBUTING.md file for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js
- Supabase
- Tailwind CSS
- shadcn/ui
- Google Gemini AI
- Stripe
- Pexels for professional images
- Recharts for data visualization
- Netlify for hosting
We sincerely thank the amazing individuals who have contributed to DocMagic. Your time, effort, and ideas make this project better every day.
Want to contribute? Check out our CONTRIBUTING.md guide and submit your first PR!
Built with β€οΈ by the DocMagic Team
Designed by Xenonesis
Β© 2025 DocMagic. All rights reserved.