Skip to content

Web App for the Metal Input Line Entry System (MILES) – a comprehensive framework for describing surface properties using a standardized line notation format. MILES strings can be converted to numerical representations suitable for machine learning models in materials science applications.

Notifications You must be signed in to change notification settings

MILES4Materials/milescoder-web-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MILES Web: Machine Learning Metrics for Metal Surfaces and Beyond

The Metal Input Line Entry System (MILES) is a comprehensive framework for describing surface properties using a standardized line notation format. MILES strings can be converted to numerical representations suitable for machine learning models in materials science applications.

🌟 Features

🔄 MILES Converter

  • Encoder: Interactive form-based interface to create MILES strings from surface descriptions
  • Decoder: Convert MILES strings back to human-readable JSON format with AI-powered descriptions
  • Real-time encoding/decoding with debounced API calls for optimal performance
  • Currently supports for 5 hierarchical layers (L0-L5) covering material properties from basic metal type to advanced manufacturing parameters

🤖 MILES-GPT

  • AI-powered PDF data extraction using Large Language Models
  • Automatic conversion of scientific literature to structured MILES data
  • Batch processing capabilities for multiple PDF files
  • reCAPTCHA integration for security and rate limiting

📊 Comprehensive Material Description

  • L1: Base material type (metal) and specific metal element selection via interactive periodic table
  • L2: Alloy composition, microstructure (EBSD), and grain characteristics
  • L3: Conventional manufacturing processes (surface treatments, heat treatment)
  • L4: Electrolyte composition and corrosion testing parameters
  • L5: Additive manufacturing parameters and post-processing

🏗️ Architecture

Frontend

  • Framework: React 18 with TypeScript
  • Routing: TanStack Router with type-safe navigation
  • UI Library: Mantine v8 for consistent design system
  • State Management: Zustand for PDF processing, React Query for server state
  • Build Tool: Vite

Backend

  • Framework: FastAPI with automatic OpenAPI documentation
  • Data Validation: Pydantic v2 with custom MILES field validation
  • AI Integration: Helmholtz LLM API for PDF extraction and text generation
  • Rate Limiting: SlowAPI with IP-based throttling
  • Security: reCAPTCHA v2 verification, file validation, input sanitization

🚀 Getting Started

Prerequisites

  • Node.js 18+ and npm
  • Python 3.9+ and pip

Local Development

Frontend Setup

cd frontend
npm install
npm run dev

The frontend will be available at http://localhost:5173

Backend Setup

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

The API will be available at http://localhost:8000 with interactive docs at /docs

Environment Configuration

Frontend (.env)

VITE_API_BASE_URL=http://localhost:8000
VITE_RECAPTCHA_SITE_KEY=your_recaptcha_site_key

Backend (app/.env)

HELMHOLTZ_API_KEY=your_llm_api_key 
RECAPTCHA_SECRET_KEY=your_recaptcha_secret

📚 API Documentation

The backend provides a comprehensive REST API with automatic OpenAPI documentation:

Core Endpoints

  • POST /api/v1/encode - Convert JSON parameters to MILES string
  • POST /api/v1/decode - Convert MILES string to JSON format
  • POST /api/v1/extract - Extract MILES data from PDF files
  • POST /api/v1/describe - Generate AI descriptions of MILES data
  • GET /api/v1/metrics - Retrieve available MILES field definitions
  • GET /api/v1/schema - Get complete JSON schema for validation

Rate Limiting

  • Encoding/Decoding: 1000 requests/minute
  • PDF Extraction: 20 requests/minute
  • AI Descriptions: 20 requests/minute

🔒 Security Features

  • File Validation: Magic byte verification, size limits, extension checking
  • Input Sanitization: Regex-based cleaning of all user inputs
  • reCAPTCHA Integration: Bot protection on resource-intensive operations
  • Rate Limiting: IP-based throttling to prevent abuse
  • CORS Configuration: Restricted origins for production security

🤝 Contributing

We welcome contributions! Please see our GitHub organization for:

  • Issue tracking and feature requests
  • Contribution guidelines
  • Community discussions

👥 Team

This project is developed by researchers specializing in computational materials science, electrochemistry, and machine learning applications.

📄 License

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

🔗 Links

Live Application: https://miles.hereon.de GitHub Organization: MILES4Materials Research Paper: [Coming Soon]

MILES: Making surface descriptions machine-readable for the future of materials science.

About

Web App for the Metal Input Line Entry System (MILES) – a comprehensive framework for describing surface properties using a standardized line notation format. MILES strings can be converted to numerical representations suitable for machine learning models in materials science applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published