Skip to content

montasim/LicenseBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License Box

A modern, open-source license key management platform built with Next.js 16, React 19, and Prisma.

License Next.js React TypeScript

License Box is a comprehensive platform for securely storing, organizing, and sharing software license keys with role-based admin dashboard, community voting, encryption, and a beautiful OKLCH-themed UI. Perfect for teams and individuals managing their software licenses.

✨ Features

πŸ” Authentication & Security

  • Multi-provider Auth: Sign in with Google, GitHub, or email/password
  • OTP Verification: Secure two-factor authentication with time-based codes
  • Password Reset: Self-service password recovery with email verification
  • Session Management: Secure session handling with activity tracking
  • Role-Based Access Control: USER, ADMIN, and SUPER_ADMIN roles

πŸ”‘ License Key Management

  • Secure Storage: AES-256-GCM encryption for all license keys
  • Key Masking: Safe display with masked key values
  • Bulk Import: Import multiple keys at once via CSV
  • Quick Add: Rapid key creation with auto-fill from product library
  • Key Organization: Organize by products with labels and descriptions
  • Expiry Tracking: Monitor key expiration with visual indicators
  • Status Management: ACTIVE, EXPIRED, USED_UP, and UNKNOWN states
  • Visibility Control: PRIVATE or PUBLIC key sharing

πŸ“¦ Product Management

  • Product Library: Community-driven product database
  • Auto-Fill: Quick key creation with product details
  • Icon Support: Custom product icons for easy identification
  • Key Statistics: Track active/expired keys per product

πŸ‘₯ Admin Dashboard

  • All Keys View: Platform-wide license key management
  • All Products View: Manage entire product catalog
  • User Management: View and manage all users
  • Activity Logs: Comprehensive audit trail with filtering
  • Reports System: Community reporting for inappropriate content
  • Soft Delete: Recoverable deletion with admin oversight

🌟 Community Features

  • Voting System: Upvote/downvote keys and products
  • Saved Keys: Bookmark favorites for quick access
  • Public Keys: Discover community-shared licenses
  • Product Discovery: Browse products by category

🎨 Modern UI/UX

  • OKLCH Color System: Modern, perceptually uniform colors
  • Dark Mode: Automatic theme switching
  • Responsive Design: Beautiful on mobile, tablet, and desktop
  • Accessibility: WCAG AA compliant with keyboard navigation
  • Skeleton Loading: Optimistic UI with smooth loading states
  • Toast Notifications: Non-intrusive feedback system

πŸ”§ Developer Experience

  • TypeScript: Full type safety across the codebase
  • ESLint + Prettier: Consistent code formatting
  • Husky + lint-staged: Pre-commit code quality checks
  • Prisma: Type-safe database access with migrations
  • Docker Support: Containerized deployment ready

πŸš€ Tech Stack

Category Technology
Framework Next.js 16.1 (App Router)
UI Library React 19.2
Language TypeScript 5.0
Database PostgreSQL (via Prisma 7.4)
Cache Redis 5.11
ORM Prisma 7.4
Styling Tailwind CSS 4.2
Components shadcn/ui (Radix UI primitives)
Forms React Hook Form 7.71 + Zod 4.3
Tables TanStack Table 8.21
State Zustand 5.0
Auth Custom JWT implementation
Email Resend 6.9
Validation Zod 4.3
Icons Lucide React, Tabler Icons
Package Manager pnpm 10.28

πŸ“‹ Prerequisites

  • Node.js 20+
  • pnpm 10+ (recommended) or npm/yarn
  • PostgreSQL 14+
  • Redis 7+
  • Google Cloud project (for OAuth)
  • Resend API key (for emails)

πŸ› οΈ Installation

1. Clone the repository

git clone https://github.com/yourusername/license-box.git
cd license-box

2. Install dependencies

pnpm install

3. Set up environment variables

Copy .env.example to .env and configure:

# Database
DATABASE_URL=postgres://user:password@host:5432/dbname

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password

# Application
BASE_URL=http://localhost:3000
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3000/api

# Authentication
OTP_HMAC_SECRET=your_hmac_secret
SUPER_ADMIN_EMAIL=admin@example.com
SUPER_ADMIN_PASSWORD=SecurePassword123!

# Email (Resend)
RESEND_API_KEY=re_your_api_key
FROM_EMAIL=noreply@yourdomain.com

# OAuth (Google)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CLIENT_EMAIL=your_service_account_email
GOOGLE_PRIVATE_KEY="your_private_key"

# OAuth (GitHub)
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret

# Turnstile (optional)
TURNSTILE_SECRET_KEY=your_turnstile_secret
NEXT_PUBLIC_TURNSTILE_SITE_KEY=your_turnstile_site_key

# Cron Jobs
CRON_SECRET=your_cron_secret

4. Set up the database

# Generate Prisma client
pnpm db:generate

# Run migrations
pnpm db:migrate

# Seed database (optional)
pnpm db:seed

5. Start the development server

pnpm dev

Open http://localhost:3000 in your browser.

🐳 Docker Deployment

Development

pnpm docker:dev

Production

pnpm docker:build
pnpm docker:prod

πŸ“š Project Structure

license-box/
β”œβ”€β”€ app/                          # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/                  # Authentication pages
β”‚   β”œβ”€β”€ dashboard/               # Dashboard pages
β”‚   β”‚   β”œβ”€β”€ all-keys/           # Admin key management
β”‚   β”‚   β”œβ”€β”€ all-products/       # Admin product management
β”‚   β”‚   β”œβ”€β”€ activity/           # Activity logs
β”‚   β”‚   β”œβ”€β”€ my-keys/            # User's keys
β”‚   β”‚   β”œβ”€β”€ saved/              # Saved keys
β”‚   β”‚   β”œβ”€β”€ settings/           # User settings
β”‚   β”‚   └── users/              # User management
β”‚   β”œβ”€β”€ api/                    # API routes
β”‚   β”‚   β”œβ”€β”€ auth/               # Authentication endpoints
β”‚   β”‚   β”œβ”€β”€ keyvault/           # License key APIs
β”‚   β”‚   └── activity/           # Activity tracking
β”‚   └── layout.tsx              # Root layout
β”œβ”€β”€ components/                  # React components
β”‚   β”œβ”€β”€ auth/                   # Auth components
β”‚   β”œβ”€β”€ dashboard/              # Dashboard components
β”‚   β”œβ”€β”€ keyvault/               # Key vault components
β”‚   └── ui/                     # shadcn/ui components
β”œβ”€β”€ lib/                         # Utilities
β”‚   β”œβ”€β”€ auth/                   # Authentication logic
β”‚   β”œβ”€β”€ db/                     # Database client
β”‚   β”œβ”€β”€ notifications/          # Notification service
β”‚   └── utils/                  # Helper functions
β”œβ”€β”€ prisma/                      # Database schema
β”‚   └── schema.prisma           # Prisma schema
└── public/                      # Static assets

πŸ” Security Features

  • Encryption: All license keys encrypted with AES-256-GCM
  • Rate Limiting: Redis-based rate limiting on API endpoints
  • CSRF Protection: Built-in Next.js CSRF protection
  • SQL Injection Prevention: Prisma parameterized queries
  • XSS Prevention: React's automatic XSS escaping
  • Secure Headers: Custom security headers via Next.js
  • Activity Logging: Comprehensive audit trail
  • Session Management: Secure JWT-based sessions

πŸ‘₯ User Roles

USER

  • Manage own license keys
  • Save favorite keys
  • Vote on community keys
  • View activity history
  • Edit profile and settings

ADMIN

  • All USER permissions
  • View all keys across platform
  • View all products
  • Edit/delete any key
  • Edit/delete any product
  • View user reports
  • Access activity logs

SUPER_ADMIN

  • All ADMIN permissions
  • Full audit log access
  • System-level configuration
  • User management
  • Advanced analytics

πŸ§ͺ Testing

# Run linting
pnpm lint

# Fix linting issues
pnpm lint:fix

# Format code
pnpm format:fix

πŸ“ License

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

🀝 Contributing

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

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

πŸ“§ Support

For support, email support@licensebox.dev or open an issue on GitHub.

πŸ™ Acknowledgments


Made with ❀️ by the License Box team

About

License Box is a modern, open-source license key management platform built with Next.js 16, React 19, and Prisma. securely store, organize, and share software license keys with role-based admin dashboard, community voting, encryption, and beautiful OKLCH-themed UI. Perfect for teams and individuals managing their software licenses.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages