A comprehensive MongoDB backup and restore service with real-time monitoring, automated scheduling, and Google Drive integration.
This application provides automated and manual backup solutions for MongoDB databases with a modern web dashboard for monitoring and management. It features scheduled backups, real-time logging, analytics, and secure authentication.
- Automated Scheduled Backups - Daily cron jobs for production and development databases
- Manual Backup Triggers - On-demand backup execution through web interface
- Database Restoration - Restore from local files or Google Drive backups
- Real-time Monitoring - Live logs and status updates via WebSocket connections
- Analytics Dashboard - Backup history, success rates, and performance metrics
- Google Drive Integration - Automatic upload and organized folder structure
- Local File Management - Temporary backup storage with automatic cleanup
- Database Support - MongoDB backup and restore operations
- Redis Logging - Structured logging with stream-based real-time updates
- Clerk Authentication - Secure user authentication and session management
- API Protection - Protected routes with authentication middleware
- Environment Isolation - Separate production and development configurations
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: MongoDB (via mongodump/mongorestore)
- ORM: Prisma
- Authentication: Clerk Express
- Real-time: Socket.io
- Scheduling: node-cron
- Storage: Google Drive API
- Logging: Winston with Redis streams
- File Processing: Archiver, Unzipper
- Framework: Next.js 15 with React 19
- Styling: Tailwind CSS
- UI Components: Radix UI primitives
- Charts: Recharts
- Authentication: Clerk Next.js
- HTTP Client: Axios
- Real-time: Socket.io Client
- Theming: next-themes
- Package Manager: pnpm
- Build Tools: TypeScript, tsc-watch
- Linting: ESLint
- Database: Prisma migrations
thebundledai-backup-service/
├── client/ # Next.js frontend application
│ ├── app/ # App router pages and API routes
│ ├── components/ # React components and UI elements
│ │ └── ui/ # Reusable UI components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utility functions and configurations
│ ├── prisma/ # Client-side Prisma schema
│ └── public/ # Static assets
├── server/ # Express.js backend service
│ ├── src/
│ │ ├── controller/ # API controllers
│ │ ├── env/ # Environment configuration
│ │ ├── prisma/ # Database schema and migrations
│ │ ├── routes/ # Express routes
│ │ ├── services/ # Database and external service connections
│ │ └── utils/ # Backup, restore, and utility functions
│ ├── config.json # Google Drive service account config
│ ├── dist/ # Compiled TypeScript output
│ └── logs/ # Application log files
└── README.md
- Node.js 18+
- pnpm package manager
- MongoDB instance
- Google Drive API credentials
- Redis server
- Clerk authentication setup
-
Clone the repository
-
Install dependencies for both client and server:
cd client && pnpm install cd ../server && pnpm install
-
Configure environment variables for both applications
-
Set up Prisma database:
cd server && pnpm run prebuild
Start both applications in development mode:
Server:
cd server && pnpm run dev
Client:
cd client && pnpm run dev
Server:
cd server && pnpm run build && pnpm start
Client:
cd client && pnpm run build && pnpm start
The application requires environment variables for:
- MongoDB connection strings (production/development)
- Google Drive API credentials
- Clerk authentication keys
- Redis connection details
- Backup service configuration