Skip to content

ochuko1996/marrine_gpt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MarineGPT - AI Marine Engineering Assistant

React TypeScript Node.js Gemini AI

🚒 Overview

MarineGPT is an intelligent AI-powered assistant specifically designed for marine engineering professionals. It provides expert guidance on vessel maintenance, navigation systems, marine engineering calculations, design specifications, and troubleshooting. The application leverages Google's Gemini AI to deliver accurate, industry-specific responses backed by authoritative marine engineering resources.

✨ Features

πŸ€– AI-Powered Marine Engineering Expertise

  • Specialized Knowledge: Trained on marine engineering standards, codes, and regulations
  • Real-time Assistance: Instant responses to technical queries and calculations
  • Problem Diagnosis: Help with troubleshooting marine equipment and systems
  • Design Guidance: Support for marine engineering design and specifications

🎨 Modern User Interface

  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Dark Theme: Professional dark interface optimized for extended use
  • Real-time Chat: Smooth conversation flow with typing indicators
  • Message History: Edit and manage previous conversations
  • Markdown Support: Rich text formatting for technical responses

πŸ”§ Technical Capabilities

  • Marine Engineering Calculations: Engine performance, fuel consumption, stability
  • Equipment Specifications: Detailed technical specifications and standards
  • Maintenance Procedures: Step-by-step maintenance and repair guidance
  • Regulatory Compliance: IMO, USCG, and international maritime standards
  • Resource Integration: Access to authoritative marine engineering databases

πŸ—οΈ Architecture

The application follows a modern client-server architecture:

MarineGPT/
β”œβ”€β”€ client/                 # React TypeScript Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # UI Components
β”‚   β”‚   β”œβ”€β”€ services/       # API Services
β”‚   β”‚   └── lib/           # Utilities
β”‚   └── package.json
└── server/                # Node.js Express Backend
    β”œβ”€β”€ index.js           # Main server file
    β”œβ”€β”€ env.example        # Environment variables template
    └── package.json

Frontend (React + TypeScript)

  • React 19: Latest React with modern hooks and features
  • TypeScript: Type-safe development
  • Vite: Fast development and build tooling
  • Tailwind CSS: Utility-first styling
  • Lucide React: Beautiful icons
  • React Markdown: Rich text rendering

Backend (Node.js + Express)

  • Express.js: Fast, unopinionated web framework
  • Google Gemini AI: Advanced AI model for marine engineering
  • CORS: Cross-origin resource sharing
  • Nodemon: Development server with auto-reload
  • Dotenv: Environment variable management

πŸš€ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • Google Gemini AI API key

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/marine-gpt.git
    cd marine-gpt
  2. Install server dependencies

    cd server
    npm install
  3. Install client dependencies

    cd ../client
    npm install
  4. Configure Environment Variables

    Get your Gemini API key:

    Set up environment variables:

    cd server
    cp env.example .env

    Edit the .env file and add your API key:

    GEMINI_API_KEY=your_actual_api_key_here
    PORT=3000
    NODE_ENV=development
  5. Start the development servers

    Terminal 1 - Start the backend:

    cd server
    npm start

    Terminal 2 - Start the frontend:

    cd client
    npm run dev
  6. Access the application

    Open your browser and navigate to http://localhost:5173

πŸ“š Usage

Getting Started

  1. Open the application in your web browser
  2. Type your marine engineering question in the chat input
  3. Press Enter or click the send button
  4. Receive expert guidance from the AI assistant

Example Queries

  • "How do I calculate the fuel consumption for a marine diesel engine?"
  • "What are the IMO requirements for ballast water management?"
  • "Troubleshoot a marine generator that won't start"
  • "Design specifications for a ship's cooling system"
  • "Calculate vessel stability for different loading conditions"

Features

  • Edit Messages: Click on any message to edit and resend
  • Copy Responses: Use the copy button to save important information
  • Sidebar Navigation: Access different sections and features
  • Responsive Design: Works on desktop, tablet, and mobile devices

πŸ”§ Configuration

Environment Variables

The server uses the following environment variables:

Variable Description Required Default
GEMINI_API_KEY Google Gemini AI API key Yes -
PORT Server port No 3000
NODE_ENV Environment mode No development

CORS Configuration

The server is configured to accept requests from:

  • http://localhost:5173
  • http://127.0.0.1:5173
  • http://localhost:5175
  • http://127.0.0.1:5175

πŸ› οΈ Development

Available Scripts

Server:

npm start          # Start development server with nodemon
npm test           # Run tests (placeholder)

Client:

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

Project Structure

client/src/
β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”œβ”€β”€ ChatMessage.tsx  # Individual chat message component
β”‚   β”œβ”€β”€ Sidebar.tsx      # Navigation sidebar
β”‚   └── ui/             # Base UI components
β”œβ”€β”€ services/           # API and external services
β”‚   └── api.ts         # API communication
β”œβ”€β”€ lib/               # Utility functions and configurations
└── App.tsx            # Main application component

πŸ”’ Security

  • API Key Protection: Store API keys in environment variables (.env file)
  • Environment Files: .env files are gitignored to prevent exposure
  • CORS Configuration: Restrict cross-origin requests
  • Input Validation: Sanitize user inputs
  • HTTPS: Use HTTPS in production environments

πŸ“„ License

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

🀝 Contributing

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

πŸ“ž Support

For support and questions:

  • Create an issue in the GitHub repository
  • Contact the development team
  • Check the documentation for common solutions

πŸ™ Acknowledgments

  • Google Gemini AI for providing the AI capabilities
  • React Team for the amazing frontend framework
  • Marine Engineering Community for domain expertise
  • Open Source Contributors for various libraries and tools

Built with ❀️ for the Marine Engineering Community

βš“ Smooth sailing with MarineGPT! βš“

About

MarineGPT - AI Marine Engineering Assistant AI-powered chatbot for marine engineering professionals. Provides expert guidance on vessel maintenance, navigation systems, engineering calculations, and troubleshooting. Built with React, TypeScript, and Google Gemini AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors