``` ├── .editorconfig ├── .env.example ├── .gitignore ├── .node-version ├── .prettierignore ├── .prettierrc ├── LICENSE ├── README.md ├── angular.json ├── eslint.config.js ├── index.html ├── package-lock.json ``` ## /.editorconfig ```editorconfig path="/.editorconfig" # Editor configuration, see https://editorconfig.org root = true [*] charset = utf-8 indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true [*.ts] quote_type = single [*.md] max_line_length = off trim_trailing_whitespace = false ``` ## /.env.example ```example path="/.env.example" DEEPSEEK_API_KEY= VITE_PUBLIC_SUPABASE_URL= VITE_PUBLIC_SUPABASE_ANON_KEY= ``` ## /.gitignore ```gitignore path="/.gitignore" # See http://help.github.com/ignore-files/ for more about ignoring files. # Compiled output /dist /tmp /out-tsc /bazel-out # Node /node_modules npm-debug.log yarn-error.log # IDEs and editors .idea/ .project .classpath .c9/ *.launch .settings/ *.sublime-workspace # Visual Studio Code .vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json .history/* # Miscellaneous /.angular/cache /.nx/cache /.nx/workspace-data .sass-cache/ /connect.lock /coverage /libpeerconnection.log testem.log /typings # System files .DS_Store Thumbs.db # Env .env ``` ## /.node-version ```node-version path="/.node-version" 22.14.01 ``` ## /.prettierignore ```prettierignore path="/.prettierignore" # Ignore artifacts: build coverage ``` ## /.prettierrc ```prettierrc path="/.prettierrc" {} ``` ## /LICENSE ``` path="/LICENSE" MIT License Copyright (c) 2025 Hamed Sedighi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` ## /README.md # Austen Austen is an AI-powered Angular application initialized with Analogjs 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 ## Example Graph A character relationship graph generated for "The Wizard of Oz" by "L. Frank Baum": ```mermaid %%{ init: { 'theme': 'base', 'themeVariables': { 'primaryColor': '#BB2528', 'primaryTextColor': '#fff', 'primaryBorderColor': '#7C0000', 'lineColor': '#F8B229', 'secondaryColor': '#006100', 'tertiaryColor': '#fff' } } }%% graph TD A[Dorothy Gale] -->|Pet| B[Toto] A -->|Family| C[Uncle Henry and Aunt Em] A -->|Friends| D[Scarecrow] A -->|Friends| E[Tin Woodman] A -->|Friends| F[Cowardly Lion] A -->|Enemy| G[The Wicked Witch of The West] A -->|Enemy| H[The Wizard of OZ] A -->|Helps Dorothy| I[Glinda] D -->|Friends| E E -->|Friends| F B -->|In Kansas| C ``` ## Stacks: - [Angular](https://angular.dev) - [Analog](https://analogjs.org) - [TypeScript](https://www.typescriptlang.org) - [Supabase](https://supabase.com) - [Cloudflare Pages](https://pages.cloudflare.com) ## UI - [Angular Material](https://material.angular.io) - [Mermaid](https://mermaid.js.org) ## API - [Open Library](https://openlibrary.org) - [DeepSeek](https://deepseek.com) - [OpenAI](https://platform.openai.com/docs/quickstart) ## Installation & Setup 1. Clone the repository: ```bash git clone https://github.com/herol3oy/austen.git cd austen ``` 2. Install dependencies: ```bash npm install ``` 3. Set up environment variables: - Copy `.env.example` to `.env` - Fill in the required API keys: ```env DEEPSEEK_API_KEY=your_deepseek_api_key VITE_PUBLIC_SUPABASE_URL=your_supabase_url VITE_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key ``` 4. Set up Supabase: - Create a new Supabase project - Enable authentication - Create graphs table in the public schema: - id uuid primary key - book_name text not null - author_name text not null - svg_graph text not null - mermaid_syntax text not null - emojis text - user_id uuid - is_public boolean default false - created_at timestamp 5. Start the development server: ```bash npm run dev ``` 6. Build for production: ```bash 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  Generate a graph for a given book in the homepage  Find your generated graphs in the my graphs page  Find public graphs in the discover page ## 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](LICENSE) ## /angular.json ```json path="/angular.json" { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", "projects": { "my-app": { "projectType": "application", "root": ".", "sourceRoot": "src", "prefix": "app", "architect": { "build": { "builder": "@analogjs/platform:vite", "options": { "configFile": "vite.config.ts", "main": "src/main.ts", "outputPath": "dist/client", "tsConfig": "tsconfig.app.json" }, "defaultConfiguration": "production", "configurations": { "development": { "mode": "development" }, "production": { "sourcemap": false, "mode": "production" } } }, "serve": { "builder": "@analogjs/platform:vite-dev-server", "defaultConfiguration": "development", "options": { "buildTarget": "my-app:build", "port": 5173 }, "configurations": { "development": { "buildTarget": "my-app:build:development", "hmr": true }, "production": { "buildTarget": "my-app:build:production" } } }, "test": { "builder": "@analogjs/vitest-angular:test" } } } } } ``` ## /eslint.config.js ```js path="/eslint.config.js" import pluginJs from "@eslint/js"; import simpleImportSort from "eslint-plugin-simple-import-sort"; import globals from "globals"; import tseslint from "typescript-eslint"; /** @type {import('eslint').Linter.Config[]} */ export default [ { files: ["**/*.{js,mjs,cjs,ts}"] }, { languageOptions: { globals: { ...globals.browser, ...globals.node } } }, { plugins: { "simple-import-sort": simpleImportSort, }, rules: { "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", }, }, pluginJs.configs.recommended, ...tseslint.configs.recommended, ]; ``` ## /index.html ```html path="/index.html"