This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

docs: add api docs

+41 -2
+41 -2
README.md
··· 2 2 3 3 <img src="https://raw.githubusercontent.com/taciturnaxolotl/takes/main/.github/images/smokie.svg" height="175" align="right" alt="smokie the bear"> 4 4 5 - > ### More deets coming soon ๐Ÿ‘€ 5 + > ### More deets coming soon ๐Ÿ‘€ ๐Ÿ”๏ธ ๐Ÿ“น 6 6 > A slack bot that tracks takes and accepts uploads; developed with ๐Ÿ’– @ [Hack Club](https://github.com/hackclub) 7 7 > 8 8 > โš ๏ธ **Highly opinionated slack bot warning** - Project rapidly iterating 9 9 10 - # ๐Ÿšง Dev 10 + ## ๐Ÿšง Dev 11 11 12 12 You can launch the bot locally with bun 13 13 ··· 37 37 SENTRY_DSN="https://xxxxxx@xxxxxx.ingest.us.sentry.io/xxxx" 38 38 DATABASE_URL="postgres://username:password@host:5432/smokie" 39 39 CDN_TOKEN="cdn_token" 40 + ``` 41 + 42 + ## ๐Ÿ”Œ API Docs 43 + 44 + all endpoints are prefixed with `/api` and return JSON unless specified otherwise 45 + 46 + ``` 47 + GET /api/video?media=<url> 48 + ``` 49 + returns an HTML page with a video player for the given media URL 50 + 51 + ``` 52 + GET /api/recentTakes?user=<userId> 53 + ``` 54 + returns recent takes, optionally filtered by user ID 55 + - if user not found, returns `404` with an empty takes array 56 + - returns up to 40 takes ordered by creation date (newest first) 57 + - includes project info and total time stats 58 + 59 + ``` 60 + GET /api/projects?user=<userId> 61 + ``` 62 + returns project info 63 + - with user param: returns a single project for that user 64 + - without user param: returns all projects 65 + - returns empty array if no projects found 66 + 67 + typical take object looks like: 68 + ```ts 69 + { 70 + id: string; 71 + userId: string; 72 + notes: string; 73 + createdAt: Date; 74 + mediaUrls: string[]; 75 + elapsedTime: number; // seconds 76 + project: string; 77 + totalTakesTime: number; // seconds 78 + } 40 79 ``` 41 80 42 81 ## ๐Ÿ“œ License