{"id":24499550,"url":"https://github.com/opensass/aibook","last_synced_at":"2026-02-28T22:31:45.786Z","repository":{"id":262349026,"uuid":"883282373","full_name":"opensass/aibook","owner":"opensass","description":"🦀 Full Stack Content Generation SaaS Platform Powered by Dioxus, Dioxus Server Functions, Axum, Unsplash, Gemini AI \u0026 MongoDB.","archived":false,"fork":false,"pushed_at":"2025-05-16T12:43:24.000Z","size":3056,"stargazers_count":20,"open_issues_count":9,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T11:03:30.708Z","etag":null,"topics":["axum","deployment","dioxus","full-stack","gemini","gemini-api","gemini-pro","mongodb","mongodb-atlas","railway","rust","unsplash"],"latest_commit_sha":null,"homepage":"https://opensass.org/aibook","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opensass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-04T17:33:31.000Z","updated_at":"2025-06-29T04:15:21.000Z","dependencies_parsed_at":"2024-11-12T00:33:21.300Z","dependency_job_id":"1601e4e4-c72c-4aa9-9ead-2ad3d02bb042","html_url":"https://github.com/opensass/aibook","commit_stats":null,"previous_names":["opensass/aibook"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/opensass/aibook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensass%2Faibook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensass%2Faibook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensass%2Faibook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensass%2Faibook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensass","download_url":"https://codeload.github.com/opensass/aibook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensass%2Faibook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29953284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axum","deployment","dioxus","full-stack","gemini","gemini-api","gemini-pro","mongodb","mongodb-atlas","railway","rust","unsplash"],"created_at":"2025-01-21T22:14:44.438Z","updated_at":"2026-02-28T22:31:45.752Z","avatar_url":"https://github.com/opensass.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# 📖 AIBook 🤖\n\n[![made-with-rust](https://img.shields.io/badge/Made%20with-Rust-1f425f.svg?logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n[![Rust](https://img.shields.io/badge/Rust-1.85%2B-blue.svg)](https://www.rust-lang.org)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/wiseaidev)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n[![Open SASS Discord](https://dcbadge.limes.pink/api/server/b5JbvHW5nv)](https://discord.gg/b5JbvHW5nv)\n\n| 🐧 Linux `(Recommended)` | 🪟 Windows |\n| :------: | :------: |\n| \u003cvideo src=\"https://github.com/user-attachments/assets/aaa3b858-8f81-4c92-9cdc-c18e6300b48d\"\u003e\u003c/video\u003e | \u003cvideo src=\"https://github.com/user-attachments/assets/9b593e2b-6c22-406e-93b7-d620448f82e7\"\u003e\u003c/video\u003e |\n| [**Download Executable**](https://github.com/opensass/aibook/releases/download/v0.0.8/web.zip) | [**Download Executable**](https://github.com/opensass/aibook/releases/download/v0.0.1/dist.rar) |\n| [**Set Environment Variables**](https://github.com/opensass/aibook#-setting-up-env-vars) | [**Set Environment Variables**](https://github.com/opensass/aibook#-setting-up-env-vars) |\n| unzip files | unzip files |\n| execute `./web/server` | execute `.\\dist\\aibook.exe` |\n\n\u003c/div\u003e\n\n## 📐 Architecture\n\n![Arch](https://github.com/user-attachments/assets/b5af3f0b-1855-4510-853a-f4258e81cccd)\n\n## 🖥️ For the `.exe` Enjoyers\n\nSo, you're the kinda person who'd rather download an `.exe` than spend 20 minutes watching code compile? No worries; I gotcha! 🎉 Each release comes with pre-compiled binaries. Just download, set env vars, run a command, and boom.\n\n\u003e [!NOTE]\n\u003e\n\u003e - 📸 **Unsplash API**: Limited to 50 requests per hour.\n\u003e - 💎 **Gemini credits**: Unlimited!\n\u003e - 🗄️ **MongoDB Storage**: Capped at around ~512MB.\n\nNow, navigate to the [🔑 Setting Up Env Vars](https://github.com/opensass/aibook#-setting-up-env-vars) section.\n\n## 🤓 For the Hardcore Nerds\n\nAight, if you're, just like me, one of those brave souls who **wants** to compile everything themself, this section is for you. 🛠️ No shortcuts, just raw code and dedication. Grab your favorite terminal, fire up those dependencies, and let the adventure begin!\n\n### 🛠️ Pre-requisites:\n\n1. Install [`rustup`](https://www.rust-lang.org/tools/install):\n\n   ```bash\n   curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n   ```\n\n1. Install [`Dioxus CLI`](https://dioxuslabs.com/learn/0.6/getting_started):\n\n   ```bash\n   cargo install dioxus-cli\n   ```\n\n1. Fork/Clone the GitHub repository.\n\n   ```bash\n   git clone https://github.com/opensass/aibook\n   ```\n\n## 🔑 Setting Up Env Vars\n\nBefore you can start running AIBook, you'll need to configure a few environment variables. These are essential for connecting to external services like MongoDB, Unsplash, and the Gemini AI, so let's get you set up! Here's a quick guide:\n\n### Create an `.env` File\n\nInside the project root, copy and create a file named `.env` from `.env.example`. This file will securely store all your environment variables.\n\n```bash\ncp .env.example .env\n```\n\n\u003e [!NOTE]\n\u003e Replace the following values with your actual credentials.\n\u003e\n\u003e ```bash\n\u003e MONGODB_USR=\n\u003e MONGODB_PWD=\n\u003e MONGODB_CLSTR=your-cluster.mongodb.net\n\u003e MONGODB_DB_NAME=aibooks\n\u003e JWT_SECRET=\n\u003e GEMINI_API_KEY=\n\u003e UNSPLASH_API_KEY=\n\u003e STRIPE_SECRET_KEY=\n\u003e WEBSITE_URL=https://opensass.org\n\u003e STRIPE_PRICE_ONE=price_1...\n\u003e STRIPE_PRICE_TWO=price_1...\n\u003e ```\n\u003e\n\u003e If you're missing any of these keys, check the service's developer portal to generate them.\n\n### 🥑 Set Up MongoDB\n\nFollow [our quick guide](./MongoDB.md) to set up your MongoDB database and connect it to your project!\n\n### 🔐 Generate JWT Secret Key\n\nGenerate a secret key using OpenSSL and update its env var in the `.env` file.\n\n```bash\nopenssl rand -hex 128\n\nd8d0b35856c6fa90a8f3f818fa1c71785d63181945077a4c81e28f731de406c94acad5e864fc85604c520cd67e4977a06656eee081d2d0a897415bb42d8dca167662ae53078084ce70feaee104a3428797078c5bb359db277b26182114bb6b6f4e50d34dcce1ab2ed952912f5783ca89138d508f41bc2d56e60ef2480f501819\n```\n\n### ✨ Gemini AI API\n\nTo obtain your API key, navigate to [Google AI Studio](https://aistudio.google.com/app/apikey) and generate it there. This key allows aibook to communicate with Gemini API.\n\n### 📸 Unsplash API\n\nAIBook uses Unsplash which provides a powerful API to search for and retrieve high-quality images. To communicate with this api you will need a [Secret key](https://unsplash.com/oauth/applications). If you don't already have one, sign up for a free account at Unsplash, create a new app, and copy the Secret key at the bottom of the page after creating the app.\n\n### 💳 Stripe API\n\nFollow [our quick guide](./Stripe.md) to set up your stripe account and connect it to your project!\n\n### 🚀 Building and Running\n\n1. Run [the Tailwind CLI (v3)](https://v3.tailwindcss.com/docs/installation):\n\n   ```sh\n   npx tailwindcss@v3 -i ./assets/tailwind.css -o ./assets/output.css --watch\n   ```\n\n1. In a new terminal session, run the client:\n\n  ```sh\n  dx serve\n  ```\n\nNavigate to http://localhost:3000 to explore the landing page.\n\n\u003e [!WARNING]\n\u003e This might take a few minutes (yes, seriously). But hey, good things take time, right?\n\nHappy compiling! 😄\n\n## ✅ Supported Features\n\n- Support for all Gemini models (e.g. Gemini Pro 1.5, Flash 1.5).\n\n![Gemini Models](https://github.com/user-attachments/assets/58f531d0-c352-40eb-8bb2-aed7359fccbc)\n\n- Stripe support.\n\n![Stripe Demo](https://github.com/user-attachments/assets/2bbeacb0-ad01-4477-96b6-3e3d7f8c4bed)\n\n- Built-in Dark and Light themes.\n\n![Light Dark Themes](https://github.com/user-attachments/assets/71820497-efcc-4227-a906-e97cdf9aa45b)\n\n- JWT authentication.\n\n- Forms validations.\n\n![Email validation.](https://github.com/user-attachments/assets/7b86a5b5-e5a1-44af-8da1-b442d9869afc)\n\n- Instant toast notifications when submitting a form.\n\n![Toast notification.](https://github.com/user-attachments/assets/6c5149c9-bb5d-4786-a51b-38c36b4ade0c)\n\n- Sending and receiving text messages in real time.\n\n![Sending and receiving text messages.](https://github.com/user-attachments/assets/d3ca3f38-41dc-4815-b7eb-35f8b5d10e36)\n\n## 🗂️ Project Structure\n\nThis project is packing 81 files! 😅 But don't worry, it's all organized with love, care, and the principles of SoC and DRY in mind (peak engineering, ngl). Each file has a job to do, and it does it well; like little code ninjas in their own modular worlds.\n\nHere's what the structure looks like:\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ccode\u003e❯ cd src \u0026\u0026 tree\u003c/code\u003e\u003c/summary\u003e\n\n```sh\n❯ cd src \u0026\u0026 tree\n.\n├── ai.rs\n├── components\n│   ├── common\n│   │   ├── header.rs\n│   │   ├── logo.rs\n│   │   └── server.rs\n│   ├── common.rs\n│   ├── dashboard\n│   │   ├── analytics.rs\n│   │   ├── books\n│   │   │   ├── create.rs\n│   │   │   ├── edit.rs\n│   │   │   ├── list.rs\n│   │   │   └── read.rs\n│   │   ├── books.rs\n│   │   ├── chat\n│   │   │   ├── panel.rs\n│   │   │   └── sidebar.rs\n│   │   ├── chat.rs\n│   │   ├── fields\n│   │   │   ├── input.rs\n│   │   │   ├── number.rs\n│   │   │   └── select.rs\n│   │   ├── fields.rs\n│   │   ├── navbar.rs\n│   │   ├── profile.rs\n│   │   └── sidebar.rs\n│   ├── dashboard.rs\n│   ├── features\n│   │   ├── grid.rs\n│   │   └── item.rs\n│   ├── features.rs\n│   ├── footer\n│   │   ├── bottom.rs\n│   │   ├── contact.rs\n│   │   ├── icon.rs\n│   │   ├── links.rs\n│   │   ├── logo.rs\n│   │   └── support.rs\n│   ├── footer.rs\n│   ├── hero.rs\n│   ├── navbar\n│   │   ├── btns.rs\n│   │   └── links.rs\n│   ├── navbar.rs\n│   ├── pricing.rs\n│   ├── spinner.rs\n│   ├── testimonial\n│   │   ├── author.rs\n│   │   ├── card.rs\n│   │   └── rating.rs\n│   ├── testimonial.rs\n│   ├── toast\n│   │   ├── manager.rs\n│   │   └── provider.rs\n│   └── toast.rs\n├── components.rs\n├── db.rs\n├── lib.rs\n├── main.rs\n├── pages\n│   ├── book.rs\n│   ├── dashboard.rs\n│   ├── home.rs\n│   ├── login.rs\n│   └── signup.rs\n├── pages.rs\n├── router.rs\n├── server\n│   ├── auth\n│   │   ├── controller.rs\n│   │   ├── model.rs\n│   │   └── response.rs\n│   ├── auth.rs\n│   ├── book\n│   │   ├── controller.rs\n│   │   ├── model.rs\n│   │   ├── request.rs\n│   │   └── response.rs\n│   ├── book.rs\n│   ├── common\n│   │   ├── request.rs\n│   │   └── response.rs\n│   ├── common.rs\n│   ├── conversation\n│   │   ├── controller.rs\n│   │   ├── model.rs\n│   │   ├── request.rs\n│   │   └── response.rs\n│   ├── conversation.rs\n│   ├── subscription\n│   │   ├── controller.rs\n│   │   ├── model.rs\n│   │   ├── request.rs\n│   │   └── response.rs\n│   └── subscription.rs\n├── server.rs\n├── theme.rs\n└── unsplash.rs\n\n19 directories, 81 files\n```\n\n\u003c/details\u003e\n\n### 🛠️ What's Inside?\n\n- **Components**: All modular components live here, following the DRY principle. From `navbar` to `footer`, each feature has its own place, making it easy to find and tweak when needed.\n- **Server**: Adheres to the **MVC** pattern, making the backend as clean as a freshly minted Linux distro. You'll find models, controllers, and response handlers for each feature, organized and ready for action.\n- **Pages**: Each page of the app (e.g., `dashboard.rs`, `home.rs`) is set up here, so you know exactly where to go to update views.\n\nWith this structure, the project stays manageable and maintainable, despite those 81 files. Let's be honest, though: it's probably going to keep growing. 😅\n\n## 👨‍💻 Data Models\n\n![MongDB Models](https://github.com/user-attachments/assets/a2f430c3-3d5a-491d-9fc9-b833a555cbc1)\n\nAIBook is powered by **MongoDB** storage, with each model carefully structured to keep the app humming along smoothly. Here's a closer look at the data models and how they connect:\n\n- **User** 🧑‍💼: Stores user credentials, profiles, and role information. This model ensures each user enjoys secure, authenticated access.\n- **Book** 📚: Contains details like title, type, topics, and handy timestamps for creation and updates, essentially, everything about a book except the content itself!\n- **Chapter** 📖: Houses the content for each chapter, stored in both markdown and HTML formats for flexibility.\n- **Conversation** 💬: Logs chats between users and the Gemini AI, so each interaction has a place in history.\n- **Message** 📝: Tracks individual messages within each conversation, capturing the ebb and flow of the AI interaction.\n- **Subscription** 💳: Manages subscription plans, payment methods, and active status, essentially the gatekeeper for access levels and perks.\n\n\u003e [!NOTE]\n\u003e MongoDB allows us to embed entire documents within another document, bypassing the need for an `ID` relationship (though it does add one more DB call if we want to fetch the data separately). For now, we're not hitting any performance bottlenecks, but this option keeps things flexible as we scale.\n\nEach model is designed to keep data tightly organized, minimize dependencies, and allow for easy scaling. So whether it's a quick query for a single user or a deep dive into chat history, these models keep AIBook streamlined and ready to grow! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensass%2Faibook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensass%2Faibook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensass%2Faibook/lists"}