The Smart Calc
Multilingual Financial Calculator Platform
A bilingual financial calculator platform with a secure admin CMS, multilingual blog system, and SEO-first architecture.
About the Project
A multilingual financial calculator platform providing free financial tools alongside a CMS-driven educational blog.
Individuals, students, investors, and anyone needing quick financial calculations without creating an account.
To simplify everyday financial calculations while making educational financial content available in both English and Arabic.
What I Built
Designed and implemented both frontend and backend architecture.
Built reusable financial calculation modules with TypeScript.
Implemented complete bilingual support including RTL layouts.
Implemented structured metadata, JSON-LD and multilingual SEO.
What It Can Do
12 Financial Calculators
Admin Dashboard
Bilingual Blog
Password Reset
Engineering Deep Dive
Click any card to read the full technical detail.
Challenges & Trade-offs
The real decisions behind the architecture.
How to handle financial arithmetic without floating-point errors in JavaScript
Replaced native JavaScript Number arithmetic with the decimal.js library across all 12 calculator modules. Every intermediate value in a multi-step calculation (e.g. monthly rate derivation inside loan amortization) is kept as a Decimal instance and only converted to a primitive string for display.
Adds a dependency and slightly more verbose code, but eliminates the class of bugs where 0.1 + 0.2 === 0.30000000000000004 — critical for a platform where users trust the numbers.
How to serve bilingual content without a third-party translation API at runtime
Stored all UI strings and calculator labels in flat JSON message files per locale (en.json, ar.json) loaded at build time. Next.js middleware maps each incoming request to the correct locale and the message file is imported statically in Server Components.
Translations must be maintained manually in the JSON files — there is no auto-sync with a translation platform — but page load has zero network round-trip overhead for i18n.
How to monetize a free calculator platform without degrading performance
Google AdSense ad units are loaded lazily via a dynamic import behind an IntersectionObserver. The ad script is deferred until the ad slot enters the viewport, so it never blocks the main thread during initial page load.
Ads appear slightly later than on platforms that load them eagerly, but Core Web Vitals scores (LCP, CLS) are not impacted by ad loading weight.
Loan amortization schedules for long tenures (30-year mortgages) were generating tables with 360 rows, causing noticeable render lag on low-end devices.
Implemented virtual pagination on the amortization table: only the first 12 rows are rendered on mount, with a 'Load more' button that appends the next 12 rows. The full schedule is computed once and held in a ref, so pagination is pure DOM addition with no recomputation.
Initial render time dropped from ~400ms to under 50ms for a 30-year schedule while keeping the full data available without a round-trip.
RTL layout required more than a CSS direction flip — form inputs, number formatting, and error message alignment all had to adapt to Arabic reading order.
Created a useLocale hook that exposes the current locale and a dir value. Components that need direction-aware styles consume dir and apply conditional class names. Number formatting uses Intl.NumberFormat with the locale string so Arabic numerals render correctly in ar locale.
The Arabic version of the site is a full RTL experience — inputs, labels, error states, and number outputs all respect Arabic reading order without any hardcoded LTR overrides.
System Design
What Makes It Fast
all calculator and blog pages are pre-rendered at build time; zero server computation per visitor request
enabled to automatically memoize components, eliminating the need for manual useMemo and useCallback on calculator form components
Google AdSense units are loaded behind an IntersectionObserver so the ad script never blocks the initial page render
Next.js Image component serves AVIF/WebP with correct srcset and sizes; layout-shift from image loading is prevented with explicit width and height
Security Model
tokens are never exposed to client-side JavaScript
bcrypt password hashing with a cost factor of 12 applied to all admin account passwords
Admin middleware runs server-side on every /admin route before any page data is fetched or rendered
Rate limiting on the login endpoint prevents brute-force attacks on the admin account
How It Ships
Screenshots



