Commit Graph

87 Commits

Author SHA1 Message Date
7bdf40e176 feat: update city weather descriptions in locales
- Modify weather description format in multiple language locale files
- Use full city name in place of just city name in descriptions
- Ensure consistency across all language files for better user experience

These changes standardize the way city weather is presented across
various languages by including more detailed descriptions, thus enhancing
clarity and providing additional context for users.
2025-04-12 15:13:21 +08:00
b0b64c2fe3 feat: add AI-generated city descriptions
- Implement method to get multilingual city descriptions
- Create worker for generating descriptions in the background
- Update database schema to include description translations
- Update AiService to fetch descriptions from City model

This commit introduces a feature to generate city descriptions
in multiple languages using AI. It includes methods for
caching descriptions and a background job to handle
generation to improve performance and user experience.
2025-04-12 14:03:48 +08:00
ab50ed3036 feat: add support for multiple image generation models
- Introduced constant MODELS for managing model names.
- Updated the `generate_image` method to switch between FLUX and DALL-E 3.
- Added `generate_image_dalle` and `generate_image_flux` methods for respective API calls.
- Enhanced prompts for image generation across both models, ensuring correct message construction.

This update enables users to generate images using different AI models dynamically, allowing for flexible integration and improved user experience. The handling of errors now falls back to the DALL-E model if the FLUX API fails.
2025-04-10 12:00:57 +08:00
719a523cc9 refactor: comment out startup task scheduling code
- Commented out the block that schedules the RefreshSitemapWorker
- This change was made to temporarily disable the startup task
- Maintains existing code structure without loss of functionality
2025-04-09 16:14:22 +08:00
d8f1fd278c feat: add multilingual metadata for TodayAIWeather
- Introduced site name and descriptions in Arabic, Bengali, German, Spanish,
  French, Hindi, Croatian, Italian, Japanese, Korean, Polish, Portuguese,
  Russian, Turkish, Ukrainian, Urdu, and Chinese.
- Added keywords for better SEO and user discoverability.

This update improves the website experience for non-English speaking
users and reflects our commitment to accessibility and inclusivity.
All language files now contain appropriate semantic content for
social media previews and search engines.
2025-04-08 17:15:57 +08:00
dcf762726c feat: add meta tags for SEO optimization
- Implement meta tags in ArtsController, CitiesController, HomeController, and WeatherArtsController for better SEO.
- Use translation helpers for titles, descriptions, and keywords to improve internationalization support.
- Update default meta tags in ApplicationHelper for consistent site-wide SEO.

These changes enhance the search engine visibility of the application by providing relevant meta information across various pages. Utilizing translation for these fields promotes better support for multiple languages, aligning with localization efforts.
2025-04-08 17:04:32 +08:00
808061c4f3 chore: update sidekiq scheduler description
- Change description for the submit_indexnow job from
  "Refresh sitemap daily" to "Submit Indexnow daily".
- Description modification improves clarity on job function.
- This adjustment does not affect job scheduling or operations.
2025-04-08 15:15:33 +08:00
a53e6bdf54 refactor: remove key verification controller and update routes
- Deleted KeyVerificationController to simplify the application
- Adjusted order of endpoints in SubmitToIndexnowWorker
- Removed key verification route that was previously handled by the controller
- Added new static text file for key verification instead

This change streamlines the key verification process by removing unnecessary code and implementing a simpler method using a text file.
2025-04-08 14:42:56 +08:00
f6cf64e5b8 feat: add scheduled task for IndexNow submissions
- Make the `perform` method accept an optional parameter for recent updates
- Log the number of URLs submitted to IndexNow
- Introduce a new scheduled job for submitting URLs to IndexNow daily

This commit enhances the functionality of the `SubmitToIndexnowWorker` by allowing
it to be triggered via a scheduled job. It also adds logging for better monitoring
of submissions, improving traceability and performance in sitemap management.
2025-04-08 14:21:54 +08:00
5852d8724e feat: add key verification and IndexNow submission worker
- Implement KeyVerificationController to handle ID-based key verification.
- Create SubmitToIndexnowWorker for background processing of URL submissions.
- Add routes for key verification and extend functionality of URL submissions to IndexNow.

This commit enhances the application by allowing for verification of API keys and automatic submission of URLs to multiple endpoints, improving SEO and resource accessibility.
2025-04-08 14:04:16 +08:00
3bfc64b0c8 feat: add translations for wiki data in locales
- Add translation for 'wiki_data' in Arabic
- Add translation for 'wiki_data' in Bengali
- Add translation for 'wiki_data' in German
- Add translation for 'wiki_data' in English
- Add translation for 'wiki_data' in Spanish
- Add translation for 'wiki_data' in Persian
- Add translation for 'wiki_data' in French
- Add translation for 'wiki_data' in Hindi
- Add translation for 'wiki_data' in Croatian
- Add translation for 'wiki_data' in Italian
- Add translation for 'wiki_data' in Japanese
- Add translation for 'wiki_data' in Korean
- Add translation for 'wiki_data' in Polish
- Add translation for 'wiki_data' in Portuguese
- Add translation for 'wiki_data' in Russian
- Add translation for 'wiki_data' in Turkish
- Add translation for 'wiki_data' in Ukrainian
- Add translation for 'wiki_data' in Urdu
- Add translation for 'wiki_data' in Chinese (Simplified)

This update provides localized support for the term 'wiki_data' across multiple languages, improving user experience and accessibility in international environments.
2025-04-02 14:43:03 +08:00
6b3d290c4e feat: add download card for weather arts
- Create a download card component for weather arts
- Include options for premium purchase, medium quality, and a free WebP version
- Ensure proper layout and styling for the download options

This addition enhances the user experience by providing a clear
and organized way to download various versions of the weather
art. It also includes functionality for both paid and free
options, addressing different user needs.
2025-03-24 17:31:05 +08:00
2e635972b2 fix: update s3 endpoint for compatibility
- Switch to the new s3 endpoint for improved access
- Comment out the previous internal endpoint for clarity

This change updates the s3 endpoint to ensure proper
connection and compatibility with the service. The
internal endpoint is commented out to avoid confusion.
2025-03-22 08:59:05 +08:00
a5bd4c7da9 chore: update S3 bucket name for development
- Change bucket name from today-ai-weather-hk-dev to
  today-ai-weather-dev-hk
- Update the configuration for easier understanding and
  consistency

This update modifies the S3 bucket name used in development
settings, improving clarity and aligning with naming
conventions.
2025-03-21 23:50:56 +08:00
06f4a10398 chore: update s3 configuration for new region
- Change the AWS S3 region from Hong Kong to Shanghai for
  both production and development environments.
- Update bucket names to reflect the new region.
- Modify the endpoint URLs to align with the new settings.

These changes ensure that the application interacts with the
correct resources in AWS and maintains compatibility with
services hosted in Hong Kong.
2025-03-21 23:16:37 +08:00
3c8389f977 chore: update database connection URLs
- Comment out the previous development database URL
- Implement a new PostgreSQL URL for production use

This change updates the database connection settings to ensure
that the application connects to the appropriate database in
different environments. Commenting out the old URL helps
prevent accidental usage while retaining it for reference.
2025-03-16 00:15:09 +08:00
f2e2c8c4d8 refactor: update AWS S3 credentials configuration
- Modify AWS credentials to use 's3' instead of 'minio' for both production and development environments.
- Update associated initializers, environment configurations, and sitemap generator settings.
- Simplify the configuration retrieval by aligning with new standards for S3.

These changes ensure consistent access to AWS S3 resources and improve maintainability by aligning with updated environment variable practices.
2025-03-16 00:13:37 +08:00
0a75ea9bd5 fix: ensure weather art images are processed
- Moved image processing to after the weather_art assignment.
- This change guarantees that the webp and preview images are processed before returning the weather_art object.
- Resolves potential issues where image processing wouldn't occur if the returned value wasn't properly assigned initially.
2025-03-15 20:39:46 +08:00
d39a7deea2 feat: update RSS feed routes and logging
- Change route for RSS feed to use defaults for format
- Add logging to RssController#feed to track request format

These changes improve the clarity of the routing for the RSS feed
and enhance debugging capabilities by logging the request format.
The new route definition ensures that the feed responds correctly
with the default format, while the logging provides insight into
how the feed is being accessed.
2025-03-05 15:18:15 +08:00
acbde3b034 feat: add hashtag support to social share button
- Include data-hashtag attribute in the Facebook share button
- Comment out an alternative database URL in credentials

This update enhances the social sharing feature by allowing
users to include hashtags when sharing content on Facebook.
The commented-out database URL serves as a reference for
future configurations.
2025-03-04 14:46:13 +08:00
f51dc8370b feat: add state filtering to cities index
- Implement state filtering in the CitiesController
- Add new scope `by_state` in the City model
- Update cities index view to include state dropdown
- Add slug column to states for friendly URLs
- Update English locale to include 'All States'

This commit enhances the cities index page by allowing users to
filter cities based on the selected state. It introduces a new
scope in the City model for state filtering and updates the
view to present a dropdown for state selection. Additionally,
it adds a slug column to the states table to support friendly
URLs, improving the overall user experience.
2025-02-26 09:48:39 +08:00
3ae870047a feat: add sitemap management feature
- Implement index action to list sitemaps
- Create view for displaying sitemaps with details
- Add helper method for generating sitemap URLs
- Enhance error handling for S3 service errors

This commit introduces a new feature for managing sitemaps in the application. It includes an index view that lists all available sitemaps with their last modified date and size, along with a link to view each sitemap. The error handling for S3 interactions has also been improved to log errors and return appropriate responses.
2025-02-24 17:28:21 +08:00
2a360a6875 style: fix formatting in Arabic locale file
- Ensure consistent formatting in the long date string
- No functional changes were made, only a formatting adjustment

This commit addresses a minor formatting issue in the Arabic locale file, ensuring that the long date format is consistent with the expected output. No changes to functionality or behavior were introduced.
2025-02-24 17:09:21 +08:00
bd04bb63a1 feat: add support for multiple languages
- Update available locales to include Bengali, Hindi, Urdu, and Arabic
- Add new locale files for each language with translations for UI elements
- Ensure the application can now support a wider audience by providing
  localized content

This change enhances the application's accessibility and usability for
users who speak these languages, allowing for a more inclusive user
experience. The new translations cover key UI components and messages,
ensuring that users can interact with the application in their native
languages.
2025-02-24 17:04:23 +08:00
9ef2a92d60 feat: add multiple language support for locales
- Extend available locales in the application to include:
  - Portuguese (Brazil)
  - Croatian
  - Persian
  - German
  - Spanish
  - French
  - Italian
  - Turkish
  - Russian
  - Ukrainian
  - Polish

- Create new locale files for each language with appropriate translations.
- Update existing locale files to include new languages.

This update enhances the application's accessibility by supporting a wider range of languages, allowing users from different regions to interact with the application in their native language.
2025-02-24 15:46:29 +08:00
03c957e654 feat: add date formats to localization
- Introduce default, short, and long date formats
- Enhance date representation for better user experience

This update allows the application to display dates in multiple formats,
including a default format of 'YYYY-MM-DD', a short format of
'"MMM DD"', and a long format of '"Month DD, YYYY"'. This
improves localization support and user interface flexibility.
2025-02-24 14:20:49 +08:00
09fa1ceea9 feat: update sitemap generation for multiple locales
- Refactor generate_sitemap method to support locale
- Add setup_sitemap_config method for configuration
- Implement sitemap generation for default and localized paths

This update enhances the sitemap generation process by supporting
multiple languages. Users can now access a sitemap with language
prefixes, improving SEO and usability for different locales.
Additionally, error handling has been improved to log specific
errors related to locale generation.
2025-02-22 12:08:59 +08:00
bd42833953 feat: add translatable name module for countries and regions
- Introduced `TranslatableName` module to allow for
  localized names for `Country` and `Region` models.
- Updated views to display `localized_name` instead of
  `name` for improved internationalization.
- Refactored JSON serialization for `translations` attribute.
- Enhanced localization support by adding new languages:
  Japanese and Korean, with updated locale files.
- Removed outdated English and Chinese locales for countries
  and regions to clean up the codebase.
2025-02-21 23:46:25 +08:00
f6b9dcf187 feat: add internationalization support
- Implement locale extraction and fallback mechanism
- Add translation files for English and Chinese
- Update views to use translated strings for various UI elements

This commit introduces support for multiple languages in the application, enhancing accessibility for users. It includes a fallback mechanism for locales and updates to the user interface to display translated content.
2025-02-21 17:51:25 +08:00
9fe92b1fc4 feat: add RSS feed functionality
Some checks failed
Docker / docker (push) Has been cancelled
- Introduce RssController to handle RSS feed requests
- Add a new route for the RSS feed
- Implement RSS feed view to display weather art
- Update application layout to include RSS feed link
- Set content type for RSS responses

This commit adds an RSS feed feature that allows users to
subscribe to updates on daily AI-generated weather art.
The feed includes the latest weather art and relevant
metadata, enhancing user engagement and accessibility.
2025-02-19 17:38:49 +08:00
789e9f8d23 feat: migrate AWS configuration to MinIO
- Update SitemapsController to use MinIO credentials
- Modify RefreshSitemapWorker to adapt to MinIO settings
- Change AWS configuration in initializers and storage files
- Add MinIO credentials to credentials.yml.enc

This commit transitions the application from using AWS S3 to MinIO for
storage. It updates all relevant configurations and ensures that the
application can now interact with MinIO seamlessly, including
support for both production and development environments.
2025-02-19 11:31:57 +08:00
9a35dc5563 feat: Update sitemap host configuration
Some checks are pending
Docker / docker (push) Waiting to run
CI / scan_ruby (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
The commit updates the sitemap host to point to the production environment.
This is needed so that the sitemap links will point to the correct domain, and the
production environment needs to point to a specific host. The sitemap now uses
the correct host url, and this is the correct config for the current state.
2025-02-17 00:35:46 +08:00
31a2ec373d refactor: Update sitemap configuration to support a new host name
- Modified the host name in the sitemap configuration to support the new domain.
- This commit changes the hostname, and updates the sitemap to reflect the correct host.
- This is done to reflect the correct host on the production server.
- Added the new `public/sitemaps` directory to .gitignore to avoid commits related to this
 directory, and updates the .gitignore.
2025-02-17 00:27:44 +08:00
2042732787 feat: improve worker logging
- Added current time logging to the worker to help debug and
  analyze processing times
- Cleaned up assets initializer file
2025-02-15 12:30:48 +08:00
936db76437 refactor: Improve weather art generation process
- Add formatted_current_time method to City model.
- Modify BatchGenerateWeatherArtsWorker to check local time.
- Update Sidekiq scheduler to run every hour.

This commit improves the weather art generation by considering
local time for image generation and increasing the frequency
of batch processing for testing purposes. The new method
provides formatted time information for each city. This change
ensures that images are generated during daylight hours.
2025-02-15 12:20:24 +08:00
daa0ceac3e refactor: replace OpenLayers with Mapbox GL
- Replace OpenLayers with Mapbox GL for map rendering.
- Update CSS for map styling and control visibility.
- Integrate weather art into map popups.
- Add Mapbox token to credentials.yml.enc

This commit replaces the existing OpenLayers map implementation
with Mapbox GL. It also adjusts the styling and adds a
weather art display to the map popup, which enhances the
user experience. The necessary changes include modifying
stylesheets, JavaScript controllers, view templates, and
updating the credentials file. The motivation is to enhance
map rendering performance and user experience.
2025-02-15 11:21:12 +08:00
df456d1031 feat: add map feature to city show page
- Implement MapController for displaying city maps
- Add map rendering in the city show view
- Include weather arts in the city show controller
- Update asset pipeline to include Leaflet CSS and JS

This commit introduces a map feature that allows users to view
geographical information related to cities. The map is integrated
with weather arts data, enhancing the overall functionality of
the city show page.
2025-02-14 18:05:03 +08:00
ec8f89e07a feat: add rack-mini-profiler for performance monitoring
- Include 'rack-mini-profiler' gem in Gemfile
- Update Gemfile.lock with the new dependency
- Create initializer for rack-mini-profiler in development

This addition allows for performance monitoring within the
application during development, which can help identify
and address performance issues more effectively.
2025-02-14 10:47:16 +08:00
18977a9d42 feat: improve retrieval of weather arts
- Include associated city and image attachment in popular,
  random, latest, and featured arts queries to enhance data
  accessibility and performance.
- This modification reduces N+1 query issues by eager-loading
  associations, leading to improved query performance when
  accessing related data.
2025-02-14 09:55:04 +08:00
be88aebac2 fix: update AI service logging and weather services 2025-02-13 17:21:41 +08:00
80d623b0c2 style: update description in sidekiq scheduler
- Changed description for the 'batch_generate_weather' job from
  'Generate weather arts every 2 hours' to 'Batch Generate weather
  arts'.
- This change provides a more concise description of the job's
  purpose without altering its functionality.
2025-02-13 16:19:33 +08:00
b2551361d7 feat: add admin management features for cities
- Update menu labels for cities, countries, and regions
- Introduce new entities for states and subregions in Admin Panel
- Implement admin authentication for weather art generation
- Modify application controller to check for admin user
- Refactor view to display admin panel based on user permissions
- Update routes to include weather art generation action

These changes enhance the admin interface for better management of cities
and related entities. The new admin checks ensure that only authorized users
can generate weather art, improving security and functionality.
2025-02-11 17:40:13 +08:00
3237321db3 fix: improve database URL configuration
- Update development database URL to use a fallback
  if no URL is provided in credentials.
- Modify production SMTP password retrieval to use
  dig method for more robust access.

These changes allow for smoother local development and
ensure that the production environment correctly
accesses the SMTP password, enhancing overall stability.
2025-02-11 17:01:13 +08:00
973a0882ed feat: add admin panel and update database URL
- Implemented a new admin panel that allows administrators to view
  statistics and manage weather art. The panel includes:
  - A card displaying total images and today's images
  - Buttons to generate new art and edit the city

- Added `admin?` helper method to check if the current user is an
  administrator.

- Updated database configuration to use safer credentials lookup
  method `dig` for development database URL instead of the
  previous method, improving reliability in accessing nested
  credentials.
2025-02-11 16:56:51 +08:00
2511eadd2f style: format unlock_keys for consistency
- Adjusted the spacing in the 'unlock_keys' configuration
- Ensured uniform spacing around array elements

This change does not affect the functionality of the unlock
keys in Devise but improves the consistency of the code
formatting to enhance readability.
2025-02-11 16:43:24 +08:00
be1f76a76d feat: enhance devise views with new styling
- Updated confirmation, password, unlock, and session views to use a
  card-based layout for improved visual appeal.
- Added responsive design features to ensure compatibility across devices.
- Enhanced usability by providing clear placeholders in form fields.

These changes improve the user experience during account recovery and
management processes. The design promotes a modern interface while
maintaining functionality.
2025-02-11 16:43:05 +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
652107d0ee migrate with countries_states_cities_db 2025-02-08 17:42:50 +08:00
884e1dfc9f feat: add navigation between weather arts
- Implement previous and next weather art navigation
- Update weather arts controller to fetch adjacent weather arts
- Modify show view to include navigation links

This update enhances the user experience by allowing users to
navigate through weather arts seamlessly. The previous and
next buttons improve accessibility, providing a smoother
browsing experience. The implementation also accounts for
situations where no adjacent weather arts exist, ensuring
clarity for users.
2025-02-03 11:09:31 +08:00