Skip to content

CliffsGPT/Automate-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automate Solar Web Application

A comprehensive web application for Solar Power Plant inspection and Construction management using drones with the latest in AI/ML technology.

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • Git

Installation

  1. Clone the repository

    git clone <your-repo-url>
    cd Automate-web-app-clean
  2. Install dependencies

    # Frontend dependencies
    npm install
    
    # Backend dependencies
    pip install -r requirements.txt
  3. Set up environment variables

    cp .env.example .env
    # Edit .env with your configuration
  4. Initialize the database

    python init_database.py
  5. Start the development servers

    # Terminal 1: Start React frontend
    npm start
    
    # Terminal 2: Start Flask backend
    python flask_backend.py

🗄️ Database Setup

Important: Database Files

  • Database files (.db) are NOT included in this repository
  • They contain sensitive user data and should not be version controlled
  • Each environment (dev, staging, production) should have its own database

Database Initialization

The application uses SQLAlchemy with the following options:

  1. Development (SQLite)

    export DATABASE_URL="sqlite:///automate_solar.db"
    python init_database.py
  2. Production (PostgreSQL)

    export DATABASE_URL="postgresql://user:password@localhost:5432/automate_solar"
    python init_database.py
  3. Add sample data (optional)

    export ADD_SAMPLE_DATA="true"
    python init_database.py

🌐 Deployment

Vercel Deployment

This application is configured for Vercel deployment:

  1. Connect your repository to Vercel
  2. Set environment variables in Vercel dashboard
  3. Deploy automatically on push to main branch

Environment Variables Required

# Flask Configuration
SECRET_KEY=your_secret_key_here
FLASK_ENV=production
DATABASE_URL=your_database_connection_string

# AWS S3 Configuration
S3_KEY=your_s3_access_key
S3_SECRET=your_s3_secret_key
S3_REGION=us-east-1
S3_BUCKET=your_s3_bucket_name

📁 Project Structure

├── src/                    # React frontend source code
├── public/                 # Static assets
├── flask_backend.py        # Flask API backend
├── init_database.py        # Database initialization script
├── requirements.txt        # Python dependencies
├── package.json           # Node.js dependencies
├── vercel.json            # Vercel deployment configuration
└── .gitignore             # Git ignore rules

🔧 Development

Available Scripts

  • npm start - Start React development server
  • npm run build - Build React app for production
  • npm test - Run tests
  • npm run lint - Run ESLint
  • python flask_backend.py - Start Flask development server

Code Style

  • Frontend: ESLint + Prettier
  • Backend: Flake8
  • Pre-commit hooks configured

📚 API Documentation

Authentication Endpoints

  • POST /api/signup - User registration
  • POST /api/login - User login

Project Endpoints

  • GET /api/projects - Get user's projects
  • POST /api/projects/create-from-dxf - Create project from DXF file
  • GET /api/projects/<id> - Get project details

File Upload

  • POST /api/s3/generate-presigned-post - Get S3 upload URL

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and linting
  5. Submit a pull request

📄 License

[Add your license information here]

🆘 Support

For support, please contact [your contact information]