Skip to content

Vishok-2006/InsureAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ InsureAI

GitHub stars

GitHub forks

GitHub issues

GitHub license

An AI-powered platform for streamlined insurance management and intelligent insights.

πŸ“– Overview

InsureAI is a comprehensive full-stack web application designed to revolutionize the insurance industry through the integration of Artificial Intelligence. It provides an intuitive platform for managing insurance policies, processing claims, and deriving intelligent insights to optimize operations and enhance decision-making. The application features a modern, interactive frontend built with React, paired with a robust Node.js backend to handle data processing and API services.

✨ Features

  • 🎯 AI-Driven Insights: Leverage AI capabilities for enhanced risk assessment, personalized policy recommendations, and predictive analytics in insurance.
  • πŸ“‹ Policy Management: Comprehensive features for creating, viewing, updating, and managing various insurance policies.
  • βœ… Interactive User Interface: A dynamic and responsive frontend built with React for a seamless user experience.
  • πŸ” Authentication & Authorization: Secure user access and role-based permissions (inferred, common for such applications).
  • πŸš€ Scalable Backend API: A well-structured Node.js API designed for efficiency and scalability in handling insurance data.
  • πŸ“„ API Documentation: Dedicated openspec directory suggests a defined and documented API structure.
  • βš™οΈ Configurable Environment: Easy setup and customization via environment variables for different deployment stages.

πŸ–₯️ Screenshots

πŸ› οΈ Tech Stack

Frontend:

React

HTML5

CSS3

JavaScript

Backend:

Node.js

Express.js

Database:

Database Placeholder

DevOps & Tools:

npm

πŸš€ Quick Start

Follow these steps to get InsureAI up and running on your local machine.

Prerequisites

Make sure you have the following installed:

  • Node.js: ^18.x or higher (LTS recommended)
  • npm: Node Package Manager, usually bundled with Node.js.
  • Git: For cloning the repository.

Installation

  1. Clone the repository

    git clone https://github.com/Vishok-2006/InsureAI.git
    cd InsureAI
  2. Install Backend dependencies Navigate to the backend directory and install its dependencies.

    cd backend
    npm install
    cd .. # Go back to root
  3. Install Frontend dependencies Navigate to the react-app directory and install its dependencies.

    cd react-app
    npm install
    cd .. # Go back to root
  4. Environment setup Create .env files for both the backend and react-app by copying the example.

    cp .env.example backend/.env # Create .env for backend
    cp .env.example react-app/.env # Create .env for frontend (if applicable)

    Configure your environment variables in backend/.env and react-app/.env (if applicable).

    Example .env configuration (for backend, adjust as needed for frontend):

    # Backend Port
    PORT=5000 
    
    # Database Configuration
    DATABASE_URL=mongodb://localhost:27017/insureai_db # Example for MongoDB
    # Or for PostgreSQL: DATABASE_URL=postgresql://user:password@localhost:5432/insureai_db
    
    # JWT Secret for authentication
    JWT_SECRET=your_jwt_secret_key
    
    # API Keys for external services (e.g., AI models)
    AI_SERVICE_API_KEY=your_ai_service_api_key
    
  5. Database setup (if applicable) If your backend requires database migrations or initial seeding, run the respective commands from the backend directory.

    # Example for database migrations (e.g., Mongoose for MongoDB or Sequelize for SQL)
    # cd backend
    # npm run migrate
    # npm run seed
  6. Start the Backend Development Server From the root directory, you can use the back.sh script, or navigate to backend and start it manually.

    ./back.sh
    # or manually:
    # cd backend
    # npm start # Or 'npm run dev' if a dev script exists

    The backend server will typically run on http://localhost:5000 (or the port defined in backend/.env).

  7. Start the Frontend Development Server Navigate to the react-app directory and start the frontend development server.

    cd react-app
    npm start # Or 'npm run dev' if a dev script exists

    The frontend application will typically open in your browser at http://localhost:3000.

πŸ“ Project Structure

InsureAI/
β”œβ”€β”€ .agent/             # Placeholder for agent-related configurations or scripts
β”œβ”€β”€ .env.example        # Example environment variables for configuration
β”œβ”€β”€ .gitignore          # Specifies intentionally untracked files to ignore
β”œβ”€β”€ README.md           # The main README file
β”œβ”€β”€ back.sh             # Shell script to start the backend server
β”œβ”€β”€ backend/            # Contains the Node.js backend service
β”‚   β”œβ”€β”€ package.json    # Backend dependencies and scripts
β”‚   β”œβ”€β”€ src/            # Backend source code (controllers, models, routes, services)
β”‚   β”œβ”€β”€ .env            # Local environment variables for backend
β”‚   └── ...
β”œβ”€β”€ frontend/           # Directory that might contain shared frontend assets or be a wrapper (currently unclear)
β”œβ”€β”€ openspec/           # Contains API specification files (e.g., OpenAPI/Swagger definitions)
β”œβ”€β”€ package-lock.json   # Lock file for root-level npm dependencies (if any, or for global scripts)
β”œβ”€β”€ react-app/          # The main React.js frontend application
β”‚   β”œβ”€β”€ public/         # Public assets (index.html, favicon, etc.)
β”‚   β”œβ”€β”€ src/            # React application source code (components, pages, context, styles)
β”‚   β”œβ”€β”€ package.json    # Frontend dependencies and scripts
β”‚   β”œβ”€β”€ .env            # Local environment variables for frontend
β”‚   └── ...
└── str.md              # Additional markdown notes or documentation

βš™οΈ Configuration

Environment Variables

The application uses environment variables for sensitive information and configuration settings. Create .env files in both backend/ and react-app/ directories based on the .env.example file.

| Variable | Description | Default | Required |

|----------------------|------------------------------------------------------|------------|----------|

| PORT | Port for the backend server to listen on. | 5000 | Yes |

| DATABASE_URL | Connection string for the database. | N/A | Yes |

| JWT_SECRET | Secret key for signing JSON Web Tokens. | N/A | Yes |

| AI_SERVICE_API_KEY | API key for connecting to external AI services. | N/A | Yes |

| REACT_APP_API_URL | URL of the backend API for the frontend to connect to. | http://localhost:5000 | Yes |

Configuration Files

  • .env: Local environment configuration files (one for backend, one for frontend).
  • backend/package.json: Manages backend dependencies and scripts.
  • react-app/package.json: Manages frontend dependencies and scripts.
  • openspec/: Contains OpenAPI or Swagger specifications for the API, detailing available endpoints, request/response formats, and authentication methods.

πŸ”§ Development

Available Scripts

The primary development scripts are located in the package.json files within the backend/ and react-app/ directories.

For Backend (in backend/):

| Command | Description |

|--------------|-------------------------------------------------|

| npm start | Starts the backend server in production mode. |

| npm run dev| Starts the backend server in development mode (e.g., with nodemon for auto-restarts). |

For Frontend (in react-app/):

| Command | Description |

|--------------|-------------------------------------------------|

| npm start | Starts the React development server. |

| npm run build | Builds the React app for production. |

| npm test | Runs the test watcher in interactive mode. |

| npm run eject | Removes the single build dependency from your project. |

Development Workflow

  1. Ensure both backend and react-app dependencies are installed (npm install in each directory).
  2. Set up your .env files as described in the "Environment setup" section.
  3. Start the backend server using cd backend && npm run dev (or npm start).
  4. Start the frontend development server using cd react-app && npm start.
  5. Access the frontend in your browser, typically at http://localhost:3000.

πŸ§ͺ Testing

The frontend (React) and backend (Node.js) modules likely have their own testing configurations.

For Frontend (in react-app/):

# Run all tests
cd react-app
npm test

# Run tests with coverage (if configured)

# npm test -- --coverage

For Backend (in backend/):

# Run backend tests (if configured)

# cd backend

# npm test

πŸš€ Deployment

Production Build

To create an optimized production build of the frontend:

cd react-app
npm run build

This command bundles React in production mode and optimizes the build for the best performance. The build artifacts will be placed in the react-app/build directory.

Deployment Options

  • Static Hosting for Frontend: The react-app/build directory can be deployed to static hosting services like Vercel, Netlify, or AWS S3 + CloudFront.
  • Backend Hosting: The backend service can be deployed to cloud platforms such as Heroku, AWS EC2, Google Cloud Run, or Render.
  • Docker/Containerization: While no Dockerfile is present, for production deployments, containerizing both frontend and backend services using Docker is a common practice.

πŸ“š API Reference

The openspec/ directory is likely dedicated to housing OpenAPI (Swagger) specifications for the backend API. This provides a comprehensive, machine-readable description of the API's endpoints, operations, parameters, and data models.

Authentication

(Inferred, common for full-stack apps) The API likely uses JSON Web Tokens (JWT) for authentication. Users would typically send credentials to a login endpoint to receive a JWT, which must then be included in the Authorization header for protected routes.

Endpoints

(Examples based on common insurance application needs)

| Method | Endpoint | Description |

|--------|-----------------------------|----------------------------------------------|

| POST | /api/auth/register | Register a new user. |

| POST | /api/auth/login | Authenticate user and get JWT. |

| GET | /api/policies | Retrieve all insurance policies. |

| POST | /api/policies | Create a new insurance policy. |

| GET | /api/policies/:id | Retrieve a specific policy by ID. |

| PUT | /api/policies/:id | Update an existing policy. |

| DELETE| /api/policies/:id | Delete a policy. |

| GET | /api/insights/risk-assessment | Get AI-powered risk assessment. |

| POST | /api/claims | Submit a new claim. |

🀝 Contributing

We welcome contributions to InsureAI! If you're interested in improving the project, please follow these guidelines:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure they are well-tested.
  4. Commit your changes with a clear and descriptive message.
  5. Push your branch and open a pull request.

Please see our Contributing Guide for more detailed instructions.

Development Setup for Contributors

Ensure you follow the Quick Start guide to set up your local development environment. It is crucial to set up both the backend and frontend components.

πŸ“„ License

This project is currently Unlicensed. See the LICENSE file for details if it becomes available.

πŸ™ Acknowledgments

  • Built with Node.js and React, leveraging the vast open-source ecosystem.
  • Special thanks to the developer community for providing incredible tools and resources.
  • Inspired by the potential of AI to transform traditional industries.

πŸ“ž Support & Contact

  • πŸ› Issues: Feel free to report bugs or suggest features on the GitHub Issues page.

⭐ Star this repo if you find it helpful!

Made with ❀️ by Vishok-2006

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors