A running companion powered by Mistral AI and Supabase. Live Demo here
Screen.Recording.2025-01-19.at.12.07.05.AM-1.mov
- Usage of Mistral AI's API (and formatted output) for high-quality session generation
- Secure user authentication with Supabase and secured Row Level Security (RLS) policies for data isolation
Before you begin, ensure you have:
- Node.js
- pnpm or npm or yarn
- A Supabase account
- A Mistral AI API key
- Clone the repository
git clone git://github.com/PierreLouisLetoquart/runstral.git
cd runstral- Install dependencies
pnpm install- Set up environment variables
cp .env.local.example .env.localEdit .env.local with your credentials:
SUPABASE_URLSUPABASE_ANON_KEYMISTRAL_API_KEY
Note
Not the smoothest way to work with supabase locally, I'll improve it soon !
Execute the following SQL in your Supabase SQL editor:
CREATE TABLE public.sessions (
id bigint primary key generated always as identity,
created_at timestamp with time zone default now() not null,
user_id uuid references auth.users(id) on delete cascade,
day date not null,
duration integer,
type text,
intensity text,
description text,
completed boolean default false not null,
warmup text,
cooldown text,
displayed boolean default true
) WITH (OIDS=FALSE);
CREATE INDEX idx_sessions_user_id ON public.sessions(user_id);Run the development server:
pnpm run devOpen http://localhost:3000 in your browser.
This project is licensed under the MIT License - see the LICENSE file for details.
- Mistral AI for the AI capabilities
- Supabase for the backend infrastructure
Note: This is a super quick prototype, so please be indulgent. ;) A lot more needs to be done to create an interesting POC.
Note
Here are some notes and diagrams that I'll use to develop the project...
These are the really first steps of the project, so I'm just writing down some ideas and thoughts. They can be a bit unclear, too advanced or whatever; but they provide a good starting point for the project.
journey
title Before Runstral
section Want to do sport
Motivated: 4: Me
What can I do ?: 3: Me
Demotivation: 1: Me
journey
title With Runstral
section Want to do sport
Motivated: 4: Me
What can I do ?: 3: Me
Propose a session: 5: App
Go running: 5: Me
---
config:
theme: neutral
look: handDrawn
layout: fixed
---
flowchart TD
A["Desire to do sport"] -- Open Runstral --> B{"Check current state"}
B -- No context --> C["Update context"]
C -- Context not good --> D["Improve context"]
B -- No planned session --> E["Generate a session"]
E -- Tired --> G["Mood"]
E -- In 2 days --> H["Date"]
E -- What do I want to do? --> I["Prompt"]
I --> J["Generate session"]
H --> J
G --> J
B -- Already planned --> F["Planned session"]
F o-.-o J
F --> L{"Session okay?"}
L -- No --> E
J --> K["New session"]
L -- Yes --> Z@{ label: "Let's run!" }
Z@{ shape: rect}
A:::Peach
K:::Peach
classDef Peach stroke-width:1px, stroke-dasharray:none, stroke:#FBB35A, fill:#FFEFDB, color:#8F632D
style K fill:#FFE0B2
Made with ❤️ by Pierre-Louis Létoquart
