- Notifications
You must be signed in to change notification settings - Fork18
📚 discover story relationships
License
herol3oy/austen
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Austen is an AI-powered Nextjs application to generate story relationships between book characters using Mermaidjs diagrams.
- 📚 Search and analyze any book from Open Library
- 🤖 AI-powered character relationship analysis
- 📊 Generate Mermaid diagrams
- 💾 Save, download (SVG, PNG) and manage your generated graphs
- 🌐 Share graphs publicly or keep them private
- 🔍 Discover public graphs generated by other users
- 👤 User accounts
A character relationship graph generated for "Sense and Sensibility" by Jane Austen:
%%{ init: { 'theme': 'base', 'themeVariables': { 'primaryColor': '#BB2528', 'primaryTextColor': '#fff', 'primaryBorderColor': '#7C0000', 'lineColor': '#F8B229', 'secondaryColor': '#006100', 'tertiaryColor': '#fff' } }}%% graph LR A(Elinor Dashwood) -->|Sister| B([Marianne Dashwood]) A -->|Mother| C([Mrs. Dashwood]) A -->|Love Interest| D([Edward Ferrars]) B -->|Love Interest| E([John Willoughby]) B -->|Admirer| F([Colonel Brandon]) C -->|Stepbrother| G([John Dashwood]) G -->|Wife| H([Fanny Dashwood]) D -->|Fiancée| I([Lucy Steele]) F -->|Guardian| J([Eliza Williams])Clone the repository:
git clone https://github.com/herol3oy/austen.gitcd austenInstall dependencies:
npm i
Set up environment variables:
- Copy
.env.local.exampleto.env.local - Fill in the required API keys:
DEEPSEEK_API_KEY=your_deepseek_api_keyNEXT_PUBLIC_SUPABASE_URL=your_supabase_urlNEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
- Copy
Set up Supabase:
Create a new Supabase project
Enable authentication
Run the following SQL statements in your Supabase SQL editor to create the
graphsandprofilestables:createtablepublic.graphs ( id uuidnot null, book_nametextnot null, svg_graphtextnot null, mermaid_syntaxtextnot null, created_attimestamp with time zonenot null default now(), author_nametextnull, emojistextnull, user_id uuidnull, is_publicbooleannull default false,constraint graphs_pkeyprimary key (id),constraint graphs_user_id_fkeyforeign KEY (user_id)referencesauth.users (id)) TABLESPACE pg_default;createtablepublic.profiles ( id uuidnot null, usernametextnot null, updated_attimestamp with time zonenull default now(),constraint profiles_pkeyprimary key (id),constraint profiles_username_key unique (username),constraint profiles_id_fkeyforeign KEY (id)referencesauth.users (id)on delete CASCADE,constraint username_formatcheck ((username ~'^[a-zA-Z0-9_]+$'::text)),constraint username_lengthcheck ( ( (char_length(username)>=3)and (char_length(username)<=20) ) )) TABLESPACE pg_default;
Set up Row Level Security (RLS) for both tables (see Supabase dashboard for examples on restricting access based on
user_idoris_publicstatus).Create a Supabase database function
handle_new_userand a trigger onauth.usersto automatically create a profile entry when a new user signs up. The function should extract the username fromNEW.raw_user_meta_data ->> 'username'.-- Function to create a profile for a new usercreatefunctionpublic.handle_new_user()returns triggerlanguage plpgsqlsecurity definerset search_path= publicas $$begininsert intopublic.profiles (id, username)values (new.id,new.raw_user_meta_data->>'username'); return new;end;$$-- Trigger to call the function after a new user is createdcreatetriggeron_auth_user_created after insertonauth.users for each row execute procedurepublic.handle_new_user();
Start the development server:
npm run dev
Build for production:
npm run build
Implement Like/Unlike Functionality for Graphs
- Add like button
- Implement like/unlike API endpoints in Supabase
- Add like count display
Load more graphs in the discover page
- Add a button to load more graphs
"Jane Austen Inspired Illustrations", CC-BY 4.0. Quelle:https://colorconfetti.com/culture-history-environment/jane-austen/jane-austen-inspired-illustrations/
About
📚 discover story relationships
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.