Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

📚 discover story relationships

License

NotificationsYou must be signed in to change notification settings

herol3oy/austen

Repository files navigation

Austen is an AI-powered Nextjs application to generate story relationships between book characters using Mermaidjs diagrams.

Features

  • 📚 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

Example Graph

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])
Loading

Stacks:

UI

API

Installation & Setup

  1. Clone the repository:

    git clone https://github.com/herol3oy/austen.gitcd austen
  2. Install dependencies:

    npm i
  3. Set up environment variables:

    • Copy.env.local.example to.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
  4. Set up Supabase:

    • Create a new Supabase project

    • Enable authentication

    • Run the following SQL statements in your Supabase SQL editor to create thegraphs andprofiles tables:

      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 onuser_id oris_public status).

    • Create a Supabase database functionhandle_new_user and a trigger onauth.users to 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();
  5. Start the development server:

    npm run dev
  6. Build for production:

    npm run build

TODO

  • 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

Screenshot

Jane Austen logo reference

"Jane Austen Inspired Illustrations", CC-BY 4.0. Quelle:https://colorconfetti.com/culture-history-environment/jane-austen/jane-austen-inspired-illustrations/

License

MIT LICENSE

About

📚 discover story relationships

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp