A Powerful Document & Image Conversion Platform
Transform your documents and images with ease. Built with modern web technologies for speed, reliability, and scale.
- Frontend: turbodoc.sharad.fun
Turbo-Doc is a full-stack document and image conversion platform built with a modern monorepo architecture. It provides users with powerful file processing capabilities including format conversion, PDF merging/splitting, and image optimization with a beautiful, responsive UI.
- Fast Processing: Worker thread-based architecture for non-blocking file operations
- Scalable: Turborepo monorepo with shared packages and optimized builds
- Secure: Better Auth integration with social providers, file encryption, and secure S3 storage
- Flexible: Support for guest users and authenticated users with tiered subscription plans
- Modern: Built with Next.js 16, React 19, and the latest web technologies
- Format Conversion: Convert between PDF, DOCX, TXT, PPT, XLSX formats
- PDF Manipulation: Merge multiple PDFs or split PDF by page range
- Batch Processing: Process multiple files simultaneously
- Auto-expiration: Automatic cleanup based on user plan retention period
- Format Conversion: Convert between JPEG, PNG, WebP, AVIF, GIF
- Compression: Optimize image file size with quality controls
- Resizing: Scale images from 25% to 200% of original size
- Dimension Detection: Automatic width/height detection
- Authentication: Email/password and social login (Google, GitHub) via Better Auth
- Guest Access: Limited daily conversions without account creation
- Subscription Plans: FREE and PRO tiers with varying limits
- Usage Tracking: Real-time monitoring of daily quotas
- Razorpay: Secure payment processing for PRO subscriptions
- Webhooks: Automated subscription management
- Invoice Generation: Transaction history and receipts
- Next.js 16 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- TailwindCSS 4 - Utility-first CSS
- shadcn/ui - Premium component library
- TanStack Query - Data fetching and caching
- Zustand - State management
- Framer Motion - Animations
- Sonner - Toast notifications
- Zod - Schema validation
- Node.js - JavaScript runtime
- Express.js - Web framework
- TypeScript - Type safety
- Piscina - Worker thread pool for CPU-intensive operations
- tsx - TypeScript execution
- tsup - TypeScript bundler
- PostgreSQL - Relational database
- Prisma - Next-generation ORM
- Prisma Adapter (pg) - PostgreSQL adapter
- Better Auth - Modern authentication library
- OAuth Providers: Google, GitHub
- Session Management: Cookie-based with cross-subdomain support
- Sharp - High-performance image processing
- LibreOffice - Document format conversion (headless)
- PDF-lib - PDF manipulation
- AWS S3 - Object storage
- AWS CloudFront - Content delivery network
- Presigned URLs: Secure file upload/download
- Razorpay - Payment gateway (India)
- Webhook Integration: Automated subscription updates
Turbo-Doc/
βββ apps/
β βββ api/ # Express.js backend API
β β βββ src/
β β β βββ controllers/ # Route controllers
β β β βββ middleware/ # Auth, limits, storage checks
β β β βββ routes/ # API routes
β β β βββ services/ # Business logic
β β β βββ workers/ # Piscina worker threads
β β β βββ utils/ # Helper functions
β β βββ package.json
β β
β βββ web/ # Next.js frontend
β βββ src/
β β βββ app/ # App router pages
β β βββ components/ # React components
β β βββ views/ # Page views
β β βββ api/ # API clients
β β βββ lib/ # Utilities
β β βββ providers/ # Context providers
β βββ package.json
β
βββ packages/
β βββ auth/ # Better Auth configuration
β βββ database/ # Prisma schema & client
β β βββ prisma/
β β βββ schema.prisma # Database model
β β βββ seed.ts # Seed script
β βββ file-upload/ # AWS S3 utilities
β βββ ui/ # Shared UI components (shadcn/ui)
β βββ zod-schemas/ # Shared validation schemas
β βββ config/ # Shared configuration
β βββ eslint-config/
β βββ tailwind-config/
β βββ typescript-config/
β
βββ package.json # Root workspace config
βββ pnpm-workspace.yaml # pnpm workspace definition
βββ turbo.json # Turborepo pipeline config
βββ README.md
- Node.js >= 18
- pnpm >= 9.0.0
- PostgreSQL database
- AWS S3 bucket and credentials
- Razorpay account (for payments)
- LibreOffice installed (for document conversion)
-
Clone the repository
git clone https://github.com/sharad-77/Turbo-Doc.git cd Turbo-Doc -
Install dependencies
pnpm install
-
Set up environment variables
Create a
.envfile in the root directory:# Database DATABASE_URL="postgresql://user:password@localhost:5432/turbodoc" # API Configuration API_PORT=3001 API_URL="http://localhost:3001" NEXT_PUBLIC_API_URL="http://localhost:3001" NEXT_PUBLIC_APP_URL="http://localhost:3000" # Better Auth BETTER_AUTH_SECRET="your-secret-key-here" BETTER_AUTH_URL="http://localhost:3001" # OAuth (Optional) GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" GITHUB_CLIENT_ID="your-github-client-id" GITHUB_CLIENT_SECRET="your-github-client-secret" # AWS S3 AWS_ACCESS_KEY_ID="your-aws-access-key" AWS_SECRET_ACCESS_KEY="your-aws-secret-key" AWS_S3_REGION="your-aws-region" AWS_BUCKET_NAME="your-bucket-name" AWS_CLOUDFRONT_URL="https://your-cloudfront-url" # Razorpay TEST_API_KEY="your-razorpay-key" TEST_API_SECRET="your-razorpay-secret" TEST_API_WEBHOOK_SECRET="your-webhook-secret" NEXT_PUBLIC_RAZORPAY_KEY_ID="your-razorpay-key-id"
-
Generate Prisma Client & Run Migrations
cd packages/database pnpm db:generate pnpm db:push pnpm db:seed # Seed subscription plans cd ../..
-
Build packages
pnpm build
-
Start development servers
pnpm dev
This will start:
- Frontend: http://localhost:3000
- API: http://localhost:3001
From the root directory:
# Development
pnpm dev # Start all apps in dev mode
pnpm dev --filter=web # Start only frontend
pnpm dev --filter=api # Start only backend
# Building
pnpm build # Build all apps
pnpm build --filter=web
# Code Quality
pnpm lint # Run ESLint
pnpm format # Format code with Prettier
pnpm format:check # Check code formatting
pnpm types # TypeScript type checking
pnpm check # Run format + lint + types
# Database
cd packages/database
pnpm db:generate # Generate Prisma Client
pnpm db:push # Push schema to database
pnpm db:migrate # Run migrations
pnpm db:studio # Open Prisma Studio
pnpm db:seed # Seed databaseThe frontend is deployed on Vercel:
- Connect your GitHub repository to Vercel
- Set the root directory to
apps/web - Configure environment variables:
NEXT_PUBLIC_API_URLNEXT_PUBLIC_APP_URLNEXT_PUBLIC_RAZORPAY_KEY_ID
- Deploy!
The backend is deployed on AWS EC2:
-
Launch EC2 Instance (Ubuntu 22.04, t3.micro or larger)
-
Install Dependencies
sudo apt update sudo apt install -y nodejs npm postgresql-client libreoffice npm install -g pnpm pm2
-
Clone & Build
git clone https://github.com/sharad-77/Turbo-Doc.git cd Turbo-Doc pnpm install --frozen-lockfile pnpm build --filter=api -
Configure Environment
- Copy
.envfile with production values - Ensure
NODE_ENV=production
- Copy
-
Start with PM2
pm2 start apps/api/dist/index.js --name turbodoc-api pm2 save pm2 startup
-
Setup Nginx (Optional) Configure Nginx as a reverse proxy with SSL termination
Hosted on a managed PostgreSQL service (e.g., AWS RDS, Neon, Supabase):
- Create database instance
- Configure connection string in
.env - Run migrations:
pnpm db:push - Seed initial data:
pnpm db:seed
This project is licensed under the MIT License - see the LICENSE file for details.
Sharad
- GitHub: @sharad-77
Built with β€οΈ using modern web technologies