Commit Graph

15 Commits

Author SHA1 Message Date
5e716a46d9 fix: parse timezones as JSON
- Updated timezone parsing to handle JSON format.
- Modified how timezones are fetched in multiple models.
- Added a migration to convert existing timezones data.
- Modified the country model to format timezones.

This commit fixes an issue where the timezone data was not
being correctly parsed, leading to potential errors in time
calculations.  The changes ensure the application correctly
handles and displays timezone information, improving the
accuracy of time-related features.
2025-02-15 17:21:02 +08:00
ca3691004f feat: Convert country timezones to JSONB format
- Changed `timezones` attribute from text to JSONB in `Country`.
- Updated related model methods to handle JSONB data.
- Added a migration to convert existing timezone data.
- Used safe navigation operators to prevent errors.

This change improves the storage and management of timezone
information by using the JSONB data type.  It includes data
migration to handle existing timezone data.
2025-02-15 16:51:36 +08:00
7d25bc8f11 feat: enhance user authentication features
- Add confirmable and lockable modules to user model
- Update error messages display with improved UI
- Modify navbar links for better accessibility and styling
- Add unique indexes for confirmation and unlock tokens in migration

These changes improve user management and user experience by
adding features for account activation and security, along
with styling enhancements for the authentication views.
2025-02-11 16:18:10 +08:00
1545b33539 feat: add user authentication with devise
- Integrate Devise for user authentication
- Create User model and necessary views
- Implement email confirmation and password reset functionality
- Add routing for user sign-up and login
- Customize error messages display

This commit initiates user authentication in the application
using the Devise gem. It includes user registration, login,
password reset, and email confirmation features. Additionally,
the necessary views and mailer templates are included to
support these functionalities. This enhances the security
and usability of the application by allowing users to create
accounts and manage their passwords effectively.
2025-02-11 14:45:23 +08:00
92ec81b152 feat: add devise for user authentication
- Include 'devise' gem for user management
- Update database access URLs in configurations
- Refactor schema types from bigint to integer for resource and author IDs
- Enhance geo synchronization by updating region and subregion handling

These changes are aimed at improving the user management functionality while ensuring efficient data handling and connections for production environment.
2025-02-11 11:46:15 +08:00
3f1e8892f9 chore: update AWS SDK dependencies and improve schema
- Downgraded `aws-sdk-s3` to version 1.170 and updated
  `aws-sdk-core` to 3.211 to maintain compatibility with
  existing code.
- Updated various column types in the database schema
  from `integer` to `bigint` to handle larger values and
  improve data integrity.
- Modified the `sync_geo_data.rake` task to use
  `find_or_create_by` for `Country`, improving the logic
  for ensuring unique countries based on ISO code.

These changes enhance dependency management and improve
schema robustness while maintaining functionality.
2025-02-10 14:43:34 +08:00
edbfb32d65 feat: update database schema
Some checks are pending
Docker / docker (push) Waiting to run
- Add emoji_u column to countries table
- Add flag column to cities table
- Change default value of active column in cities table

This feature adds several new columns to the database schema, including an emoji_u column to the countries table and a flag column to the cities table. It also changes the default value of the active column in the cities table to false.
2025-02-09 21:55:47 +08:00
652107d0ee migrate with countries_states_cities_db 2025-02-08 17:42:50 +08:00
dd6cd0451d feat: add ahoy analytics for event tracking
- Integrate Ahoy gem for tracking user events and visits
- Create models for Ahoy events and visits
- Implement admin interfaces for managing events and visits
- Add background job for cleaning up old analytics data
- Update application controller and other relevant controllers to track specific actions

This commit implements a comprehensive event tracking system that logs user interactions
within the application. Additionally, it includes mechanisms for managing and
cleaning historical visit and event data, ensuring efficient data handling.
2025-01-27 00:43:18 +08:00
06a861c639 refactor: clean up city model and adjust worker timing
- Implement caching methods for last weather fetch and image generation
- Adjust sleep duration in BatchGenerateWeatherArtsWorker from 10 seconds to 3 seconds
- Remove unused fields `last_weather_fetch` and `last_image_generation` from the cities table
- Add index on the weather_arts table for optimized querying

This refactor improves data retrieval performance for weather data
associated with cities. Caching reduces database load while the
worker modification allows for faster iterations in generating
weather arts without significantly impacting performance.
2025-01-23 23:59:48 +08:00
9cb1467301 feat: enhance weather arts and cities features
- Add slug column to weather_arts for friendly URLs.
- Update weather arts retrieval in the controller to use slug.
- Implement region and country filtering in cities index view.
- Optimize city queries with scopes for active status and region/country.
- Improve UI layout and design for the cities index page.

These changes allow better user experience by enabling cleaner URLs for weather arts and facilitating efficient filtering of cities based on selected regions and countries.
2025-01-22 14:04:58 +08:00
c11d10c86a feat: update city display and database schema
- Change city name display to localized name in both index and show views
- Modify schema to use bigint for certain foreign keys
- Correct country codes in seeds for accurate data representation

These changes improve the handling of city names, ensuring they are displayed in the appropriate localized format and ensuring well-typed foreign key relationships in the schema.
2025-01-21 21:29:26 +08:00
ebaf7a3f34 feat: add countries and regions management
- Implement Country and Region models
- Establish relationships between City, Country, and Region
- Update ActiveAdmin setup for managing countries and regions
- Add localization support for cities and countries in multiple languages
- Create necessary migrations to support the new schema

This update allows for better categorization of cities under their respective countries and regions, enhancing geographical structure and support for multilingual features.
2025-01-21 18:27:26 +08:00
e5743a5e3f feat: add friendly_id for cities and weather arts
- Integrate 'friendly_id' gem for sluggable functionality in City model
- Create ActiveAdmin resources for managing cities and weather arts
- Implement controller logic for cities
- Add database migrations for cities and weather arts creation
- Seed database with sample data for testing
- Create initial test cases for controllers and models

This commit enhances the application's URL handling by allowing friendly URLs for cities and weather arts. The addition of ActiveAdmin resources facilitates easier management through a web interface.
2025-01-19 12:21:00 +08:00
8517905b68 init with rails8 + active-admin 2025-01-19 01:13:59 +08:00