A sophisticated, mobile-first web application enabling users to calculate Simple & Compound Interest with precision, alongside a fully fictional standard calculator. Built with a focus on premium UI/UX, offline capabilities (PWA), and robust mathematical logic.
- Dual Modes: Switch seamlessly between Simple Interest and Compound Interest.
- Flexible Time Units: Calculate based on Years, Months, Days, Minutes, or even Seconds.
- Compounding Frequencies: Support for Annual, Semi-annual, Quarterly, and Monthly compounding.
- Real-time Formatting: Inputs automatically format with commas (e.g.,
1,00,000) for better readability (Indian Numbering System). - Smart Validation: Prevents negative inputs and visualizes calculation progress.
- Share Results: Generate proper text summaries of calculations and share them via native mobile sharing or clipboard.
- Live Preview: "Typing Mode" shows the equation large and the result small.
- Focus Mode: Hitting
=shifts focus to the result while keeping the history visible. - Smart Logic:
- Handles complex operations (e.g.,
-22 * 0). - Prevents syntax errors (e.g., multiple decimal points
5.5.5). - Auto-replaces operators when switching (e.g., type
+then-, it becomes-).
- Handles complex operations (e.g.,
- Backspace: Dedicated backspace button for easy correction.
- Mobile-First Design: Optimized for touch inputs with large, tactile buttons.
- Glassmorphism: Modern, clean aesthetics with soft shadows and gradients.
- Adaptive Layout: Responsive design that looks great on mobile and desktop.
- Animations: Smooth transitions for tabs, results, and button presses.
- Installable: Can be installed on mobile devices as a native app.
- Offline Support: Works without an internet connection using Service Workers.
- App Icons: Custom generated adaptive icons.
- Backend: Python (Flask)
- Frontend: HTML5, CSS3 (Custom Properties), JavaScript (ES6+)
- PWA: Web App Manifest, Service Workers
- No External CSS/JS Frameworks: Pure, lightweight code for maximum performance.
- Clone or Download the repository.
- Install Python (if not already installed).
- Install Dependencies:
pip install flask
- Run the Application:
python app.py
- Open in Browser:
- Local:
http://127.0.0.1:5000 - Network (Mobile):
http://<YOUR_IP>:5000
- Local:
This project is fully configured for deployment on Render.
- Push this code to a GitHub or GitLab repository.
- Log in to dashboard.render.com.
- Click New + -> Web Service.
- Connect your repository.
- Render will automatically detect the
render.yamlorProcfileand configure the build/start commands.- Build Command:
pip install -r requirements.txt - Start Command:
gunicorn app:app
- Build Command:
- Click Deploy.
Procfile: Specifies the start command (gunicorn app:app).requirements.txt: Lists dependencies (flask,gunicorn).render.yaml: (Optional) Blueprint for Infrastructure as Code.
interest_calculator/
├── app.py # Flask Backend Routes & Logic
├── templates/
│ └── index.html # Main Application UI
├── static/
│ ├── css/
│ │ └── styles.css # Premium Styling & Themes
│ ├── js/
│ │ └── scripts.js # Calculator Logic & Interactions
│ ├── images/ # Icons & Assets
│ ├── manifest.json # PWA Configuration
│ └── service-worker.js # Offline Caching Logic
└── README.md # Documentation
- Input Sanitization: Backend strictly validates numeric inputs to prevent errors.
- Overflow Protection: Limits calculation periods (e.g., max 1000 years) to prevent server hangs.
- Safe Evaluation: Standard calculator uses a sanitized
Functionconstructor instead ofeval()to prevent code injection while allowing complex math.
Created with ❤️ for a premium calculation experience.