Skip to content

Commit 2c7b796

Browse files
committed
Update documentation
1 parent 0f89d56 commit 2c7b796

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# This file is based on these images:
88
#
99
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image
10-
# - https://hub.docker.com/_/debian/tags?name=trixie-20260202-slim - for the release image
10+
# - https://hub.docker.com/_/debian/tags?name=trixie-20260112-slim - for the release image
1111
# - https://pkgs.org/ - resource for finding needed packages
12-
# - Ex: docker.io/hexpm/elixir:1.19.5-erlang-28.3.1-debian-trixie-20260202-slim
12+
# - Ex: docker.io/hexpm/elixir:1.19.5-erlang-28.3.1-debian-trixie-20260112-slim
1313
#
1414
ARG ELIXIR_VERSION=1.19.5
1515
ARG OTP_VERSION=28.3.1

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ Specifically, it fetches and displays the OpenGraph image tag from the provided
66
## Main components:
77

88
- **LiveViews**: The `OgCatalogWeb.OpenGraphObjectLive.Index` module handles the user interface and interactions. It allows users to input a URL and displays the corresponding OpenGraph image with real-time updates.
9-
- **Oban**: Oban is a robust background job framework which can use PostgreSQL for storage. The `OgCatalog.Oban.FetchOpenGraphImage` module is responsible for fetching the OpenGraph image in the background. It uses Oban to manage background jobs, ensuring that the fetching process does not block the main application.
9+
- **Oban**: Oban is a robust background job framework which can use PostgreSQL for storage. The `OgCatalog.Workers.ProcessPageUrl` module is responsible for processing page URLs and fetching the OpenGraph metadata in the background. It uses Oban to manage background jobs and delegates the actual fetching/parsing to `OgCatalog.Services.OpenGraphService`, ensuring that the fetching process does not block the main application.
1010
- **Phoenix PubSub**: Phoenix PubSub is used to broadcast updates to the LiveView when new OpenGraph images are fetched, allowing for real-time updates without requiring a page refresh.
1111
- **Ecto**: Ecto is used for database interactions. The `OgCatalog.OpenGraphObjects` context manages the OpenGraph objects stored in the database, allowing for efficient querying and data manipulation.
1212
- **OpenGraph Library**: The `OpenGraph` library is utilized to fetch and parse OpenGraph metadata from the provided URLs. It simplifies the process of extracting the necessary information, such as the image tag, from the web pages.
13-
- **Testing**: The application includes comprehensive tests for both the LiveView and the Oban worker. The tests ensure that the application behaves as expected, with proper handling of valid and invalid URLs, and that the OpenGraph images are fetched and displayed correctly.
1413
- **Error Handling**: The application includes error handling mechanisms to manage cases where the provided URL is invalid or when the OpenGraph metadata cannot be fetched. This ensures a smooth user experience and prevents crashes.
1514
- **Database**: PostgreSQL is used as the database for storing OpenGraph objects. The application includes migrations to set up the necessary tables and schemas.
1615

@@ -19,7 +18,7 @@ Specifically, it fetches and displays the OpenGraph image tag from the provided
1918
1. The user enters a URL in the LiveView interface.
2019
2. The application validates the URL while the user types.
2120
3. The user submits the URL.
22-
4. The application creates a new OpenGraphObject in the database and enqueue an Oban job to process the URL and fetch the OpenGraph image.
21+
4. The application creates a new OpenGraphObject in the database and enqueues an Oban job to process the URL and fetch the OpenGraph image.
2322
5. The Oban worker pulls the job, fetches the page from the provided URL using the OpenGraph library. If the URL is valid and the metadata is successfully fetched, it extracts the og:image URL.
2423
6. Once the og:image URL is fetched, the Oban worker updates the OpenGraphObject in the database and broadcasts the update to the LiveView.
2524
7. The LiveView receives the update and displays the OpenGraph Image to the user.
@@ -33,7 +32,7 @@ Specifically, it fetches and displays the OpenGraph image tag from the provided
3332
4. URL Shortening: Integrate a URL shortening service to handle long URLs more effectively.
3433
5. Enhanced Error Handling: Improve error handling to provide more detailed feedback to users when fetching OpenGraph metadata fails.
3534

36-
## Pre-requisites
35+
## Prerequisites
3736

3837
* Elixir ~> 1.19
3938
* Erlang/OTP ~> 28.3
@@ -121,7 +120,7 @@ Once the server is running, you can access the application by navigating to [`Op
121120
## Running the tests in a docker container
122121

123122
You can run the tests in a docker container to ensure a consistent environment.
124-
The Makefile includes a `test` target that builds and runs the tests inside a Docker container.
123+
The Makefile includes a `tests` target that builds and runs the tests inside a Docker container.
125124
To run the tests in a Docker container, execute the following command from the project root:
126125

127126
```sh

config/test.exs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ config :og_catalog, Oban, testing: :manual
33
config :og_catalog, open_graph_module: OpenGraphMock
44

55
# Configure your database
6-
#
7-
# The MIX_TEST_PARTITION environment variable can be used
8-
# to provide built-in test partitioning in CI environment.
9-
# Run `mix help test` for more information.
106
config :og_catalog, OgCatalog.Repo,
117
hostname: System.get_env("DB_HOST") || "localhost",
128
database: "og_catalog_test",

0 commit comments

Comments
 (0)