- Introduced constants for configuration settings such as generation interval, maximum duration, and sleep duration.
- Updated the `perform` method to utilize these constants for better readability and maintainability.
- Refactored the `perform` method in `GenerateWeatherArtWorker` to improve flow and error handling by creating separate methods for fetching weather data, generating prompts, images, and handling database transactions.
- Cleaned up city seeding data by removing unnecessary fields while maintaining required functionality.
These changes improve the overall readability of the code and make it easier to adjust the behavior of the workers in the future without digging through the logic.
- 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.
- Added 'public' directory to the chown command to ensure the
proper ownership for runtime files.
- This change enhances the security by ensuring that all
necessary directories are owned by the designated non-root
user.
The previous behavior did not account for the 'public'
directory, which could lead to permission issues at runtime.
- Include gtag.js for Google Analytics
- Setup dataLayer for tracking events
- Configure Google Analytics with unique ID
This commit integrates Google Analytics into the web
application to enable tracking of user interactions and
site usage. It sets up the necessary scripts and initializes
the tracking code with the provided unique ID, improving
analytics capabilities.
- update default host in sitemap generator
- refresh sitemap on worker with new host
These changes allow the sitemap to be correctly generated for different environments and to handle the new host correctly, which was the motivation behind this update. No other side effects are expected.
- Ensure consistent use of double quotes for strings in the
Gemfile and sitemap configuration files.
- Add spaces for better readability in array declarations
within the RefreshSitemapWorker.
These changes improve the readability of the code without
changing any functionality. Adhering to a consistent coding
style helps maintainability and team collaboration.
- Add disallow rules for /admin/ to prevent indexing
- Update sitemap URL to point to the correct domain
These changes improve site indexing by ensuring that sensitive
admin pages are not accessible to search engine crawlers
and updating the sitemap to reflect the accurate URL, helping
discovery and SEO efforts.
- Introduced `SeoConcern` module to handle SEO meta tags
- Integrated `meta-tags` gem for customizable meta tags
- Created `RefreshSitemapWorker` to automate sitemap updates
- Added relevant meta tags in controllers for weather art and cities
- Configured sitemap generation settings
These changes improve the SEO of the application by ensuring that
pages have appropriate meta tags. Additionally, a sitemap is now
generated and refreshed daily, enhancing site visibility to search
engines.
- Add language attribute to HTML tag
- Update meta viewport attribute for accessibility
- Include Plausible JavaScript tracking script for analytics
This change improves application accessibility by setting the language attribute for the HTML tag, and it enhances data collection capabilities by integrating Plausible analytics tracking.
- Update compose.yaml to pull policy: always for production environment
- Added RAILS_ENV environment variable for production
Changes impact the overall system functionality by ensuring containers are always pulled from the latest images, and provide clear environment variables for the production environment.
- Update route for Sidekiq web interface from '/sidekiq'
to '/admin/tasks'
This change improves the coherence of the application's routing
by placing the Sidekiq interface under a more descriptive
namespace. It consolidates admin-related tasks under a common
path, enhancing the organization of the routing structure.
- Adjust spacing around the quotes in the Gemfile
- Standardize spacing in the arts_controller for improved readability
- Modify routes file for consistent array formatting
These changes enhance the consistency of code style across the project without altering any functionality or behavior.
- Implement pagination for the cities index view.
- Add shared pagination partial to reduce code duplication.
- Modify arts index view to utilize the new pagination.
- Update cities controller to include pagination logic.
These updates improve usability by allowing better navigation through larger datasets, ensuring users can easily access and view items across multiple pages.
- Add region selection for filtering weather arts by region
- Implement sorting options for newest and oldest entries
- Update pagination to show links for each page when applicable
- Adjust the number of items displayed per page to 10
This commit enhances the user experience by allowing users to filter
and sort weather arts based on their preferences. It also improves
the pagination logic to provide more manageable navigation through
large datasets, making it easier for users to find the artworks they
are interested in.
- Introduce ArtsController with index action
- Create index view for displaying weather arts
- Implement Kaminari for pagination functionality
- Add necessary routes for accessing arts
- Update Gemfile to include Kaminari gem
- Create views for pagination controls
This implementation enhances the Weather Arts Gallery, allowing users to view and navigate through a collection of AI-generated weather arts easily. Pagination controls have been added to improve usability.
- Change network from 'net1' to 'dokploy-network'
- Make 'dokploy-network' an external network
- Update references in multiple services
This update modifies the docker-compose configuration to
utilize an external network named 'dokploy-network' instead
of the previously defined 'net1'. This change is intended
to improve network management and integration with existing
infrastructure.
- Define a custom network 'net1' for services
- Attach services to 'net1' network
- Ensure connectivity between application components
This commit enhances the Docker Compose setup by introducing a
custom network. This isolation can help manage service
dependencies better and improve communication between services,
establishing clearer boundaries. It simplifies networking
configuration and lays the groundwork for further scaling
if needed.
- Removed the version declaration from the compose.yaml file.
This change simplifies the configuration by removing a version number,
allowing Docker Compose to use the latest compatible version. This
change does not impact the functionality of the services defined in
this file.
- Replace hardcoded DATABASE_URL and RAILS_MASTER_KEY with
environment variables.
- Change POSTGRES_PASSWORD to utilize an environment
variable instead of a hardcoded value.
These changes enhance security by ensuring sensitive
information is not exposed in the configuration files,
allowing for better practices in managing environment
variables.
- Disabled port mapping for the web service in the Docker Compose file
- This may affect how the application is accessed outside of the container
- The decision to comment out the ports could be for environmental reasons or to avoid port conflicts
- Changed Redis data volume path from '../daw_data/redis' to '../taw_data/redis'.
This update reflects a restructuring in the project directory for better
data organization and may require corresponding adjustments in other
configuration files to ensure data consistency.
- Update PostgreSQL data directory to point to taw_data/pg
- Update Redis data directory to point to daw_data/redis
This change updates the Docker compose file to use different data directories for PostgreSQL and Redis. It improves the overall organization and clarity of the configuration.
- Change sleep duration from 1 minute to 10 seconds in
BatchGenerateWeatherArtsWorker.
This change addresses API limitations by reducing the wait time
between job submissions, thereby increasing the efficiency of
the batch processing for generating weather arts.
- Change BatchGenerateWeatherArtsWorker to use city ID instead of city object
- Update API endpoint to accept city ID
- Improve performance by reducing database queries
This change improves the performance of the BatchGenerateWeatherArtsWorker by reducing database queries and increasing efficiency. It is a necessary modification to ensure the worker functions correctly and efficiently.
- Include Sidekiq::Worker for asynchronous task execution
- Implement condition to skip execution if weather data is up to date
These changes enable efficient weather art generation by leveraging
background processing, thereby improving overall application
performance and responsiveness.
- Simplify step definitions by removing unnecessary
empty lines.
- Ensure compatibility with Docker Hub through the
addition of a comment to clarify the usage of the
REGISTRY variable.
These changes enhance the readability of the workflow file
without affecting its functionality. They make the CI/CD
pipeline clearer for future contributors by simplifying
structure and providing contextual information.
- Change from using GenerateWeatherArtJob to GenerateWeatherArtWorker
- Maintain asynchronous job processing
This refactoring improves the clarity of the job class being used
for generating weather art and adheres to project conventions. The
change does not affect the API rate limits as the sleep duration
remains the same.
- Replace synchronous job processing with asynchronous
- Ensure processing does not exceed API rate limits
This change allows for better performance by offloading the
queue management to Sidekiq, enabling more efficient
parallel processing of weather art generation. It also
prevents potential API rate limit violations by maintaining
a delay between requests.
- Changed 'last_weather_fetch' and 'last_image_generation'
from 10.hours.ago to 10.days.ago for various cities
- Affects seed data for cities in multiple countries, including:
- Australia
- Bangladesh
- Brazil
- Canada
- China
- Egypt
- France
- Germany
- India
- Japan
- Mexico
- Nigeria
- Pakistan
- Russia
- Saudi Arabia
- Singapore
- South Korea
- Thailand
- Turkey
- UK
- USA
- Vietnam
This change ensures that the timestamps reflect a more refined time range for when last weather data was fetched, possibly to enhance performance or consistency in application behavior.
- Removed unnecessary queue configurations from Sidekiq configuration
- Added 'whenever' gem and its necessary dependencies for adding cron jobs
- Updated Docker workflow to cache Docker layers using actions/cache
This update improves the efficiency of CI/CD pipelines by caching Docker layers, which will help in reducing the time taken for the build process. Additionally, the changes in the Gemfile and the config/sidekiq.yml configuration will enable the project to run cron jobs for tasks like generating weather arts.
- Enable dynamic scheduling only if the schedule file exists
- Update the sidekiq.yml to include a new job for batch generation
- Define a cron schedule for the new job to run every 2 hours
This update allows Sidekiq to conditionally enable its scheduler and
introduces a new job that processes weather art batches every two
hours. The change enhances the job management and scheduling
dynamics in the application.
- Comment out previous queue adapter setting for Solid Queue
- Set Active Job queue adapter to Sidekiq for better performance
This change updates the Active Job queue adapter from Solid Queue to
Sidekiq. This adjustment is intended to improve job processing
performance and reliability in production environments. The previous
adapter setting will be retained as a comment for reference.
- Remove environment condition for admin user creation
This change simplifies the admin user creation in the seeds file by
removing the conditional check for the development environment.
As a result, the admin user will be created regardless of the
environment, which may need to be addressed to avoid unintended
consequences in production setups.
- Create admin user with email 'admin@example.com' and password 'password' for development environment
This change allows for easier development and testing by providing a default admin user.
- Renamed `BatchGenerateWeatherArtsJob` to `BatchGenerateWeatherArtsWorker`
- Renamed `GenerateWeatherArtJob` to `GenerateWeatherArtWorker`
- Updated Sidekiq configuration to set Redis URL and logger level
- Modified `sidekiq.yml` to use the new worker class names and added queue configurations
These changes help in aligning the class names with their purpose as
workers in Sidekiq, while also ensuring better configuration for
Redis and logging.
- Standardized quotation marks in Gemfile and Ruby files
- Improved consistency for Sidekiq and Sidekiq Scheduler
- Removed unnecessary blank line in GenerateWeatherArtWorker class
These changes ensure a consistent coding style across the project, making
it easier to read and maintain. Adjustments to the Gemfile update the
formatting without altering the functionality.
- Implement BatchGenerateWeatherArtsWorker to handle batch
processing of weather art generation.
- Create GenerateWeatherArtWorker for individual weather art
generation tasks.
- Update Dockerfile to include redis-tools for Sidekiq support.
- Modify Gemfile to add sidekiq and sidekiq-scheduler gems.
- Configure Sidekiq in initializers and set up routes for
Sidekiq dashboard.
- Include a sidekiq.yml configuration for scheduling jobs.
- Create compose.yaml for Docker services including web,
database, Redis, and Sidekiq workers.
These changes introduce background processing capabilities
using Sidekiq, allowing for efficient generation of weather
art through scheduled and managed job queues, optimizing
performance and scalability.
- Change the precompilation command to include RAILS_BUILD=1
- This modification allows for environment-specific builds without altering the existing secret handling
This update enhances the flexibility of the asset precompilation process during deployment while maintaining the required application security measures.
- Change active storage service to use `:build` or `:amazon`
- Added a new `build` service for local disk storage
This update allows for better flexibility in managing file
storage based on the environment. The configuration now checks
the `RAILS_BUILD` environment variable to decide on the
storage service, making it easier to handle local testing and
production deployments without manual adjustments.
- Change default region for amazon_dev to 'wnam'
- Change default region for amazon to 'wnam'
This commit updates the storage configuration for AWS S3 by
setting the default region to 'wnam' for both development
and production environments. The change ensures that a valid
region is used even when the environment variable is not set.
This is a preparatory step for deployments needing a specific
region if the configuration is incomplete.
- Change job execution frequency from once every hour to every two hours.
- Ensure the `BatchGenerateWeatherArtsJob` runs as intended without unnecessary frequency.
This change addresses performance concerns by reducing the load on the system caused by frequent job executions.
- Added 'libpq-dev' to the packages installed in the Dockerfile
- Updated the base_uri in WeatherService to use 'dig' for safer access
These changes improve the Docker environment by ensuring that
necessary PostgreSQL development headers are available during
installation. The weather service now safely accesses the
URI from the credentials, reducing the risk of errors when
fetching nested configuration data.
- Update active status of various cities from false to true
- Ensures that all seeded cities are now enabled and available for usage
This change activates previously inactive cities in the seed files, which
facilitates their accessibility in subsequent deployments and testing.
The modification was made across numerous city seed files to ensure a
consistent state where all cities are now marked as active, improving
the readiness of the application.
- Add libpq5 to the list of installed packages for
database connections.
- Remove libpq-dev from the list as it is no longer
necessary for the build process.
These adjustments enhance the Docker image configuration,
ensuring the application can connect to PostgreSQL databases
without unnecessary build dependencies.
- Adjust formatting for message parameters in the chat call
- Eliminate unnecessary blank lines in generate_prompt_request method
- Ensure consistent styles for arrays and block indentation
These changes improve code readability and maintain consistency in
formatting for better maintainability without altering functionality.
- Created BatchGenerateWeatherArtsJob to process eligible
cities and generate weather art.
- Introduced GenerateWeatherArtJob for generating weather
art and image attachment.
- Added AiService for obtaining prompts and generating
images with OpenAI API.
- Implemented WeatherService to fetch current weather
data from the QWeather API.
- Updated Gemfile with necessary gems (whenever,
ruby-openai, httparty, down, aws-sdk-s3).
This commit introduces a system to create and store
weather art images for various cities based on current
weather conditions, leveraging external APIs for data
and image generation.
- Improve image and main info section for better aesthetics
- Add gradient overlay for text readability
- Include temperature display with feel-like temperature
- Enhance city name and location styling
- Add detailed weather information metrics (Humidity, Wind, Visibility)
- Provide a backup UI for when no image is available
This update enhances the user interface of the city weather card
by improving the layout and adding more detailed weather information.
The gradient overlays and reorganized elements improve readability and
usability. Additionally, a fallback display is included for cases where
weather images are not attached, ensuring consistent design.
- Introduce dropdown menus for region and country selection
- Adjust padding on title section for better layout
- Update filter navigation structure to improve UX
This commit refines the user interface for filtering cities by
allowing users to select regions and countries from dropdown
menus. The filtering options are now easier to navigate and
maintain a consistent aesthetic with adjusted padding for
better visual hierarchies.