Skip to content

albindavidc/mathmind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ข MathMind โ€“ AI-Powered Math Intelligence

A hybrid AI + Standard Calculator built with React, TypeScript, and Vite, enhanced by Google Gemini 2.5 Flash for solving complex mathematical problems, showing reasoning, and providing step-by-step solutions.

MathMind combines speed, clarity, and intelligenceโ€”perfect for students, engineers, and anyone working with numbers.


๐Ÿš€ Live Demo

GitHub Pages Deployment: https://albindavidc.github.io/MathMind/


โœจ Features

๐Ÿงฎ Standard Calculator

  • Fast, responsive scientific keypad
  • Real-time arithmetic with operator chaining
  • Clean, monospace display
  • Error handling & input sanitization

๐Ÿค– AI Solver Mode (Gemini 2.5 Flash)

  • Natural language math questions

  • Solves:

    • Algebra
    • Word problems
    • Geometry
    • Derivatives
    • Unit conversions
    • Multi-step reasoning
  • Structured JSON response: answer + steps + reasoning

๐Ÿ“œ History Sidebar

  • Stores both AI and standard calculations
  • Timestamped logs
  • Step-by-step explanations
  • One-click clear

โœจ Beautiful UI & Animations

  • Neon-themed dark design
  • Glassmorphism cards
  • Animated splash screen
  • Smooth transitions
  • Fully responsive

๐Ÿ“ Project Structure

albindavidc-mathmind/
โ”‚โ”€โ”€ App.tsx
โ”‚โ”€โ”€ index.tsx
โ”‚โ”€โ”€ index.html
โ”‚โ”€โ”€ package.json
โ”‚โ”€โ”€ tsconfig.json
โ”‚โ”€โ”€ vite.config.ts
โ”‚โ”€โ”€ constants.ts
โ”‚โ”€โ”€ types.ts
โ”‚โ”€โ”€ metadata.json
โ”‚
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ AIInterface.tsx
โ”‚   โ”œโ”€โ”€ Calculator.tsx
โ”‚   โ”œโ”€โ”€ HistorySidebar.tsx
โ”‚   โ””โ”€โ”€ SplashScreen.tsx
โ”‚
โ”œโ”€โ”€ services/
โ”‚   โ””โ”€โ”€ geminiService.ts
โ”‚
โ””โ”€โ”€ .github/
    โ””โ”€โ”€ workflows/
        โ””โ”€โ”€ deploy.yml

โš™๏ธ Tech Stack

Frontend

  • React 19
  • TypeScript
  • TailwindCSS
  • Vite
  • PWA

AI

  • Google Gemini 2.5 Flash
  • JSON schema-driven responses
  • Structured math reasoning

Deployment

  • GitHub Actions
  • GitHub Pages

๐Ÿ› ๏ธ Environment Variables

MathMind uses an API key for Gemini.

Set this in your GitHub repo:

Settings โ†’ Secrets โ†’ Actions โ†’ New Secret โ†’ API_KEY

The app automatically picks it from:

process.env.API_KEY

๐Ÿงฉ Local Development

1๏ธโƒฃ Install dependencies

npm install

2๏ธโƒฃ Start development server

npm run dev

3๏ธโƒฃ Build for production

npm run build

4๏ธโƒฃ Preview production build

npm run preview

๐Ÿš€ Automatic Deployment (GitHub Actions)

This repo includes:

.github/workflows/deploy.yml

Deployment happens when you:

  • Push to main
  • Or manually trigger from Actions

The output is automatically published to GitHub Pages.

To enable Pages:

  1. Go to Settings โ†’ Pages
  2. Set Source = GitHub Actions

Done. Every push updates the live site.


๐Ÿง  AI Mode Details

MathMind sends structured requests to Gemini:

Input

User prompt or math problem.

Output Schema

{
  "answer": "string",
  "steps": ["string"],
  "reasoning": "string"
}

The interface displays:

  • The final answer
  • Steps (in the History Sidebar)
  • A brief reasoning section

๐Ÿงผ Code Quality

Configured with:

  • "strict": true in TypeScript
  • "noUnusedLocals": true
  • "noUnusedParameters": true
  • Modular components
  • Clean service layers

๐Ÿค Contributing

Pull requests are welcome! Open issues, submit improvements, or request features.


๐Ÿ”’ Security

  • API key stored via GitHub Secrets
  • Build injects environment-based secure keys
  • No API key appears in version control

๐Ÿ“„ License

MIT License Free to use, modify, and improve.


๐Ÿ‘จโ€๐Ÿ’ป Author

Albin David C Building modern, intelligent, beautifully-designed web applications.

About

Developed with AI Studio - Calculator & AI Math problem solver

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published