A comprehensive SQL-based report generation and scheduling platform with a modern React frontend and NestJS backend.
- Database Connections: Connect to PostgreSQL, MySQL, SQL Server, Oracle, SQLite
- SQL Query Editor: Write and test SQL queries with syntax highlighting
- Report Scheduling: Cron-based scheduling with timezone support
- Multiple Output Formats: CSV, Excel (XLS/XLSX), PDF, JSON, XML
- Report Routing: Automatic email and FTP delivery
- User Management: Role-based access control (Admin, Report Manager, Viewer)
- Execution History: Track all report executions with detailed logs
- AI Assistant: Optional AI-powered query generation and debugging
- Node.js 18+
- npm 8+
- Docker & Docker Compose (recommended for database services)
- PostgreSQL 15+ (if not using Docker)
- Redis 7+ (if not using Docker)
# Clone the repository
git clone <repository-url>
cd Moez
# Run the installation script
./install.sh# Install all dependencies
npm install
cd backend && npm install
cd ../frontend && npm install
cd ..# Using Docker
docker compose up -d postgres redis
# Or manually install PostgreSQL and RedisCreate backend/.env:
DATABASE_URL="postgresql://postgres:postgres@localhost:5433/report_gen?schema=public"
JWT_SECRET="your-super-secret-jwt-key-change-in-production"
JWT_EXPIRATION="7d"
REDIS_HOST="localhost"
REDIS_PORT="6379"
STORAGE_PATH="./storage"
FRONTEND_URL="http://localhost:5173"
ENCRYPTION_KEY="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"cd backend
npx prisma generate
npx prisma db push
mkdir -p storage# Terminal 1 - Backend
cd backend
npm run start:dev
# Terminal 2 - Frontend
cd frontend
npm run dev# Start all services
docker compose up
# Or start specific services
docker compose up -d postgres redis
docker compose up backend frontend# Build and start production containers
docker compose -f docker-compose.prod.yml up -dMoez/
βββ backend/ # NestJS Backend
β βββ src/
β β βββ auth/ # Authentication (JWT)
β β βββ connections/ # Database connections
β β βββ reports/ # Report management
β β βββ schedules/ # Scheduling (Cron)
β β βββ executions/ # Execution history
β β βββ output/ # File generation (CSV, Excel, etc.)
β β βββ routing/ # Email/FTP delivery
β β βββ users/ # User management
β β βββ groups/ # Group management
β β βββ bot/ # AI assistant
β βββ prisma/ # Database schema
βββ frontend/ # React Frontend (Vite)
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ contexts/ # React contexts
β β βββ lib/ # Utilities & API
β βββ public/
βββ docker-compose.yml # Docker configuration
βββ install.sh # Installation script
βββ README.md
| Service | Port |
|---|---|
| Frontend | 5173 |
| Backend | 3000 |
| PostgreSQL | 5433 |
| Redis | 6379 |
Swagger documentation is available at:
http://localhost:3000/api/docs
Navigate to Connections β New Connection and configure:
- Connection name
- Database type (PostgreSQL, MySQL, etc.)
- Host, port, username, password, database
Navigate to Reports β New Report:
- Select a connection
- Write your SQL query
- Test the query
- Choose output format (CSV, Excel, PDF, etc.)
- Manual: Click the
βΆοΈ Play button on the Reports page - Scheduled: Create a schedule with cron expression
Navigate to Executions and click Download on successful executions.
| Role | Permissions |
|---|---|
| ADMIN | Full access to all features |
| REPORT_MANAGER | Create/edit reports, connections, schedules |
| VIEWER | View and execute reports only |
- JWT-based authentication
- Password hashing with bcrypt
- Database credentials encryption
- Role-based access control
- SQL injection prevention through parameterized queries
To enable email delivery, configure SMTP in the routing settings:
- SMTP Host
- Port (25, 465, 587)
- Username/Password
- TLS/SSL options
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and feature requests, please create an issue on GitHub.