Documentation
Technical documentation for developers and future owners
Overview
Numlyze is a Next.js 14+ web application built with TypeScript, React, and Tailwind CSS. It provides a collection of financial calculators, crypto tools, and data analysis utilities in a clean, modern interface.
The application is designed to be fast, lightweight, and easy to extend. All calculations run client-side, ensuring privacy and performance.
Tech Stack
- Framework: Next.js 14+ (App Router)
- Language: TypeScript
- UI Library: React 19
- Styling: Tailwind CSS
- Charts: Recharts
- CSV Parsing: PapaParse
- State Management: React Hooks (useState, useMemo)
Environment Variables
The following environment variables can be configured:
Project Structure
Adding a New Calculator
- Create a calculation function in
lib/math/ - Create a calculator component in
components/calculators/ - Create a page in
app/calculators/[name]/page.tsx - Use the
CalculatorLayoutcomponent for consistent UI - Add the calculator to
app/calculators/page.tsx - Optionally add it to the homepage featured calculators
Adding a New Tool
- Create a tool component in
components/tools/ - Create a page in
app/tools/[name]/page.tsx - Add the tool to the homepage data tools section
Customization
Colors & Typography
Modify tailwind.config.ts to customize colors, fonts, and spacing. The app uses Tailwind's default color palette with blue as the primary accent color.
Branding
Update the site name in components/layout/Navbar.tsxand meta tags in app/layout.tsx.
Logo
Replace the text logo in components/layout/Navbar.tsxwith an image logo if desired.
Environment Variables
The following environment variables can be configured (all optional):
LLM Integration
The Data Insight tool includes a placeholder for LLM integration. To integrate an LLM (e.g., OpenAI):
- Set the
NUMLYZE_LLM_API_KEYenvironment variable - Uncomment and modify the
generateLLMInsightfunction inlib/analysis/dataInsight.ts - Update the Data Insight tool component to use the LLM function
See the commented code in lib/analysis/dataInsight.tsfor a complete example.
How to Deploy
Numlyze is configured for static export and ready to deploy on Cloudflare Pages, Vercel, or Netlify with no special configuration required.
How to Add Calculators
Follow these steps to add a new calculator to Numlyze:
- Create calculation function: Add a new file in
lib/math/with your calculation logic - Create calculator component: Add a component in
components/calculators/usingNumberInputandSelectField - Create page: Add
app/calculators/[name]/page.tsxusingCalculatorLayout - Add to index: Update
app/calculators/page.tsxwith your new calculator - Update homepage (optional): Add to
app/page.tsxfeatured calculators array
See existing calculators like LoanCalculator.tsx for reference implementation.
How to Toggle Ads
Monetization is optional and easily toggled in the configuration file. All ad placements can be enabled or disabled with a single setting.
When ads are disabled, placeholders show "Ad slot ready" text instead of actual ad code. This makes it easy to toggle monetization on/off.
Where to Edit Categories/Copy
Calculator Categories
Edit categories in:
app/calculators/page.tsx- Category filters and calculator listapp/page.tsx- Homepage calculator grid
Homepage Copy
Edit homepage content in:
app/page.tsx- Hero section, calculator descriptions, FAQ
Calculator Descriptions
Edit calculator descriptions in:
app/calculators/page.tsx- Calculator list descriptionsapp/page.tsx- Featured calculator descriptions- Individual calculator pages in
app/calculators/[name]/page.tsx
Navigation & Footer
Edit navigation and footer content in:
components/layout/Navbar.tsx- Navigation linkscomponents/layout/Footer.tsx- Footer links and content
Customization Guide
Branding & Colors
- Logo: Edit
components/layout/Navbar.tsx- Replace text logo with image if desired - Colors: Modify
tailwind.config.tsandapp/globals.cssfor theme colors - Site Name: Update
app/layout.tsxmetadata andcomponents/layout/Navbar.tsx
Content & Copy
- About Page: Edit
app/about/page.tsx - Documentation: Edit
app/docs/page.tsx - Meta Tags: Update SEO metadata in
app/layout.tsxand individual page files
Styling
- Global Styles: Edit
app/globals.cssfor CSS variables and global styles - Component Styles: All components use Tailwind CSS classes - modify directly in component files
- Typography: Update font families in
tailwind.config.ts