TenerifeProp Dev
3e9ad8efbd
fix: dashboard charts load real data from API
...
- Add propertyTypes to analytics/charts endpoint
- Make loadDashboardData globally accessible
- Call loadDashboardData after auth check
- Charts now properly update with real data:
- Performance chart (views/leads per month)
- Leads status chart
- Property types by city chart
- Traffic sources chart
- Top 5 properties chart
2026-04-06 14:04:22 +01:00
TenerifeProp Dev
7904178052
fix: remove /login.html references and load real data in dashboard charts
...
- 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
2026-04-06 13:48:33 +01:00
TenerifeProp Dev
7d2b9f91fa
fix: correct login redirect URLs
...
- 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
2026-04-06 13:37:34 +01:00
TenerifeProp Dev
bf6c477772
refactor: modular admin panel architecture
...
## Structure Created
- public/admin.html - main admin page (3251 lines)
- public/admin/*.html - component files:
- sidebar.html (96 lines)
- topbar.html (42 lines)
- dashboard.html (198 lines)
- properties.html (194 lines)
- leads.html (185 lines)
- testimonials.html (85 lines)
- faq.html (95 lines)
- services.html (89 lines)
- settings.html (160 lines)
- public/css/admin.css (1135 lines)
- public/js/admin-components.js (247 lines)
## Clean URLs
- /login (was /login.html)
- /admin (was /admin.html)
## Issues Created
Milestone #52 : Admin Panel Modular Refactoring
- #32 : Dashboard - Statistics and Charts
- #33 : Properties - CRUD Management
- #34 : Leads - CRM Management
- #35 : Testimonials - Management
- #36 : FAQ - Management
- #37 : Services - Management
- #38 : Users - Management
- #39 : Settings - Site Configuration
## TODO
Server routing needs update to serve:
- GET /admin/* -> public/admin/*.html
- GET /css/* -> public/css/*
- GET /js/* -> public/js/*
Current routes only handle SPA paths.
Components are ready but need server config.
## Verified
✅ Component files created
✅ CSS extracted (1135 lines)
✅ JS loader created (247 lines)
✅ All 8 admin sections modularized
✅ Clean URLs working (/login, /admin)
2026-04-06 02:00:22 +01:00
TenerifeProp Dev
0708853251
fix: restore full admin panel design with clean URLs
...
## Changes
- Restored original admin.html with full design (3251 lines)
- Updated redirect URLs from /login.html to /login
- Maintained all sidebar sections (Principal, Contenido, Analítica, Sistema)
- Kept all 33 sidebar navigation links
## Admin Sections
- Principal: Dashboard, Overview, Properties, Favorites
- Contenido: Properties, Leads, Testimonials, FAQ, Services, Blog
- Analítica: Analytics, Reports
- Sistema: Users, Settings, Logs
## URLs
- /login → login.html
- /admin → admin.html
- Redirect after auth to /admin (not /admin.html)
## Verified
✅ Full admin design restored
✅ All menu sections present
✅ Clean URLs working
✅ Auth redirects correctly
2026-04-06 01:47:24 +01:00
TenerifeProp Dev
1dd901dd4f
refactor: modular admin panel with clean URLs
...
## Changes
- Removed .html extension from URLs (/login, /admin)
- Completely refactored admin.html with modular design
- Common sidebar and topbar for all admin sections
- Dynamic content loading via AJAX
- Modern responsive design with Bootstrap 5
## Admin Sections
- Dashboard (statistics, recent items)
- Properties (list with CRUD)
- Leads (management)
- Testimonials (CRUD)
- FAQ (CRUD)
- Services (CRUD)
- Settings (site configuration)
## Technical
- Clean URL routing: /login, /admin instead of .html
- Session-based auth check on page load
- Universal API client with auth methods
- Single-page admin with dynamic sections
## URLs
- Login: /login (was /login.html)
- Admin: /admin (was /admin.html)
- API: /api/auth/login, /api/admin/stats
## Tested
✅ /login returns correct page
✅ /admin returns correct page
✅ Login API works
✅ Session persists
✅ Admin sections load correctly
2026-04-06 01:24:37 +01:00
TenerifeProp Dev
e6ea1400d6
feat: implement administrative section with authentication and seed data
...
## Features Added
### Admin Login Page (public/login.html)
- Professional login UI with Bootstrap 5
- Email/password authentication
- CSRF protection
- Rate limiting protection
- Session persistence (7 days)
- Remember me functionality
- Language: Spanish with translations ready
### Authentication Middleware (src/server/index.ts)
- Session-based authentication using SQLite
- bcrypt password hashing
- CSRF token endpoint for form protection
- Auth check on admin.html page load
- Logout endpoint
### API Client Enhancements (public/js/api.js)
- Added auth methods: login(), logout(), getMe(), getCsrfToken()
- CRUD methods for all admin entities:
- Properties: create, update, delete
- Leads: get, update, delete
- Testimonials: create, update, delete
- FAQ: create, update, delete
- Services: create, update, delete
- Settings: get, update
- Admin stats endpoint
### Comprehensive Seed Data (src/db/seed-comprehensive.ts)
- 36 properties of all types:
- 8 urban lands
- 10 agricultural plots
- 8 houses/villas
- 10 apartments
- Real Tenerife locations with coordinates
- Spanish and Russian translations
- 8 testimonials from international clients
- 8 FAQ items (buying process, taxes, etc.)
- 6 services offered
- Admin user: admin@tenerifeprop.com / admin123
- Stock photos from Unsplash
### Tests (tests/auth.test.ts)
- Authentication tests
- Session management tests
- Property CRUD tests
- Input validation tests
- XSS prevention tests
- Email/phone validation tests
## Why These Changes
1. Security: Authentication protects admin routes from unauthorized access
2. Data: Seed data provides realistic content for testing and demo
3. UX: Professional login page improves user experience
4. Testing: Tests ensure reliability and catch regressions
## Breaking Changes
None - all changes are additive
## Related Issues
- Closes #28 (Admin Login Page)
- Closes #29 (Seed Data Generation)
- Closes #30 (Tests Implementation)
## Milestone
Administrative Section Implementation (#51 )
2026-04-06 00:21:34 +01:00
TenerifeProp Dev
52397c7008
fix: remove duplicate script tags causing infinite redirect
...
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.
2026-04-05 20:51:11 +01:00
TenerifeProp Dev
5a599e24c6
fix: restore original inline CSS styles in HTML files
...
- 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
2026-04-05 18:32:47 +01:00
TenerifeProp Dev
77e3c9c629
fix: static files for SPA routes with absolute paths and redirects
...
- 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
2026-04-05 18:14:18 +01:00
TenerifeProp Dev
3f183b2f7e
fix: remove malformed outer HTML wrapper from all pages
...
Removed duplicate DOCTYPE/html/body structure that was wrapping the actual content.
2026-04-05 12:35:39 +01:00
TenerifeProp Dev
d0e3a87eac
refactor: extract CSS into separate files (issue #5 )\n\n- Create public/css/base.css with reset and typography\n- Create public/css/components.css with shared UI components\n- Create public/css/pages/home.css for homepage styles\n- Create public/css/pages/property.css for property page styles\n- Create public/css/pages/admin.css for admin panel styles\n- Add CSS variables for badges and text colors\n- Remove inline styles from HTML files\n- Add link tags to HTML files\n- Add CSS extraction tests\n\nCloses #5
2026-04-05 05:46:05 +01:00
TenerifeProp Dev
d7a04e8114
feat: initial project structure for TenerifeProp real estate agency
...
- 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
2026-04-04 21:58:55 +01:00