Skip to content

KpG782/certifikit

Repository files navigation

CertifiKit

A modern, open-source certificate generator built with Next.js 14 and Tailwind CSS. Create, customize, and export professional certificates with an intuitive drag-and-drop interface.

CertifiKit Preview

πŸš€ Features

  • πŸ” Secure Authentication: Protected routes with session management
  • 🎨 Drag & Drop Editor: Intuitive interface for positioning elements
  • πŸ“ Advanced Text Customization: Font selection, colors, sizing, and positioning
  • πŸ–ΌοΈ Template Management: Multiple pre-built templates with custom upload support
  • πŸ’Ύ High-Quality Export: Download certificates as PNG at 2x resolution
  • πŸŒ— Dark/Light Mode: Seamless theme switching
  • πŸ“± Responsive Design: Works flawlessly across all devices
  • ⚑ Real-Time Preview: See changes instantly as you edit
  • 🎯 Precise Positioning: Pixel-perfect element placement
  • πŸ”€ Local Font Support: Merriweather font loaded locally to avoid CORS issues
  • πŸ“§ Email Queue System: PostgreSQL-backed email queueing with n8n integration
  • πŸ”„ Auto-Refresh Status: Real-time email status monitoring (5-second intervals)
  • πŸ“¦ Batch Generation: Generate and queue multiple certificates at once
  • πŸŽ“ Professional Email Presets: 4 ready-to-use templates (Event, KPI, Internship, Custom)
  • 🌐 n8n Webhook Integration: Automated email sending via external workflow

πŸ“š Documentation

Quick Links

Email Integration

This system includes a complete email queue with:

  • PostgreSQL Database: For storing email queue and status
  • n8n Webhook: Automated email sending workflow
  • 4 Email Presets: Professional templates for different use cases
  • Batch Support: Queue multiple certificates with personalized emails
  • Status Tracking: Real-time monitoring with auto-refresh

πŸ” Authentication

The application features secure authentication to ensure only authorized users can create and manage certificates.

Default Credentials

Username: admin
Password: CertifiKit2024!

Security Features

  • Session-based authentication
  • Protected routes with middleware
  • Automatic redirect to login for unauthenticated users
  • Secure logout functionality
  • Client-side route protection
  • 7-day session duration

Changing Credentials

For production deployment, update the credentials in src/lib/auth.ts:

export const ADMIN_CREDENTIALS = {
  username: "your_new_username",
  password: "your_strong_password",
};

Better Practice - Use Environment Variables:

Create a .env.local file in the root directory:

NEXT_PUBLIC_ADMIN_USERNAME=your_username
NEXT_PUBLIC_ADMIN_PASSWORD=your_strong_password
SESSION_SECRET=your_random_secret_key
DATABASE_URL=postgresql://user:password@host:5432/database
N8N_WEBHOOK_URL=https://your-n8n-instance.com/webhook/certificate-email-api

Then update src/lib/auth.ts to use these variables:

export const ADMIN_CREDENTIALS = {
  username: process.env.NEXT_PUBLIC_ADMIN_USERNAME || "admin",
  password: process.env.NEXT_PUBLIC_ADMIN_PASSWORD || "CertifiKit2024!",
};

πŸ—οΈ Project Structure

certifikit/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ logo.svg              # Application logo
β”‚   └── templates/            # Certificate templates
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                  # Next.js app router
β”‚   β”‚   β”œβ”€β”€ page.tsx         # Landing page
β”‚   β”‚   β”œβ”€β”€ login/           # Authentication page
β”‚   β”‚   β”œβ”€β”€ dashboard/       # User dashboard
β”‚   β”‚   └── generator/       # Certificate editor
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ auth/            # Authentication components
β”‚   β”‚   β”‚   β”œβ”€β”€ login-form.tsx
β”‚   β”‚   β”‚   └── protected-route.tsx
β”‚   β”‚   β”œβ”€β”€ certificate/     # Core certificate components
β”‚   β”‚   β”‚   β”œβ”€β”€ canvas.tsx              # Main editing workspace
β”‚   β”‚   β”‚   β”œβ”€β”€ download-button.tsx     # PNG export functionality
β”‚   β”‚   β”‚   β”œβ”€β”€ draggable-text.tsx      # Text element manipulation
β”‚   β”‚   β”‚   β”œβ”€β”€ text-controls.tsx       # Text customization panel
β”‚   β”‚   β”‚   β”œβ”€β”€ image-controls.tsx      # Image management
β”‚   β”‚   β”‚   β”œβ”€β”€ template-selector.tsx   # Template browser
β”‚   β”‚   β”‚   └── batch-generator.tsx     # Bulk certificate generation
β”‚   β”‚   β”œβ”€β”€ layout/          # Layout components
β”‚   β”‚   β”‚   β”œβ”€β”€ navbar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ sidebar.tsx
β”‚   β”‚   β”‚   └── footer.tsx
β”‚   β”‚   β”œβ”€β”€ onboarding/      # User guidance
β”‚   β”‚   β”‚   β”œβ”€β”€ tour.tsx
β”‚   β”‚   β”‚   └── generator-tour.tsx
β”‚   β”‚   └── ui/              # Shadcn/ui components
β”‚   β”‚       β”œβ”€β”€ button.tsx
β”‚   β”‚       └── accordion.tsx
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── use-auth.ts      # Authentication hook
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ auth.ts          # Auth utilities
β”‚   β”‚   β”œβ”€β”€ utils.ts         # Helper functions
β”‚   β”‚   └── batch-generator.ts # Batch processing
β”‚   β”œβ”€β”€ types/
β”‚   β”‚   β”œβ”€β”€ certificates.ts  # Certificate type definitions
β”‚   β”‚   └── batch.ts         # Batch generation types
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   └── globals.css      # Global styles
β”‚   └── assets/
β”‚       └── fonts/           # Local font files
β”‚           β”œβ”€β”€ Merriweather_24pt-Bold.ttf
β”‚           └── Merriweather_24pt-Regular.ttf
β”œβ”€β”€ .env.local               # Environment variables (create this)
β”œβ”€β”€ next.config.js           # Next.js configuration
β”œβ”€β”€ tailwind.config.js       # Tailwind configuration
└── package.json

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./.next/
npm run start Preview your build locally, before deploying
npm run lint Run ESLint to check code quality

πŸ› οΈ Tech Stack

πŸ“ How to Use

  1. Login using your credentials

  2. Navigate to Generator from the dashboard

  3. Select a Template or upload your own certificate design

  4. Add Text Elements:

    • Click "Add Text" to create new elements
    • Drag elements to position them
    • Customize font, size, color, and alignment
  5. Add Images (optional):

    • Upload logos or graphics
    • Position and resize as needed
  6. Preview in Real-Time:

    • All changes appear instantly
    • Zoom in/out for precise editing
  7. Download Certificate:

    • Click "Download PNG" button
    • High-quality 2x resolution export
    • Custom filename with timestamp
  8. Batch Generation:

    • Upload CSV with recipient data
    • Generate multiple certificates at once
    • Queue emails for automated sending

πŸ’‘ Core Components

Canvas Component

Main editing workspace with drag & drop functionality, element selection, real-time preview, and canvas scaling.

DownloadButton Component

High-quality export featuring html2canvas integration, 2x scale for crisp output, CORS handling, and error management.

DraggableText Component

Text manipulation with free positioning, visual selection feedback, mouse-based dragging, and position updates.

TextControls Component

Customization panel including font family picker, size slider, color picker, and alignment options.

🎯 Customization

Adding New Templates

  1. Add template image to public/templates/
  2. Update template list in template-selector.tsx
  3. Configure default dimensions

Styling Changes

  • Modify Tailwind classes in components
  • Update colors in tailwind.config.js
  • Add custom CSS in globals.css

Font Customization

To use different fonts:

  1. Add font files to src/assets/fonts/
  2. Update @font-face in globals.css
  3. Reference in text controls

πŸ–ΌοΈ Image Export Quality

The download functionality generates professional-quality images:

  • 2x Resolution: Double the display resolution
  • Scale Factor: Configurable for higher quality
  • CORS Handling: useCORS and allowTaint enabled
  • Background: White (#ffffff) for compatibility
  • Format: PNG for lossless quality
  • File Naming: Auto-generated with timestamp

πŸ“± Responsive Design

The application adapts to all screen sizes with mobile-optimized interface, touch-friendly controls, responsive canvas scaling, adaptive sidebar, and mobile-first approach.

πŸ”’ Security Best Practices

  1. Change default credentials immediately after deployment
  2. Use environment variables for sensitive data
  3. Enable HTTPS in production (required for secure cookies)
  4. Implement rate limiting for auth endpoints
  5. Regular security audits of dependencies
  6. Secure session management with HTTP-only cookies
  7. Monitor access logs for unauthorized attempts

πŸš€ Deployment

Option 1: Docker Deployment (Recommended) 🐳

The easiest way to deploy CertifiKit is using Docker. See the Docker Deployment Guide for complete instructions.

Quick Start with Docker:

# Clone the repository
git clone https://github.com/KpG782/certifikit.git
cd certifikit

# Copy environment file
cp .env.example .env.local

# Edit .env.local with your credentials

# Build and run with Docker Compose
docker-compose up -d

# Access at http://localhost:3000

Option 2: Manual Deployment

Prerequisites

  • Node.js 18+ installed
  • npm or yarn package manager
  • PostgreSQL database (for email queue feature)
  • n8n instance (for email automation)

Steps

  1. Clone the repository

    git clone https://github.com/kenken64/certifikit.git
    cd certifikit
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env.local
    # Edit .env.local with your credentials
  4. Build for production

    npm run build
  5. Deploy to hosting provider

    • Vercel (Recommended): vercel --prod
    • Netlify: Connect repository
    • AWS/Azure: Use appropriate deployment tools
    • Ensure environment variables are set in hosting dashboard

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

🎨 Credits & Attributions

Icons & Images

Open Source Libraries

This project uses the following open-source libraries:

  • Next.js (MIT License) - React framework
  • React (MIT License) - UI library
  • Tailwind CSS (MIT License) - CSS framework
  • TypeScript (Apache-2.0 License) - Type safety
  • Shadcn/ui (MIT License) - UI components
  • html2canvas (MIT License) - Canvas rendering
  • Framer Motion (MIT License) - Animations
  • PostgreSQL (PostgreSQL License) - Database
  • n8n (Apache-2.0 License) - Workflow automation

All dependencies are properly licensed and included in this open-source project.

βš–οΈ Legal & Copyright Notice

Usage Rights

This software is provided as open-source under the MIT License. You are free to:

  • βœ… Use for personal and commercial projects
  • βœ… Modify and customize the code
  • βœ… Distribute modified versions
  • βœ… Include in proprietary software

Image Rights & Compliance

Important: While this software is open-source, users are responsible for ensuring they have proper rights to any images, logos, or content used in certificates:

Your Responsibilities:

  1. Template Images: Ensure you own or have permission to use certificate template designs
  2. Logos & Graphics: Verify you have rights to use any company logos or images
  3. Signatures: Obtain authorization before using signature images
  4. Fonts: Confirm font licenses permit commercial use in certificates
  5. Recipient Data: Comply with GDPR, CCPA, and applicable privacy laws

Safe Usage Guidelines:

  • βœ… Use your own designs and assets
  • βœ… Use properly licensed stock images (e.g., Unsplash, Pexels with proper attribution)
  • βœ… Create original certificate templates
  • βœ… Obtain written permission for third-party assets
  • βœ… Include proper attributions where required

Legal Protection:

This open-source software is provided "AS IS" without warranty. The developers and contributors:

  • ❌ Do not claim ownership of user-generated content
  • ❌ Are not responsible for copyright violations by users
  • ❌ Do not guarantee legal compliance of certificates created
  • ❌ Cannot be held liable for misuse of the software

For Commercial Use: Consult with a legal professional to ensure compliance with:

  • Copyright laws in your jurisdiction
  • Trademark regulations
  • Privacy and data protection laws (GDPR, CCPA, etc.)
  • Industry-specific certification requirements

Attribution Requirements

When using this software, please:

  1. Maintain License: Keep the MIT License in distributed copies
  2. Credit Original: Link back to this repository when sharing
  3. Icon Attribution: Include Smashicons/Flaticon credit if using the default icon
  4. Respect Trademarks: Do not claim association with original authors

Disclaimer

THE SOFTWARE AND ALL ASSOCIATED DOCUMENTATION ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY ARISING FROM THE USE OF THIS SOFTWARE OR CERTIFICATES GENERATED WITH IT.

Users are solely responsible for:

  • Legal compliance in their jurisdiction
  • Proper licensing of all assets used
  • Accuracy of information on certificates
  • Data privacy and security measures
  • Obtaining necessary permissions and rights

πŸ“„ License

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

Copyright Β© 2025 CertifiKit 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.

πŸ†˜ Support

Need help?

  • Open an issue on GitHub
  • Check the documentation in the /docs folder
  • Review existing issues and discussions

πŸ‘€ Want to learn more?

⭐ Star History

If you find this project useful, please consider giving it a star on GitHub!


Built with ❀️ for the open-source community

Version: 1.0.0
Last Updated: November 2025

About

A modern, open-source certificate generator built with Next.js 14 and Tailwind CSS. Create, customize, and export professional certificates with an intuitive drag-and-drop interface.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors