Skip to content

Toseef-Ahmad/interections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Interections

A collection of free online interactive calculators and math tools built with React. Features Pascal's Triangle Calculator, Matrix Calculator, Mechanical Calculator, and more. All tools include step-by-step solutions, visual feedback, and educational resources. Perfect for students, teachers, and professionals.

Popular Tools:

  • ๐Ÿงฎ Mechanical Gear Calculator
  • ๐Ÿ“ Matrix Calculator (coming soon)
  • ๐Ÿ”บ Pascal's Triangle Calculator (coming soon)
  • ๐Ÿ”ข And many more interactive math tools!

Deployed on GitHub Pages with full SEO optimization.

๐Ÿš€ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn

Installation

  1. Clone the repository:
git clone <your-repo-url>
cd interections
  1. Install dependencies:
npm install
  1. Start development server:
npm start

The app will open at http://localhost:3000

๐Ÿ“ Project Structure

interections/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ pages/              # Individual page components
โ”‚   โ”‚   โ”œโ”€โ”€ ExamplePage.js  # Example component
โ”‚   โ”‚   โ””โ”€โ”€ index.js        # Pages registry
โ”‚   โ”œโ”€โ”€ App.js              # Main app with routing
โ”‚   โ”œโ”€โ”€ App.css             # App styles
โ”‚   โ”œโ”€โ”€ index.js            # Entry point
โ”‚   โ””โ”€โ”€ index.css           # Global styles
โ”œโ”€โ”€ public/                 # Public assets
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ create-page.js      # Script to create new pages
โ”‚   โ””โ”€โ”€ clean.js            # Clean build artifacts
โ”œโ”€โ”€ .github/
โ”‚   โ””โ”€โ”€ workflows/
โ”‚       โ””โ”€โ”€ deploy.yml      # GitHub Actions deployment
โ””โ”€โ”€ package.json

โž• Adding a New Interactive Tool

๐Ÿ“š Complete Guide

๐Ÿ‘‰ See PAGE_CREATION_GUIDE.md for the complete guide covering:

  • Step-by-step page creation (script & manual methods)
  • SEO best practices and metadata requirements
  • Naming conventions and file structure
  • Content guidelines and examples
  • Testing and deployment procedures

Quick Start

npm run create:page your-tool-name

This automatically:

  • โœ… Creates the component file
  • โœ… Registers it in routing
  • โœ… Sets up basic SEO metadata
  • โœ… Generates the correct URL structure

Popular Tools to Build

See INTERACTIVE_TOOLS_GUIDE.md for:

  • Popular tool categories (Calculators, Visualizations, Linear Algebra, etc.)
  • SEO-friendly description templates
  • Popular keywords to target
  • Examples: Pascal's Triangle, Matrix Inverse, etc.

๐Ÿ› ๏ธ Development

Running Locally

npm start

Visit http://localhost:3000 to see the home page with all components listed.

Visit http://localhost:3000/xyz to see a specific component.

Building for Production

npm run build

This creates an optimized production build in the build/ directory.

Cleaning Build Artifacts

npm run clean

๐Ÿ“ฆ Deployment

Automatic Deployment (GitHub Actions)

The repository is configured with GitHub Actions to automatically deploy to GitHub Pages when you push to the main branch.

Setup Steps:

  1. Go to your repository on GitHub
  2. Navigate to Settings โ†’ Pages
  3. Under Source, select GitHub Actions
  4. Update homepage in package.json to match your repo name:
    {
      "homepage": "/your-repo-name"
    }
  5. Push your changes to the main branch
  6. The workflow will automatically build and deploy your app

Manual Deployment

If you prefer to deploy manually:

npm run build
npm run deploy

Note: Make sure you have gh-pages installed and configured with your GitHub credentials.

๐Ÿ”ง Configuration

GitHub Pages Base Path

Update the homepage field in package.json to match your GitHub repository name:

{
  "homepage": "/your-repo-name"
}

This ensures all routes work correctly on GitHub Pages.

๐Ÿ“ Available Scripts

Command Description
npm start Start development server
npm run build Build for production
npm test Run tests
npm run create:page <name> Create a new page component
npm run clean Remove build artifacts
npm run deploy Deploy to GitHub Pages (manual)

๐ŸŽฏ How It Works

  • Single React App: One React application with React Router
  • Multiple Pages: Each page is a single React component in src/pages/
  • Automatic Routing: Pages are automatically registered and routed
  • Home Page: Lists all available components with links
  • Unique URLs: Each component has its own URL like /xyz, /abc, etc.

๐Ÿ“„ Example: Creating the "xyz" Component

npm run create:page xyz

This creates:

  • src/pages/XyzPage.js - Your component file
  • Registers it at route /xyz
  • Makes it appear on the home page

Then edit src/pages/XyzPage.js to add your interactive component code!

๐Ÿ› Troubleshooting

Routes Not Working on GitHub Pages

  • Make sure homepage in package.json matches your repo name
  • Ensure you're using BrowserRouter with basename (already configured)
  • Check that GitHub Pages is set to use GitHub Actions as the source

Component Not Appearing

  • Make sure the component is registered in src/pages/index.js
  • Check that the component name matches the route (kebab-case)
  • Restart the dev server after adding new pages

๐Ÿ“„ License

GPL-2.0

๐Ÿค Contributing

Feel free to add new interactive components! Each component should be self-contained and independent.