From 4ac5d13881a423122de1b1d2b6eb3e287513589f Mon Sep 17 00:00:00 2001 From: "Agustin Bustos Piasentini (Nitro)" <63634574+abustosp@users.noreply.github.com> Date: Sat, 31 Jan 2026 19:54:36 -0300 Subject: [PATCH] Refactor project structure to use Vite with React, add Docker support, and implement Nginx for serving static files --- .dockerignore | 3 + .gitignore | 3 + Dockerfile | 22 +-- docker-compose.yml | 8 +- index.html | 18 ++ nginx.conf | 16 ++ package.json | 19 ++ src/App.jsx | 211 ++++++++++++++++++++ src/main.jsx | 10 + src/styles.css | 468 +++++++++++++++++++++++++++++++++++++++++++++ vite.config.js | 10 + 11 files changed, 770 insertions(+), 18 deletions(-) create mode 100644 index.html create mode 100644 nginx.conf create mode 100644 package.json create mode 100644 src/App.jsx create mode 100644 src/main.jsx create mode 100644 src/styles.css create mode 100644 vite.config.js diff --git a/.dockerignore b/.dockerignore index b19f5d8..7dc619f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,6 @@ __pycache__/ .gitignore venv/ .venv/ +node_modules/ +dist/ +.vite/ diff --git a/.gitignore b/.gitignore index aa3017a..fd253f5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ __pycache__/ venv/ env/ .env +node_modules/ +dist/ +.vite/ diff --git a/Dockerfile b/Dockerfile index a82d6dd..c9a2bd6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ -FROM python:3.12-slim - -ENV PYTHONDONTWRITEBYTECODE=1 \ - PYTHONUNBUFFERED=1 \ - FLASK_APP=app.py \ - FLASK_RUN_HOST=0.0.0.0 \ - FLASK_RUN_PORT=5000 +FROM node:20-alpine AS build WORKDIR /app -COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt +COPY package.json ./ +RUN npm install --no-audit --no-fund COPY . . +RUN npm run build -EXPOSE 5000 -CMD ["flask", "run"] +FROM nginx:alpine + +COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/dist /usr/share/nginx/html + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/docker-compose.yml b/docker-compose.yml index 32bbfa4..c7f78d7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,4 @@ services: web: build: . ports: - - "5000:5000" - volumes: - - .:/app - environment: - - FLASK_ENV=development - - FLASK_DEBUG=1 - - FLASK_RUN_HOST=0.0.0.0 + - "8080:80" diff --git a/index.html b/index.html new file mode 100644 index 0000000..fa04964 --- /dev/null +++ b/index.html @@ -0,0 +1,18 @@ + + + + + + Camping Fénix | Misiones + + + + + +
+ + + diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..3f9b5c3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri /index.html; + } + + location /assets/ { + expires 1y; + add_header Cache-Control "public, immutable"; + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..fcd0c13 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "camping-fenix", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview --host" + }, + "dependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@vitejs/plugin-react": "^4.2.1", + "vite": "^5.0.0" + } +} diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..79a01f9 --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,211 @@ +const HERO_FEATURES = ['WiFi Satelital', 'Arroyo Natural', 'Parrillas', 'Pet Friendly'] + +const FEATURES = [ + 'WiFi en todo el camping', + 'Arroyo dentro de la propiedad', + 'Parrillas listas para usar', + 'Cantina y proveeduría' +] + +const GALLERY_ITEMS = [ + { + title: 'Río y vegetación', + description: 'Senderos junto al agua con sombra natural.', + image: 'https://placehold.co/800x600/2F4F4F/FFFFFF?text=Rio+y+Naturaleza' + }, + { + title: 'Área de fogón', + description: 'Espacio amplio para compartir y cocinar al fuego.', + image: 'https://placehold.co/800x600/EAD7C3/2F4F4F?text=Area+de+Fogon' + }, + { + title: 'Cabañas acogedoras', + description: 'Descanso cómodo rodeado de naturaleza.', + image: 'https://placehold.co/800x600/2F4F4F/FFFFFF?text=Cabanas' + }, + { + title: 'Zona de acampe', + description: 'Amplios espacios verdes para instalar tu carpa.', + image: 'https://placehold.co/800x600/EAD7C3/2F4F4F?text=Zona+de+Acampe' + }, + { + title: 'Parrillas equipadas', + description: 'Parrillas listas con todo lo necesario para cocinar.', + image: 'https://placehold.co/800x600/2F4F4F/FFFFFF?text=Parrillas' + }, + { + title: 'Arroyo cristalino', + description: 'Agua fresca y clara dentro del predio para disfrutar.', + image: 'https://placehold.co/800x600/EAD7C3/2F4F4F?text=Arroyo' + }, + { + title: 'Senderos naturales', + description: 'Caminos rodeados de vegetación para explorar.', + image: 'https://placehold.co/800x600/2F4F4F/FFFFFF?text=Senderos' + }, + { + title: 'Área de descanso', + description: 'Espacios con sombra para relajarse y disfrutar.', + image: 'https://placehold.co/800x600/EAD7C3/2F4F4F?text=Descanso' + }, + { + title: 'Vista panorámica', + description: 'Hermosos paisajes de la selva misionera.', + image: 'https://placehold.co/800x600/2F4F4F/FFFFFF?text=Vista+Panoramica' + } +] + +const MAP_EMBED_URL = 'https://www.google.com/maps?q=Fenix%20Camping%20Misiones&output=embed' +const MAP_LINK = 'https://maps.app.goo.gl/7LycqCiKgPXpbSUf8' +const WHATSAPP_NUMBER = '+543765253409' +const WHATSAPP_LINK = `https://wa.me/${WHATSAPP_NUMBER.replace('+', '')}` + +function App() { + const year = new Date().getFullYear() + + return ( + <> + + +
+
+ Naturaleza en Misiones +

+ Tu refugio para
reconectar con la calma. +

+

+ Camping Fénix ofrece acceso directo al río, espacios verdes y todas las comodidades para una escapada + perfecta en la selva. +

+ +
+ + Ver Galería + + + Consultar disponibilidad + +
+ +
+ {HERO_FEATURES.map((feature) => ( +
+ {feature} +
+ ))} +
+
+
+ +
+
+
+
+ Comodidades +

Todo lo necesario

+

Disfruta de la experiencia de acampar sin renunciar a la comodidad.

+
+
+ {FEATURES.map((feature) => ( +
+

{feature}

+
+ ))} +
+
+
+ +
+
+
+ Galería +

Nuestros espacios

+

Explora el camping antes de tu visita.

+
+
+ {GALLERY_ITEMS.map((item) => ( +
+
+ {item.title} +
+
+

{item.title}

+

{item.description}

+
+
+ ))} +
+
+
+ +
+
+
+ Ubicación +

Cómo llegar

+
+
+ +
+
+ + Abrir en Google Maps + +
+
+
+
+ + + + ) +} + +export default App diff --git a/src/main.jsx b/src/main.jsx new file mode 100644 index 0000000..42290fa --- /dev/null +++ b/src/main.jsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App.jsx' +import './styles.css' + +ReactDOM.createRoot(document.getElementById('root')).render( + + + +) diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..fedae75 --- /dev/null +++ b/src/styles.css @@ -0,0 +1,468 @@ +:root { + /* Color Palette - Green, Earth, Yellow */ + --primary: #2F4F4F; /* Deep Forest Green */ + --primary-hover: #264040; + --secondary: #EAD7C3; /* Earthy Sand/Beige */ + --accent: #F4D35E; /* Muted Sun Yellow */ + + --bg-body: #FAFAF9; /* Off-white */ + --bg-surface: #FFFFFF; /* Pure white for cards */ + --bg-alt: #F2F0E9; /* Light earthy background for sections */ + + --text-main: #1A1C1B; /* Dark Grey/Green */ + --text-muted: #5C5F5E; /* Muted Grey */ + --text-light: #F9F9F9; /* Light text for dark backgrounds */ + + --border-light: rgba(47, 79, 79, 0.1); + + /* Spacing & Layout */ + --container-width: 1200px; + --header-height: 80px; + + /* Effects */ + --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05); + --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08); + --radius-sm: 8px; + --radius-md: 16px; + --radius-lg: 24px; +} + +/* Reset & Base */ +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html { + scroll-behavior: smooth; + font-size: 16px; +} + +body { + font-family: 'Manrope', sans-serif; + background-color: var(--bg-body); + color: var(--text-main); + line-height: 1.6; + -webkit-font-smoothing: antialiased; +} + +img { + max-width: 100%; + height: auto; + display: block; +} + +a { + text-decoration: none; + color: inherit; + transition: all 0.2s ease; +} + +ul { + list-style: none; +} + +/* Typography */ +h1, h2, h3, h4, h5, h6 { + font-weight: 700; + line-height: 1.2; + letter-spacing: -0.02em; + color: var(--primary); +} + +h1 { + font-size: clamp(2.5rem, 5vw, 4rem); +} + +h2 { + font-size: clamp(2rem, 4vw, 2.5rem); + margin-bottom: 1rem; +} + +h3 { + font-size: 1.25rem; + margin-bottom: 0.5rem; +} + +p { + margin-bottom: 1rem; + color: var(--text-muted); +} + +.eyebrow { + text-transform: uppercase; + font-size: 0.75rem; + font-weight: 700; + letter-spacing: 0.1em; + color: var(--accent); /* Yellow accent */ + margin-bottom: 0.5rem; + display: block; +} + +/* Buttons */ +.button { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.75rem 1.5rem; + border-radius: var(--radius-sm); + font-weight: 600; + font-size: 1rem; + cursor: pointer; + transition: all 0.2s ease; +} + +.button.primary { + background-color: var(--primary); + color: var(--text-light); + border: 2px solid var(--primary); +} + +.button.primary:hover { + background-color: var(--primary-hover); + border-color: var(--primary-hover); + transform: translateY(-2px); +} + +.button.ghost { + background-color: transparent; + color: var(--primary); + border: 2px solid var(--border-light); +} + +.button.ghost:hover { + border-color: var(--primary); + background-color: var(--bg-surface); +} + +.button.full { + width: 100%; +} + +/* Layout Utilities */ +.container { + max-width: var(--container-width); + margin: 0 auto; + padding: 0 1.5rem; +} + +.section { + padding: 5rem 0; +} + +/* Navigation */ +.nav { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: var(--header-height); + background: rgba(250, 250, 249, 0.95); /* matching bg-body */ + backdrop-filter: blur(10px); + z-index: 1000; + border-bottom: 1px solid var(--border-light); + display: flex; + align-items: center; +} + +.nav-container { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; +} + +.logo { + font-weight: 800; + font-size: 1.5rem; + color: var(--primary); + letter-spacing: -0.03em; +} + +.nav-links { + display: flex; + gap: 2rem; + align-items: center; +} + +@media (max-width: 768px) { + .nav-container { + flex-direction: column; + gap: 1rem; + padding-bottom: 1rem; + } + + .nav { + height: auto; + } + + .nav-links { + gap: 1rem; + flex-wrap: wrap; + justify-content: center; + width: 100%; + } + + .hero { + padding-top: calc(var(--header-height) + 8rem); + } +} + +.nav-link { + font-weight: 500; + font-size: 0.95rem; + color: var(--text-main); +} + +.nav-link:hover { + color: var(--primary); +} + +.nav-cta { + background-color: var(--accent); + color: var(--primary); /* Contrast on yellow */ + padding: 0.5rem 1rem; + border-radius: var(--radius-sm); + font-weight: 700; +} + +.nav-cta:hover { + background-color: #e3c048; /* darker yellow */ +} + +/* Hero Section */ +.hero { + padding-top: calc(var(--header-height) + 4rem); + padding-bottom: 6rem; + background-color: var(--bg-body); + text-align: center; + position: relative; + overflow: hidden; +} + +/* Abstract background shapes */ +.hero::before { + content: ''; + position: absolute; + top: -10%; + right: -5%; + width: 40vw; + height: 40vw; + background: var(--secondary); + border-radius: 50%; + opacity: 0.3; + filter: blur(80px); + z-index: 0; +} + +.hero::after { + content: ''; + position: absolute; + bottom: 10%; + left: -5%; + width: 30vw; + height: 30vw; + background: var(--accent); + border-radius: 50%; + opacity: 0.2; + filter: blur(80px); + z-index: 0; +} + +.hero-content { + position: relative; + z-index: 1; + max-width: 800px; + margin: 0 auto; +} + +.hero-subtitle { + font-size: 1.25rem; + max-width: 600px; + margin: 0 auto 2rem; +} + +.hero-actions { + display: flex; + gap: 1rem; + justify-content: center; + margin-bottom: 3rem; + flex-wrap: wrap; +} + +.hero-features { + display: flex; + gap: 1.5rem; + justify-content: center; + flex-wrap: wrap; + font-size: 0.9rem; + color: var(--text-muted); +} + +.feature-pill { + background: var(--bg-surface); + padding: 0.5rem 1rem; + border-radius: 100px; + border: 1px solid var(--border-light); + display: flex; + align-items: center; + gap: 0.5rem; + box-shadow: var(--shadow-soft); +} + +.feature-pill::before { + content: ''; + width: 8px; + height: 8px; + border-radius: 50%; + background-color: var(--primary); +} + +/* Services Section */ +.services { + background-color: var(--bg-alt); +} + +.section-header { + text-align: center; + max-width: 600px; + margin: 0 auto 3rem; +} + +.features-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 1.5rem; +} + +.service-card { + background: var(--bg-surface); + padding: 2rem; + border-radius: var(--radius-md); + box-shadow: var(--shadow-soft); + border: 1px solid transparent; + transition: all 0.3s ease; + text-align: center; +} + +.service-card:hover { + border-color: var(--secondary); + transform: translateY(-5px); + box-shadow: var(--shadow-hover); +} + +/* Gallery Section */ +.gallery-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 2rem; +} + +.gallery-item { + background: var(--bg-surface); + border-radius: var(--radius-md); + overflow: hidden; + box-shadow: var(--shadow-soft); + transition: transform 0.3s ease; +} + +.gallery-item:hover { + transform: translateY(-5px); + box-shadow: var(--shadow-hover); +} + +.gallery-image-wrapper { + width: 100%; + height: 250px; + overflow: hidden; + background-color: var(--secondary); /* placeholder color */ +} + +.gallery-image-wrapper img { + width: 100%; + height: 100%; + object-fit: cover; + transition: transform 0.5s ease; +} + +.gallery-item:hover .gallery-image-wrapper img { + transform: scale(1.05); +} + +.gallery-content { + padding: 1.5rem; +} + +.gallery-content h3 { + font-size: 1.25rem; + margin-bottom: 0.5rem; + color: var(--primary); +} + +/* Map Section */ +.map-section { + background-color: var(--bg-alt); +} + +.map-container { + background: var(--bg-surface); + padding: 1rem; + border-radius: var(--radius-lg); + box-shadow: var(--shadow-soft); + overflow: hidden; +} + +.map-frame { + width: 100%; + height: 400px; + border: none; + border-radius: var(--radius-md); + filter: grayscale(0.2); /* mute the map slightly */ +} + +/* Contact/Footer */ +.footer { + background-color: var(--primary); + color: var(--text-light); + padding: 4rem 0 2rem; + text-align: center; +} + +.contact-box { + background-color: rgba(255, 255, 255, 0.05); + padding: 3rem; + border-radius: var(--radius-lg); + max-width: 600px; + margin: 0 auto 3rem; + border: 1px solid rgba(255, 255, 255, 0.1); +} + +.contact-box h2 { + color: var(--text-light); + margin-bottom: 1.5rem; +} + +.footer-bottom { + border-top: 1px solid rgba(255, 255, 255, 0.1); + padding-top: 2rem; + font-size: 0.85rem; + color: rgba(255, 255, 255, 0.6); +} + +/* Utilities */ +.hidden { + display: none; +} + +@media (max-width: 600px) { + h1 { + font-size: 2.5rem; + } + .hero-actions { + flex-direction: column; + } + .button { + width: 100%; + } +} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..6b5e882 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [react()], + server: { + host: true, + port: 5173 + } +})