Skip to content

Commit ebd170e

Browse files
committed
Update README.md
1 parent b248f97 commit ebd170e

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

app/api/flickr/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
1-
# README for Flickr API integration
21

3-
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
43

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:
85

9-
### Route
6+
- `FLICKR_USER`
7+
- `FLICKR_KEY`
8+
- `FLICKR_SECRET`
9+
10+
## Endpoints
1011

1112
- **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.
1216

13-
### Proposed Table Design
17+
## Table Design
1418

15-
1. flickr_accounts
19+
1. **flickr_accounts**
1620
- One row per Flickr account/user profile.
1721
- Stores account identity fields and full raw payload.
18-
2. flickr_photos
22+
2. **flickr_photos**
1923
- One row per photo.
24+
- `flickr_id` is unique.
2025
- Stores photo metadata plus raw JSON payload.
21-
3. flickr_albums
26+
3. **flickr_albums**
2227
- One row per album.
2328
- Stores album metadata plus raw JSON payload.
24-
4. flickr_resources
29+
4. **flickr_resources**
2530
- Generic catch-all for any future Flickr resource type.
2631
- Supports additional Flickr objects through jsonb payload storage.
2732

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

Comments
 (0)