Welcome to CalcTech, a versatile and modern calculator application built with Next.js, React, and Tailwind CSS. This application provides standard & scientific calculation, unit conversion, currency conversion, and AI-powered formula solving.
- Standard & Scientific Calculator: All the functions you need for basic arithmetic or complex scientific calculations.
- Unit Converter: Easily convert between different units for length, weight, and temperature.
- AI Formula Solver: Solves mathematical formulas like the Quadratic equation and provides step-by-step solutions.
To use the AI-powered features (like the Formula Solver), you need to configure your Gemini API key.
-
Get your API Key: Obtain a Gemini API key from Google AI Studio.
-
Create an environment file: In the root of the project, create a new file named
.env. -
Add the key to
.env: Add the following line to your.envfile, replacingYOUR_API_KEYwith the key you obtained:GEMINI_API_KEY=YOUR_API_KEY
Your application is now configured to use the AI features.
The calculator is divided into four main tabs:
-
Calculator: For all your basic and scientific calculation needs.
- Use the number and operator buttons for standard arithmetic.
- Toggle the "Sci" switch to access scientific functions like sine, cosine, tangent, logarithms, and more.
- Use the history button (clock icon) to view your recent calculations.
-
Unit Converter: Convert between different units of measurement.
- Enter the value you want to convert.
- Select the "From" and "To" units from the dropdown menus.
- The converter supports Length, Weight, and Temperature.
- Click "Convert" to see the result.
-
Formula Solver: Solve equations using formulas.
- Select a formula from the dropdown (e.g., Quadratic Formula).
- Enter the values for the required variables.
- Click "Solve with AI" to get the result and a step-by-step breakdown of the solution.
This is a Next.js web application. Building for different platforms involves using web technologies to create platform-specific packages.
The application is a standard web app and can be deployed to any modern web hosting platform that supports Node.js.
Development:
To run the app locally for development:
npm run devProduction Build:
To build the application for production:
npm run buildThis will create an optimized build in the .next directory. You can then start the production server with npm run start.
You can package the web application as a desktop app using a framework like Electron or Tauri. These tools wrap your web app in a native desktop window.
Example using Electron:
- Add Electron to your project:
npm install --save-dev electron electron-builder
- Configure Electron: You will need to create a main Electron process file (
main.jsor similar) to create a browser window and load your Next.js application. - Build the app: Configure
electron-builderin yourpackage.jsonto build distributable packages (.exe,.dmg,.deb, etc.).
To build for mobile, you can use a framework like Capacitor or React Native for Web. These tools allow you to wrap your web application in a native mobile shell and access native device features.
Example using Capacitor:
- Add Capacitor to your project:
npm install @capacitor/core @capacitor/cli npx cap init
- Add native platforms:
npm install @capacitor/android @capacitor/ios npx cap add android npx cap add ios
- Build your web app:
npm run build npx next export # If using static export
- Sync and run:
npx cap sync npx cap open android # Opens in Android Studio
From Android Studio or Xcode, you can build the native .apk (for Android) or .ipa (for iOS) file.