Skip to main content
Get your unit converter up and running in under 5 minutes. This guide will have you converting temperatures, lengths, weights, and velocities through a modern web interface powered by ZeroC Ice RPC.

Prerequisites

Before you begin, ensure you have:
  • Python 3.10 or 3.11 (recommended for best compatibility)
  • pip package manager
  • Terminal access (macOS/Linux) or PowerShell (Windows)

Quick Start

The fastest way to get started is using the automated run scripts included in the project.
1

Create and activate virtual environment

cd /path/to/Conversor_Unidades_Remoto-1
python3 -m venv .venv
source .venv/bin/activate
If PowerShell blocks script execution, run:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
2

Install dependencies

python -m pip install --upgrade pip
pip install -r requirements.txt
This installs:
  • Flask>=3.0,<4.0 - Web server framework
  • zeroc-ice>=3.7,<3.8 - ZeroC Ice RPC middleware
3

Make run script executable (macOS/Linux only)

chmod +x run.sh
4

Start the application

./run.sh
You’ll see:
🚀 Iniciando Conversor de Unidades...

[1/3] Levantando ICE Server en puerto 10000
ICE PID: 12345
[2/3] Levantando Flask Server en puerto 5000
Flask PID: 12346
[3/3] ¿Quieres levantar ngrok para acceso remoto? (s/n)
Type n and press Enter to continue without ngrok.
✅ Servidores activos:
   - ICE Server: http://localhost:10000
   - Web App: http://localhost:5000
Presiona Ctrl+C para detener
5

Open the web interface

Navigate to http://localhost:5000 in your browser.

Your First Conversion

Let’s convert 100°C to Fahrenheit:
1

Select category

Click the Temp tab (active by default).
2

Enter value

Type 100 in the Valor field.
3

Select units

  • De: Select °C (celsius)
  • Hacia: Select °F (fahrenheit)
4

Convert

Click Convertir or simply press Enter. The result 212 appears instantly.
Real-time conversion: The app converts automatically as you type or change units. No need to click the button every time!

Available Conversion Categories

Temperature

Units: Celsius (°C), Fahrenheit (°F), Kelvin (K)Example: 0°C → 32°F

Length

Units: Meters (m), Kilometers (km), Miles (mi), Feet (ft)Example: 1 mi → 1.609 km

Weight

Units: Kilograms (kg), Pounds (lb), Grams (g)Example: 70 kg → 154.324 lb

Velocity

Units: km/h (kmh), mph (mph), m/s (ms)Example: 120 kmh → 74.565 mph

Testing the API Directly

The Flask server exposes REST endpoints you can test with curl:

Convert Units

curl -X POST http://localhost:5000/api/convert \
  -H "Content-Type: application/json" \
  -d '{
    "categoria": "temperatura",
    "valor": 32,
    "desde": "fahrenheit",
    "hasta": "celsius"
  }'
Response:
{
  "resultado": 0.0
}

Get Available Units

curl http://localhost:5000/api/unidades/temperatura
Response:
{
  "unidades": "celsius, fahrenheit, kelvin"
}

Check Server Status

curl http://localhost:5000/api/status
Response:
{
  "connected": true,
  "servidor": "localhost:10000"
}

Using the Terminal Client

Test the ICE server directly without the web interface:
python backend/client.py
Output:
=== TEMPERATURA ===
100 celsius -> fahrenheit: 212.0000
0 celsius -> kelvin: 273.1500
98.6 fahrenheit -> celsius: 37.0000

=== LONGITUD ===
1 mi -> km: 1.6093
100 ft -> m: 30.4800
5 km -> m: 5000.0000

=== PESO ===
70 kg -> lb: 154.3236
1 lb -> g: 453.5920

=== VELOCIDAD ===
120 kmh -> mph: 74.5645
60 mph -> ms: 26.8224

=== UNIDADES DISPONIBLES ===
temperatura: celsius, fahrenheit, kelvin
longitud: m, km, mi, ft
peso: kg, lb, g
velocidad: kmh, mph, ms
The client directly invokes the ICE server methods defined in backend/Conversor.ice and implemented in backend/server.py:27-129.

Features to Explore

Swap Units

Click the swap button () to instantly exchange source and destination units.

Conversion History

Your last 5 conversions appear in the Recientes section. Click any history item to reload that conversion.

Theme Switching

Choose between Auto, Dark, and Light themes in the top-right selector.

Remote Access (Optional)

If you answered s when running the script, ngrok creates a public URL:
Forwarding https://abc-123-def.ngrok-free.app -> http://localhost:5000
Share this URL to let others use your converter remotely.

Stopping the Application

Press Ctrl+C in the terminal where you ran the script. The cleanup handler automatically stops both servers:
⏹️  Deteniendo servidores...

Troubleshooting

Check what’s using the ports:
lsof -i :10000
lsof -i :5000
Kill the process or change ports using environment variables (see Installation guide).
The Flask server can’t reach the ICE server. Verify:
  1. ICE server is running: ps aux | grep server.py
  2. Port 10000 is listening
  3. Both servers started successfully
Restart using the run script.
Ensure you’re using Python 3.10 or 3.11:
python3 --version
Create a fresh virtual environment and try again.
Hard refresh your browser:
  • Windows: Ctrl+F5
  • macOS: Cmd+Shift+R

Next Steps

Installation

Detailed setup guide with manual control and configuration options

Architecture

Learn how ZeroC Ice RPC connects the backend and frontend

API Reference

Complete endpoint documentation with examples

Development

Modify the ICE interface and regenerate stubs

Build docs developers (and LLMs) love