Skip to content

StefanoPisano/mutuo-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿก๐Ÿ“Š Mutuo Simulator

Plan smarter. Simulate your mortgage, adjust variables in real time, and see how your future home truly costs.

A simple web application to simulate mortgage ("mutuo") calculations โ€” determine monthly payments, understand duration and rate impact, and preview estimated outcomes.

Built with TypeScript, React, Vite, and TailwindCSS. Uses MUI Icons and is structured for i18n (react-i18next).


๐Ÿš€ Features

  • ๐Ÿงฎ Mortgage amount input
  • ๐Ÿ” Adjustable interest rate
  • ๐Ÿ“… Duration (years) selection
  • ๐Ÿ’ต Variables such as value, rate, etc.
  • ๐Ÿ–ฅ๏ธ Responsive UI with range and text inputs
  • โ— Input validation with error messaging

๐Ÿ“ฆ Getting Started

Prerequisites

  • Node.js 18+ and npm 9+ recommended

Install

npm install

Run (Dev)

npm run dev

Vite will print a local URL (usually http://localhost:5173).

Build (Prod)

npm run build

The production build will be in the dist/ folder.

Preview (Serve built app)

npm run preview

Lint

npm run lint

๐Ÿ›  Tech Stack

  • TypeScript
  • React
  • Vite
  • TailwindCSS
  • MUI Icons
  • i18n: i18next, react-i18next, browser language detector, http backend

Project Structure (high level)

/
โ”œโ”€ src/
โ”‚  โ”œโ”€ components/         # Reusable UI and feature components
โ”‚  โ”œโ”€ pages/              # Route-level pages (e.g., Home, DashboardPage)
โ”‚  โ”œโ”€ App.*               # App entry (if present)
โ”‚  โ””โ”€ main.tsx            # React root bootstrap (typical Vite)
โ”œโ”€ public/                # Static assets
โ”œโ”€ index.html             # Vite HTML entry
โ”œโ”€ tailwind.config.js     # Tailwind configuration
โ”œโ”€ vite.config.ts         # Vite configuration
โ”œโ”€ eslint.config.js       # ESLint configuration
โ”œโ”€ tsconfig*.json         # TypeScript configs
โ””โ”€ package.json

Note: The UI uses Tailwind utility classes. Some components may import MUI icons. Internationalization packages are included, so translation files/providers might exist or be planned.


Deployment

This project includes a GitHub Pages deploy script:

  1. Ensure the repo is connected to GitHub and gh-pages package is installed (already in devDependencies).
  2. Set the repository settings for Pages to serve from the gh-pages branch (created by the deploy script).
  3. Run:
    npm run deploy
  4. If your project is not at the repo root (or needs a base path), configure base in vite.config.ts accordingly.

Absolutely! Here's the full Docker + Kubernetes section translated and polished in professional English for your README. It keeps all the commands, explanations, and workflow.


๐Ÿณ Docker & โ˜ธ๏ธ Kubernetes Deployment


๐Ÿณ Docker

๐Ÿ“ฆ Build the image

docker build -t mutuo-simulator:1.0.0 .

โ–ถ๏ธ Run container locally

docker compose up

Access the app at:

http://localhost:3000/mutuo-simulator

โ˜ธ๏ธ Kubernetes

The application is deployed on Kubernetes using:

  • Deployment
  • Service
  • Ingress

Folder structure:

k8s/
 โ”œโ”€โ”€ deployment.yaml
 โ”œโ”€โ”€ service.yaml
 โ””โ”€โ”€ ingress.yaml

๐Ÿš€ Prerequisites

minikube start

Enable ingress:

minikube addons enable ingress

Start the tunnel (required for Ingress access):

sudo minikube tunnel

๐Ÿ“ฆ Deployment

Build & load the image

docker compose build
minikube image load mutuo-simulator:1.0.0

Apply all resources:

kubectl apply -f k8s/

Or individually:

kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yaml

๐ŸŒ Access the application

The app is exposed via Ingress at:

http://mutuo.localtest.me/mutuo-simulator

If needed, add this to your /etc/hosts:

<MINIKUBE-IP> mutuo.localtest.me

Retrieve the Minikube IP:

kubectl get ingress

๐Ÿ”Ž Kubernetes cheatsheet

๐Ÿ“œ View logs

Description Command
POD Logs kubectl logs <pod-name>
POD Logs (tail) kubectl logs -f <pod-name>

๐Ÿ›  Debugging

Description Command
Describe a POD kubectl describe pod <pod-name>
Enter a POD bash kubectl exec -it <pod-name> -- sh
Restart deployment kubectl rollout restart deployment mutuo-simulator-deployment
Check rollout status kubectl rollout status deployment mutuo-simulator-deployment
Check resource status kubectl get [pods/deployments/svc/all]

๐Ÿ—‘ Delete resources

Description Command
Delete all resources kubectl delete -f k8s/
Delete Deployment kubectl delete deployment mutuo-simulator-deployment
Delete Service kubectl delete service service mutuo-simulator-svc
Delete Ingress kubectl delete ingress mutuo-simulator-ingress

๐Ÿ” Development workflow

docker build -t mutuo-simulator:latest .
kubectl rollout restart deployment mutuo-simulator-deployment
kubectl get pods

License

This project is licensed under the GNU General Public License. See the LICENSE file for details.


Acknowledgements

  • React and Vite communities
  • TailwindCSS
  • MUI Icons
  • i18next ecosystem

About

Interactive mortgage simulator built with React, TypeScript, and TailwindCSS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors