Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SchemaBuilder πŸš€

AI-Powered Database Design & Schema Management Platform

A revolutionary full-stack SaaS platform that transforms database schema design through intelligent visual modeling. Create complex database schemas instantly using AI-powered chat interface, drag-and-drop visual designer, and real-time collaboration features.

License: MIT Go Version React Version TypeScript

✨ Features

πŸ€– AI-Powered Schema Generation

  • Natural Language Processing: Convert plain English descriptions into database schemas
  • Google Gemini AI Integration: Advanced AI understanding for complex database relationships
  • Smart Field Detection: Automatically identifies primary keys, foreign keys, and data types
  • Relationship Inference: AI suggests optimal table relationships and constraints

🎨 Visual Database Designer

  • Interactive Canvas: Drag-and-drop interface powered by ReactFlow
  • Animated Table Nodes: Beautiful animations and transitions for enhanced UX
  • Real-time Relationship Mapping: Visual connection between tables with constraint visualization
  • Responsive Design: Mobile-optimized interface with touch-friendly controls

πŸ”„ Real-time Collaboration

  • Multi-user Editing: Collaborate on schemas with team members in real-time
  • Version Control: Track schema changes and maintain version history
  • Live Updates: See changes from other users instantly
  • Schema Sharing: Public/private schema sharing with access controls

πŸ› οΈ Advanced Schema Management

  • CRUD Operations: Full create, read, update, delete operations for schemas
  • SQL Generation: Auto-generate SQL DDL with proper constraints and indexes
  • Schema Export: Export to various formats (SQL, JSON, etc.)
  • Schema Import: Load existing schemas and convert to visual format

πŸ” Enterprise Authentication

  • Firebase Google OAuth: Secure Google sign-in integration
  • Email Verification: Complete email verification workflow
  • JWT Authentication: Secure token-based session management
  • Password Reset: Secure password recovery system

πŸ—οΈ Architecture

Frontend (React TypeScript)

schemaBuilder/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ designer/        # Visual schema designer
β”‚   β”‚   β”œβ”€β”€ chat/           # AI chat interface
β”‚   β”‚   β”œβ”€β”€ auth/           # Authentication components
β”‚   β”‚   └── ui/             # Base UI components
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”œβ”€β”€ services/           # API service layer
β”‚   β”œβ”€β”€ contexts/           # React context providers
β”‚   β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── utils/              # Utility functions

Backend (Go)

BackEnd/
β”œβ”€β”€ cmd/                    # Application entry points
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ handlers/          # HTTP request handlers
β”‚   β”œβ”€β”€ services/          # Business logic layer
β”‚   β”œβ”€β”€ repository/        # Data access layer
β”‚   β”œβ”€β”€ models/           # Data models
β”‚   β”œβ”€β”€ middleware/       # HTTP middleware
β”‚   └── config/           # Configuration management
└── pkg/                   # Shared packages
    β”œβ”€β”€ database/         # Database connections
    └── logger/           # Logging utilities

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ and npm/yarn
  • Go 1.23+
  • MongoDB 5.0+
  • Firebase Project for authentication
  • Google Gemini API Key for AI features

Frontend Setup

  1. Clone the repository

    git clone https://github.com/M-awais-rasool/schema-builder.git
    cd schema-builder/schemaBuilder
  2. Install dependencies

    npm install
  3. Environment Configuration

    cp .env.example .env

    Update .env with your configuration:

    VITE_API_BASE_URL=http://localhost:8080/api
    VITE_FIREBASE_API_KEY=your_firebase_api_key
    VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
    VITE_FIREBASE_PROJECT_ID=your_project_id
    VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
    VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
    VITE_FIREBASE_APP_ID=your_app_id
  4. Start development server

    npm run dev

Backend Setup

  1. Navigate to backend directory

    cd ../BackEnd
  2. Install Go dependencies

    make install
  3. Environment Configuration

    cp .env.example .env

    Update .env with your configuration:

    PORT=8080
    MONGODB_URI=mongodb://localhost:27017
    MONGODB_DATABASE=schema_builder
    JWT_SECRET=your_jwt_secret_key
    GEMINI_API_KEY=your_gemini_api_key
    SMTP_HOST=smtp.gmail.com
    SMTP_PORT=587
    SMTP_USERNAME=your_email@gmail.com
    SMTP_PASSWORD=your_app_password
  4. Start the server

    make dev

Using Docker

  1. Build and run with Docker Compose

    docker-compose up -d
  2. View logs

    docker-compose logs -f

πŸ“– API Documentation

Authentication Endpoints

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/verify - Email verification
  • POST /api/auth/google - Google OAuth authentication
  • POST /api/auth/forgot-password - Password reset request
  • POST /api/auth/reset-password - Password reset confirmation

Schema Management

  • GET /api/schemas - List user schemas
  • POST /api/schemas - Create new schema
  • GET /api/schemas/:id - Get schema by ID
  • PUT /api/schemas/:id - Update schema
  • DELETE /api/schemas/:id - Delete schema

AI Integration

  • POST /api/ai/chat - AI chat for schema generation

User Management

  • GET /api/users/profile - Get user profile
  • PUT /api/users/profile - Update user profile

πŸ› οΈ Development

Available Scripts

Frontend

npm run dev          # Start development server
npm run build        # Build for production
npm run lint         # Run ESLint

Backend

make dev             # Start development server with hot reload
make build           # Build the application
make lint            # Run linter
make format          # Format code

Code Quality

  • ESLint and Prettier for frontend code formatting
  • golangci-lint for Go code linting
  • Pre-commit hooks for code quality enforcement
  • Test coverage reports for both frontend and backend

🚒 Deployment

Production Build

  1. Frontend

    npm run build
  2. Backend

    make build-linux

Environment Variables for Production

  • Set secure JWT secrets
  • Configure production MongoDB URI
  • Set up proper CORS origins
  • Configure email services
  • Set up monitoring and logging

🀝 Contributing

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

Development Guidelines

  • Follow TypeScript best practices for frontend
  • Follow Go coding standards for backend
  • Write comprehensive tests for new features
  • Update documentation for API changes
  • Ensure responsive design for UI changes

πŸ“ License

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

πŸ™ Acknowledgments

  • ReactFlow for the amazing visual editor capabilities
  • Google Gemini AI for powerful natural language processing
  • Firebase for robust authentication services
  • MongoDB for flexible document storage
  • Gin Framework for fast HTTP routing in Go

Built with ❀️ by M. Awais Rasool

About

A revolutionary full-stack SaaS platform that transforms database schema design through intelligent visual modeling. Create complex database schemas instantly using AI-powered chat interface, drag-and-drop visual designer, and real-time collaboration features.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages