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.
- π― 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
openspecdirectory suggests a defined and documented API structure. - βοΈ Configurable Environment: Easy setup and customization via environment variables for different deployment stages.
Frontend:
Backend:
Database:
DevOps & Tools:
Follow these steps to get InsureAI up and running on your local machine.
Make sure you have the following installed:
- Node.js:
^18.xor higher (LTS recommended) - npm: Node Package Manager, usually bundled with Node.js.
- Git: For cloning the repository.
-
Clone the repository
git clone https://github.com/Vishok-2006/InsureAI.git cd InsureAI -
Install Backend dependencies Navigate to the
backenddirectory and install its dependencies.cd backend npm install cd .. # Go back to root
-
Install Frontend dependencies Navigate to the
react-appdirectory and install its dependencies.cd react-app npm install cd .. # Go back to root
-
Environment setup Create
.envfiles for both thebackendandreact-appby 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/.envandreact-app/.env(if applicable).Example
.envconfiguration (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 -
Database setup (if applicable) If your backend requires database migrations or initial seeding, run the respective commands from the
backenddirectory.# Example for database migrations (e.g., Mongoose for MongoDB or Sequelize for SQL) # cd backend # npm run migrate # npm run seed
-
Start the Backend Development Server From the root directory, you can use the
back.shscript, or navigate tobackendand 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 inbackend/.env). -
Start the Frontend Development Server Navigate to the
react-appdirectory 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.
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
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 |
.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.
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. |
- Ensure both
backendandreact-appdependencies are installed (npm installin each directory). - Set up your
.envfiles as described in the "Environment setup" section. - Start the backend server using
cd backend && npm run dev(ornpm start). - Start the frontend development server using
cd react-app && npm start. - Access the frontend in your browser, typically at
http://localhost:3000.
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 -- --coverageFor Backend (in backend/):
# Run backend tests (if configured)
# cd backend
# npm testTo create an optimized production build of the frontend:
cd react-app
npm run buildThis 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.
- Static Hosting for Frontend: The
react-app/builddirectory can be deployed to static hosting services like Vercel, Netlify, or AWS S3 + CloudFront. - Backend Hosting: The
backendservice can be deployed to cloud platforms such as Heroku, AWS EC2, Google Cloud Run, or Render. - Docker/Containerization: While no
Dockerfileis present, for production deployments, containerizing both frontend and backend services using Docker is a common practice.
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.
(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.
(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. |
We welcome contributions to InsureAI! If you're interested in improving the project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure they are well-tested.
- Commit your changes with a clear and descriptive message.
- Push your branch and open a pull request.
Please see our Contributing Guide for more detailed instructions.
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.
This project is currently Unlicensed. See the LICENSE file for details if it becomes available.
- 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.
- π 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