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.
- 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
- 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
- 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
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
- 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
- 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
- Node.js (v18 or higher)
- npm or yarn
- Google Gemini AI API key
-
Clone the repository
git clone https://github.com/yourusername/marine-gpt.git cd marine-gpt -
Install server dependencies
cd server npm install -
Install client dependencies
cd ../client npm install -
Configure Environment Variables
Get your Gemini API key:
- Visit Google AI Studio
- Create a new API key
Set up environment variables:
cd server cp env.example .envEdit the
.envfile and add your API key:GEMINI_API_KEY=your_actual_api_key_here PORT=3000 NODE_ENV=development
-
Start the development servers
Terminal 1 - Start the backend:
cd server npm startTerminal 2 - Start the frontend:
cd client npm run dev -
Access the application
Open your browser and navigate to
http://localhost:5173
- Open the application in your web browser
- Type your marine engineering question in the chat input
- Press Enter or click the send button
- Receive expert guidance from the AI assistant
- "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"
- 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
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 |
The server is configured to accept requests from:
http://localhost:5173http://127.0.0.1:5173http://localhost:5175http://127.0.0.1:5175
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 buildclient/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
- API Key Protection: Store API keys in environment variables (
.envfile) - Environment Files:
.envfiles are gitignored to prevent exposure - CORS Configuration: Restrict cross-origin requests
- Input Validation: Sanitize user inputs
- HTTPS: Use HTTPS in production environments
This project is licensed under the ISC License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For support and questions:
- Create an issue in the GitHub repository
- Contact the development team
- Check the documentation for common solutions
- 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! β