You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module provides API routes for accessing Flickr data, similar to the GitHub integration. It expects the following environment variables to be set in your .env file:
2
+
# Flickr API Integration
4
3
5
-
- FLICKR_USER
6
-
- FLICKR_KEY
7
-
- FLICKR_SECRET
4
+
This module provides API routes for accessing and syncing Flickr data, mirroring the GitHub integration. It expects the following environment variables in your `.env` file:
8
5
9
-
### Route
6
+
-`FLICKR_USER`
7
+
-`FLICKR_KEY`
8
+
-`FLICKR_SECRET`
9
+
10
+
## Endpoints
10
11
11
12
-**GET /flickr**: Returns counts and recent records from all Flickr tables.
13
+
-**POST /flickr/createtable**: Drops all Flickr tables if they exist, then recreates them with the correct schema and constraints.
14
+
-**POST /flickr/emptytables**: Deletes all rows from all Flickr tables (does not drop tables).
15
+
-**POST /flickr/sync**: Fetches public photos for the configured Flickr user and stores them in the database.
12
16
13
-
### Proposed Table Design
17
+
## Table Design
14
18
15
-
1. flickr_accounts
19
+
1.**flickr_accounts**
16
20
- One row per Flickr account/user profile.
17
21
- Stores account identity fields and full raw payload.
18
-
2. flickr_photos
22
+
2.**flickr_photos**
19
23
- One row per photo.
24
+
-`flickr_id` is unique.
20
25
- Stores photo metadata plus raw JSON payload.
21
-
3. flickr_albums
26
+
3.**flickr_albums**
22
27
- One row per album.
23
28
- Stores album metadata plus raw JSON payload.
24
-
4. flickr_resources
29
+
4.**flickr_resources**
25
30
- Generic catch-all for any future Flickr resource type.
26
31
- Supports additional Flickr objects through jsonb payload storage.
27
32
28
-
This structure mirrors the GitHub integration for consistency and flexibility.
33
+
## Notes
34
+
35
+
- The `/flickr/createtable` endpoint will **drop all Flickr tables** before recreating them. Use with caution—this will erase all Flickr data.
36
+
- The `/flickr/sync` endpoint currently fetches public photos for the configured user and inserts them into `flickr_photos`.
37
+
- The structure and endpoints are designed for consistency and flexibility, matching the GitHub integration.
0 commit comments