- Replace all /login.html redirects with /login in admin.html
- Remove /login.html route from server
- Update dashboard charts to load real data from API
- Add initCharts() and loadDashboardData() functions
- Remove static chart data and use dynamic API data
- Update stats counters to animate with real values
- Change redirect from /login.html to /login in admin.html
- Add /login.html route in server for backward compatibility
- Both /login and /login.html now serve the same login page
- Add analytics tables (analytics_events, analytics_daily)
- Add /api/admin/leads endpoint for lead listing
- Add /api/admin/analytics/overview and /api/admin/analytics/charts endpoints
- Seed database with 15 leads and 30 days of analytics data
- Update dashboard.html with:
- Animated counters for stats
- Performance chart (views/leads over 6 months)
- Leads status pie chart
- Property types bar chart
- Traffic sources doughnut chart
- Top properties horizontal bar chart
- Recent properties table with images
- Recent leads list with status badges
- Add API methods: getAnalyticsOverview(), getAnalyticsCharts()
The previous route '/admin' with serveStatic was catching all /admin/* requests
before component files could be served. Added explicit routes for each admin
component file (sidebar.html, topbar.html, etc.) to ensure they are served
correctly before the /admin SPA route.
- Restored original admin.html with full design (3251 lines)
- Created modular components in public/admin/
- Extracted CSS to public/css/admin.css
- Extracted JS to public/js/admin-components.js
- All 8 admin sections modularized
- Clean URLs working: /login, /admin
Components ready for future use when server routing is configured.
Current admin.html works standalone with full design preserved.
## Problem
- admin.html was not serving correctly (returned index.html instead)
- Routes for SPA were catching admin.html requests
## Solution
Added explicit routes before wildcard route:
- GET /admin.html → serve admin.html
- GET /login.html → serve login.html
- GET /login → serve login.html
- GET /admin → redirect to admin.html
## Tested
✅ login.html returns correct page (title: Iniciar Sesión)
✅ admin.html returns correct page (title: Panel de Administración)
✅ Login API works correctly
✅ Session management works
✅ Redirect after login to /admin.html works
Closes#28
- Replace hardcoded similar properties with dynamic API loading
- Similar properties now use correct slugs for navigation
- Fix admin password hash for authentication (admin123)
- Remove duplicate HTML footer tags from previous fix
The HTML files had malformed footer with duplicate script tags:
- </html> followed by empty <script></script> and navigation.js
- navigation.js exports switchLanguage with location.reload()
- This overwrites the inline switchLanguage function
- On page load, switchLanguage() → location.reload() → infinite loop
Removed duplicate footer from all HTML files.
The HTML files use inline styles (preserved from original) because
CSS extraction lost ~60% of styles. Tests now verify inline <style>
blocks exist with CSS variables.
- Restored src/server/index.ts with all API routes (was accidentally truncated)
- Fixed property card template to use 'property' variable consistently
- Added slug to all hardcoded properties for navigation
- Fixed static file serving for SPA routes with redirects
- All tests passing (24/24)
- API working correctly (JSON responses)
- Static CSS/JS files served with correct MIME types
- Fixed undefined 'prop' variable error
- All references now use 'property' variable consistently
- Added slug to all hardcoded properties for navigation
- Fixed template literals for proper variable substitution
- Restored full inline styles (~3100 lines CSS) that were lost during CSS extraction
- Removed malformed outer HTML wrapper
- Cleaned up indentation and formatting
- All styles now embedded directly in HTML for proper rendering
- Button styles, navbar, hero section, all components restored
- Fixed MIME type errors for CSS/JS in property/admin pages by adding redirect routes
- Updated HTML files to use absolute paths (/css/, /js/) instead of relative (css/, js/)
- Added redirect handlers for SPA static files to main static folders
- Preserved SPA functionality while fixing styling issues
- Moved static file serving before CSRF middleware
- Changed CSRF to only apply to /api/* routes
- Fixed MIME type issues for CSS and JS files
- Added explicit routes for .css and .js files
- Fixed loadProperties function using wrong variables (prop instead of property)
- Added slug field to all hardcoded properties for proper routing
- Changed map marker click to navigate to property page instead of modal
- Fixed property card structure to include proper links and utility icons
- Fixed 46 values for 47 columns error in seed data INSERT statement
- Fixed 'router already built' error in rate limit tests by creating new Hono instance
## Security
- Sessions now stored in SQLite database instead of memory
- Sessions table persists across server restarts
- Auto-cleanup of expired sessions on startup
## Documentation
- Created docs/SITEMAP.md with site navigation map
- Documented user flows and data binding
- Listed all routes and their purposes
## Issue #9 Progress
- Seed data expanded from 3 to 12 properties
- Added English translations (title_en, description_en)
- All major Tenerife cities represented
- Various property types: urban, agricultural, houses, apartments
## Database
- Added title_en, description_en, short_description_en columns
- Deleted old database to reseed with new data
- Update technology stack with implemented backend
- Mark completed phases
- Add src/server/ and data/ to file structure
- Add validation.ts to structure
- Add validation schemas for all admin endpoints
- Add English (en.json) i18n translations
- Improve input validation using Zod
- Add better error handling for all CRUD operations
- Create SQLite database schema with all tables
- Implement REST API endpoints for properties, leads, testimonials, FAQ, services
- Add seed data with sample properties, testimonials, FAQ
- Create Docker configuration for deployment
- Add i18n system for translations
- Add API client for frontend integration
- Create Technical Documentation (TZ.md)
- Add detailed README with deployment instructions
🚀 Project is now fully functional:
- API: http://localhost:8080/api/*
- Properties CRUD with filtering
- Lead management
- Settings, Testimonials, FAQ, Services APIs
- SQLite database with seed data
- Set up project architecture with TypeScript types
- Create property, user, lead, and content type definitions
- Add i18n translations (ES, RU)
- Add sample JSON data for properties and leads
- Create comprehensive architecture documentation
- Set up package.json with Bun + Hono stack