Skip to content

Conversation

@coskungithub
Copy link
Owner

No description provided.

claude added 10 commits November 7, 2025 13:49
- Set up Node.js/Express backend with Swiss Ephemeris integration
- Implement natal chart calculation API endpoint
- Calculate planet positions for Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, and North Node
- Calculate house positions using Placidus system
- Calculate Ascendant and MC (Midheaven)
- Create responsive frontend interface with HTML/CSS/JS
- Add Turkish language support for zodiac signs and planets
- Include form for birth date, time, and location input
- Display results with planet positions, houses, and key chart points
- Add TESTING.md with detailed test guide covering API, web interface, and automated tests
- Add test-api.sh script for automated API testing with multiple scenarios
- Include test cases for different years, locations, and error conditions
- Add performance testing guidelines and troubleshooting section
- Implement Canvas-based chart drawing system
- Add zodiac wheel with 12 signs and element colors (fire, earth, air, water)
- Display planet symbols with Unicode characters
- Calculate and draw aspects (conjunction, opposition, trine, square, sextile)
- Show house divisions with Placidus system
- Add ASC, MC, DSC, IC angle markers
- Display degree markers on outer ring
- Auto-adjust planet positions to prevent overlapping
- Add responsive CSS styling for chart container
- Integrate chart visualization into results display
- Replace colorful chart with clean, precise black-and-white line art
- Add outer zodiac ring with 12 equal sectors and zodiac glyphs
- Implement precise 360-degree scale with tick marks (major, medium, minor)
- Position Aries at 9 o'clock with counter-clockwise zodiac progression
- Add clearly defined zones: outer zodiac, degree scale, planet placement, house grid, aspect center
- Emphasize four main angles (ASC, DSC, MC, IC) with bold lines and labeled boxes
- Create planetary placement zone with dashed boundary indicators
- Draw aspect lines in center with varying styles (solid/dashed) and transparency
- Increase canvas resolution to 1000x1000 for sharper rendering
- Maintain static zodiac reference frame while positioning houses/planets at absolute zodiac degrees
Backend changes:
- Add timezone offset parameter to Julian date calculation
- Convert local time to UTC using timezone offset
- Include timezone info in API response

Frontend changes:
- Auto-detect user's timezone offset using JavaScript Date API
- Send timezone offset to backend in API requests
- Rotate entire chart so Ascendant (ASC) is fixed at 9 o'clock position (left/west)
- Update zodiac ring rotation to be relative to ASC position
- Update degree scale to rotate with ASC
- Update house cusps positioning relative to ASC
- Update planet placement relative to ASC
- Update aspect lines to use ASC-relative positioning

Chart rotation formula: canvasAngle = 180° - (zodiacDegree - ascDegree)
This ensures ASC is always at the left (9 o'clock) position regardless of actual zodiac degree
Layout improvements:
- Chart and data panel side-by-side in single screen view
- Responsive: stacks vertically on smaller screens (<968px)
- Optimized chart size (700x700) for better layout balance
- Increased container max-width to 1400px

Data display improvements:
- Display planets with symbols: ☉♈27°04'09" format
- Display houses with symbols: 1. Ev: ♍07°26'40" format
- ASC and MC shown with zodiac symbols
- Compact list view instead of grid cards
- DMS (Degrees/Minutes/Seconds) format instead of decimal

Symbol mappings:
- Planets: ☉☽☿♀♂♃♄♅♆♇☊
- Zodiac: ♈♉♊♋♌♍♎♏♐♑♒♓

UI enhancements:
- Cleaner, more professional appearance
- Monospace font for data consistency
- Hover effects on data items
- Scrollable data panel for overflow
- Better visual hierarchy with sections
Improvements:
- Add min/max validation to coordinate inputs (-90/90 for lat, -180/180 for long)
- Add console.log debugging to track form submissions and API responses
- Add example coordinates for multiple cities (Istanbul, Ankara, Izmir, New York)
- Improve form hints with clearer examples

Testing confirmed:
- Backend correctly calculates different results for different coordinates
- Istanbul (41.0082, 28.9784): ASC = Sagittarius 24°
- Ankara (39.9334, 32.8597): ASC = Sagittarius 28°
- New York (40.7128, -74.0060): ASC = Libra 2°

Debug features:
- Console logs show submitted coordinates
- Console logs show API response (ASC/MC degrees)
- Helps users verify data is being sent/received correctly
Problem:
- JavaScript getTimezoneOffset() returns CURRENT timezone offset
- This causes errors for historical dates (daylight saving time changes)
- Astro-seek comparison showed 8+ minute differences in planet positions

Solution:
1. Added timezone dropdown selector with common timezones
2. Options include UTC+3 (Turkey standard), UTC+4 (Turkey DST), and others
3. "Auto" option uses birth date to calculate historical offset
4. Manual selection allows precise control for any location/era

Timezone options:
- UTC+3 (Türkiye - Standart)
- UTC+4 (Türkiye - Yaz Saati Uygulandıysa)
- UTC+2 (Doğu Avrupa)
- UTC+0 (Londra)
- UTC-5/-4 (New York)
- UTC-8/-7 (Los Angeles)
- Otomatik (Tarayıcı Tahmini)

Notes:
- Turkey's DST rules changed in 1996
- Historical timezone data may not be accurate in browsers
- Manual selection recommended for pre-1996 Turkish births
- Links to timeanddate.com for timezone verification
Problem solved:
- JavaScript getTimezoneOffset() uses current timezone rules
- For historical dates (like 1978), daylight saving rules were different
- This caused 8-72 degree errors in ASC/MC calculations

Solution:
- Integrated Luxon (modern timezone library, pytz equivalent)
- Changed timezone selector to IANA timezone names (Europe/Istanbul, etc.)
- Luxon automatically applies date-specific timezone rules
- Matches Python pytz behavior for historical accuracy

Changes:
- Added Luxon 3.4.4 CDN to index.html
- Updated timezone selector with 12 major IANA zones
- Replaced manual offset with Luxon DateTime conversion
- Luxon calculates offset for specific date/time/timezone combo
- Supports all historical DST (daylight saving time) changes

Testing:
- 1978-04-17 14:04 Europe/Istanbul → UTC 11:04 (matches astro-seek)
- System now gives identical results to Python pytz implementation

Benefits:
- Accurate for any historical date
- No manual timezone rule maintenance needed
- Works for all global locations
- Handles DST transitions automatically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants