AI Meets Node js With Crafting a Custom Sports Activity Service
summary
Node.js + Express service wires an OpenAI GPT-3.5-turbo completion into a Postgres-backed user model (Knex migrations), Redis session store, and simple activity history, returning a concrete JSON: activities JSON with type duration water plan. Prompts use a strict system role and user role carrying indicators; temperature set to 0.9 yields varied suggestions like 45 or 16 minute sessions. Demo shows suggestions saved as “last activity” (inserted immediately, not verified by a device).
AI-written summary · about
chapters (29)
- 0:00intro
- 0:22preamble
- 0:50lineup
- 1:32introduction
- 3:05openai
- 4:15setup openai
- 6:19dependencies
- 9:29knex setup
- 9:51knex migrations
- 11:10models
- 11:42user model
- 12:09indicator model
- 12:33activity model
- 12:51initial point
- 13:16redis
- 13:47auth middleware
- 14:32routes
- 15:18expectations
- 19:27openai api config
- 19:53controller
- 21:41system prompt
- 22:04completions
- 22:16system prompt
- 23:24user prompt
- 27:56suggestion controller
- 28:32update indicator
- 29:31activities
- 29:54github
- 30:32thank you for the attention
related talks
20mJavascript AI Cookbook: Building AI powered product features
25mLets Build A Node.js ChatGPT-Like Bot With AI APIs
19mHow I Learned React Native with AI
26mUnleash the Power of AI Craft Your Magic with ChatGPT API!
29m"AI-Powered Gamification for the Web"
34mPatterns of Application Development Using AI
23mUnleashing the Power of AI: Write your own AI Extension
47mGlimpses of Humanity: My Game-Building AI Pair
