{"id":29458913,"url":"https://github.com/enaium/jimmer-example-bookstore","last_synced_at":"2025-07-20T07:02:08.504Z","repository":{"id":304512143,"uuid":"1018980400","full_name":"Enaium/jimmer-example-bookstore","owner":"Enaium","description":"A modern, full-stack bookstore application built with Spring Boot, Jimmer ORM, and Vue.js. This project demonstrates a complete e-commerce solution with user authentication, book management, social features, and a responsive web interface.","archived":false,"fork":false,"pushed_at":"2025-07-13T14:39:54.000Z","size":187,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-13T16:23:58.390Z","etag":null,"topics":["bookstore","demo","example","fullstack","jimmer","jsx","jwt","naive-ui","springboot","springsecurity","tsx","vue"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Enaium.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":"2025-07-13T13:33:40.000Z","updated_at":"2025-07-13T15:35:51.000Z","dependencies_parsed_at":"2025-07-13T16:24:03.061Z","dependency_job_id":"730df2df-0566-477c-b9a6-b394dc05f529","html_url":"https://github.com/Enaium/jimmer-example-bookstore","commit_stats":null,"previous_names":["enaium/jimmer-example-bookstore"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Enaium/jimmer-example-bookstore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enaium%2Fjimmer-example-bookstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enaium%2Fjimmer-example-bookstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enaium%2Fjimmer-example-bookstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enaium%2Fjimmer-example-bookstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Enaium","download_url":"https://codeload.github.com/Enaium/jimmer-example-bookstore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Enaium%2Fjimmer-example-bookstore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265224177,"owners_count":23730348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bookstore","demo","example","fullstack","jimmer","jsx","jwt","naive-ui","springboot","springsecurity","tsx","vue"],"created_at":"2025-07-14T00:10:01.387Z","updated_at":"2025-07-14T00:10:02.517Z","avatar_url":"https://github.com/Enaium.png","language":"TypeScript","readme":"# Jimmer Example Bookstore\n\n[![Java](https://img.shields.io/badge/Java-21+-ED8B00?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)](https://openjdk.org/)\n[![Kotlin](https://img.shields.io/badge/Kotlin-2.0+-7F52FF?style=for-the-badge\u0026logo=kotlin\u0026logoColor=white)](https://kotlinlang.org/)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?style=for-the-badge\u0026logo=typescript\u0026logoColor=white)](https://www.typescriptlang.org/)\n[![Vue.js](https://img.shields.io/badge/Vue.js-3.0+-4FC08D?style=for-the-badge\u0026logo=vue.js\u0026logoColor=white)](https://vuejs.org/)\n[![Spring Boot](https://img.shields.io/badge/Spring_Boot-3.0+-6DB33F?style=for-the-badge\u0026logo=spring-boot\u0026logoColor=white)](https://spring.io/projects/spring-boot)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-12+-336791?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n\n[English](README.md) | [中文](README.zh-CN.md)\n\nA modern, full-stack bookstore application built with Spring Boot, Jimmer ORM, and Vue.js. This project demonstrates a complete e-commerce solution with user authentication, book management, social features, and a responsive web interface.\n\n## 🚀 Features\n\n### Core Functionality\n- **Book Management**: Browse, search, and manage books with detailed information\n- **Author System**: Comprehensive author profiles and book-author relationships\n- **Publisher/Issuer Management**: Track book publishers and their catalogs\n- **User Authentication**: Secure JWT-based authentication system\n- **User Profiles**: Personal profiles with contact information\n\n### Social Features\n- **Comments \u0026 Reviews**: Multi-level comment system for books, authors, and publishers\n- **Voting System**: Like/dislike functionality for various content types\n- **Favorites**: Save and organize favorite books, authors, and publishers\n- **Tagging System**: Categorize books with custom tags\n\n### Content Management\n- **Image Upload**: Support for book covers and comment images\n- **Announcements**: System-wide announcements and notifications\n- **Moderation**: Role-based access control (User/Moderator)\n\n### User Experience\n- **Responsive Design**: Modern UI built with Naive UI components\n- **Real-time Updates**: TanStack Query for efficient data fetching\n- **Type Safety**: Full TypeScript support with generated API types\n- **Modern Styling**: WindiCSS utility classes for consistent design\n\n## 🛠 Tech Stack\n\n### Backend\n- **Spring Boot 3.x**: Core application framework\n- **Jimmer ORM**: Type-safe SQL with Kotlin DSL\n- **PostgreSQL**: Primary database\n- **Spring Security**: Authentication and authorization\n- **JWT**: Token-based authentication\n- **Kotlin**: Primary programming language\n\n## 🔧 Jimmer ORM\n\n**Jimmer** is a revolutionary ORM (Object-Relational Mapping) framework that brings type-safe SQL to Kotlin and Java applications. This project showcases Jimmer's powerful features:\n\n### Key Features\n\n- **Type-Safe SQL**: Write SQL queries with full compile-time type checking\n- **Kotlin DSL**: Natural Kotlin syntax for building complex queries\n- **Auto-Generated Types**: Automatic TypeScript client generation for frontend integration\n- **Spring Boot Integration**: Seamless integration with Spring Boot applications\n- **Database Agnostic**: Support for PostgreSQL, MySQL, Oracle, and more\n\n### Jimmer in This Project\n\nThe bookstore application leverages Jimmer's capabilities:\n\n```kotlin\n// Example: Type-safe query with Jimmer\nval books = sqlClient\n    .createQuery(Book::class) {\n        where(table.price gt 50.0)\n        orderBy(table.name.asc())\n        select(table)\n    }\n    .execute()\n```\n\n### Code Generation\n\nJimmer automatically generates:\n- **TypeScript Types**: Full type definitions for frontend consumption\n- **API Clients**: Type-safe HTTP client code\n- **OpenAPI Documentation**: Interactive API documentation\n\n### Benefits\n\n- **Developer Experience**: IntelliSense support and compile-time error detection\n- **Performance**: Optimized SQL generation and execution\n- **Maintainability**: Type-safe queries reduce runtime errors\n- **Productivity**: Auto-generated code reduces boilerplate\n\n### 🛠️ JimmerBuddy IntelliJ Plugin\n\nTo further enhance the Jimmer development experience, we strongly recommend installing the **JimmerBuddy** IntelliJ plugin\n\n### Frontend\n- **Vue 3**: Progressive JavaScript framework\n- **TypeScript**: Type-safe development\n- **Naive UI**: Component library\n- **TanStack Query**: Data fetching and caching\n- **Vue Router**: Client-side routing\n- **Pinia**: State management\n- **WindiCSS**: Utility-first CSS framework\n- **Vite**: Build tool and dev server\n\n### Development Tools\n- **Gradle**: Build system for backend\n- **Vite**: Frontend build tool\n- **Prettier**: Code formatting\n- **TypeScript**: Static type checking\n\n## 📋 Prerequisites\n\nBefore running this project, ensure you have:\n\n- **Java 21+**: For Spring Boot backend\n- **Node.js 18+**: For Vue.js frontend\n- **PostgreSQL 12+**: Database server\n- **Git**: Version control\n\n## 🚀 Quick Start\n\n### 1. Clone the Repository\n\n```bash\ngit clone \u003crepository-url\u003e\ncd jimmer-example-bookstore\n```\n\n### 2. Database Setup\n\n1. **Install PostgreSQL** and create a database:\n```sql\nCREATE DATABASE postgres;\nCREATE SCHEMA bookstore;\n```\n\n2. **Run the DDL script** to create tables:\n```bash\npsql -d postgres -f api/src/main/resources/ddl.sql\n```\n\n### 3. Backend Setup\n\n1. **Navigate to the API directory**:\n```bash\ncd api\n```\n\n2. **Configure database connection** in `src/main/resources/application.properties`:\n```properties\nspring.datasource.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=bookstore\nspring.datasource.username=your_username\nspring.datasource.password=your_password\n```\n\n3. **Run the Spring Boot application**:\n```bash\n./gradlew bootRun\n```\n\nThe backend will start on `http://localhost:8080`\n\n### 4. Frontend Setup\n\n1. **Navigate to the web directory**:\n```bash\ncd web\n```\n\n2. **Install dependencies**:\n```bash\nbun install\n```\n\n3. **Start the development server**:\n```bash\nbun run dev\n```\n\nThe frontend will start on `http://localhost:5173`\n\n## 📁 Project Structure\n\n```\njimmer-example-bookstore/\n├── api/                          # Backend Spring Boot application\n│   ├── src/main/kotlin/\n│   │   └── cn/enaium/bookstore/\n│   │       ├── controller/       # REST API controllers\n│   │       ├── service/          # Business logic services\n│   │       ├── model/           # Entity models and DTOs\n│   │       ├── config/          # Configuration classes\n│   │       ├── error/           # Custom error handling\n│   │       └── utility/         # Utility classes\n│   └── src/main/resources/\n│       ├── application.properties\n│       └── ddl.sql             # Database schema\n├── web/                         # Frontend Vue.js application\n│   ├── src/\n│   │   ├── view/               # Page components\n│   │   ├── layout/             # Layout components\n│   │   ├── common/             # Shared components\n│   │   ├── composables/        # Vue composables\n│   │   ├── store/              # Pinia stores\n│   │   └── router/             # Vue Router configuration\n│   └── src/__generated/        # Auto-generated API types\n└── README.md\n```\n\n## 🔧 Configuration\n\n### Backend Configuration\n\nKey configuration options in `api/src/main/resources/application.properties`:\n\n```properties\n# Database\nspring.datasource.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=bookstore\nspring.datasource.username=root\nspring.datasource.password=root\n\n# JWT\njwt.secret=your-secret-key\njwt.expiration=86400000\n\n# Jimmer ORM\njimmer.show-sql=true\njimmer.pretty-sql=true\njimmer.client.ts.mutable=true\n\n# File uploads\nbookstore.image.dir=images\n```\n\n### Frontend Configuration\n\nThe frontend automatically connects to the backend API. Update the API base URL in `web/src/common/Api.ts` if needed.\n\n## 🎯 API Documentation\n\nJimmer automatically generates comprehensive API documentation and client code. Once the backend is running, you can access:\n\n- **OpenAPI Documentation**: `http://localhost:8080/docs/openapi.html` - Interactive API explorer\n- **TypeScript Client**: `http://localhost:8080/docs/ts.zip` - Download auto-generated TypeScript types\n- **OpenAPI Spec**: `http://localhost:8080/docs/openapi.yml` - Raw OpenAPI specification\n\n### Generated Code\n\nThe `web/src/__generated/` directory contains all the auto-generated code from Jimmer:\n- **API Services**: Type-safe HTTP client methods\n- **Type Definitions**: Complete TypeScript interfaces\n- **Error Handling**: Typed error responses\n- **Request/Response Models**: Full type safety for API communication\n\n## 🧪 Development\n\n### Backend Development\n\n```bash\ncd api\n./gradlew bootRun          # Run server\n./gradlew test            # Run tests\n./gradlew build           # Build JAR\n```\n\n### Frontend Development\n\n```bash\ncd web\nbun run dev              # Start dev server\nbun run build            # Build for production\n```\n\n### Code Generation\n\nThe project uses Jimmer's code generation for TypeScript types:\n\n```bash\ncd web\n./scripts/generate.ps1         # Generate API types\n```\n\n## 🗄 Database Schema\n\nThe application uses a comprehensive database schema with the following main entities:\n\n- **Books**: Core product information with editions and pricing\n- **Authors**: Author profiles with gender and name information\n- **Issuers**: Publisher/publishing company information\n- **Accounts**: User authentication and profiles\n- **Comments**: Multi-level comment system\n- **Votes**: Like/dislike functionality\n- **Favourites**: User favourite system\n- **Tags**: Categorization system\n- **Images**: File management for book covers and comments\n\n## 🔐 Authentication\n\nThe application uses JWT-based authentication with two user roles:\n\n- **USER**: Standard user with basic permissions\n- **MODERATOR**: Administrative user with additional privileges\n\n## 🎨 UI Components\n\nThe frontend uses a consistent design system with:\n\n- **Naive UI**: Professional component library\n- **WindiCSS**: Utility-first styling\n- **Vue Icons**: Fluent icon set\n\n## 📦 Deployment\n\n### Backend Deployment\n\n1. Build the JAR file:\n```bash\ncd api\n./gradlew build\n```\n\n2. Run the application:\n```bash\njava -jar build/libs/jimmer-example-bookstore-0.0.1-SNAPSHOT.jar\n```\n\n### Frontend Deployment\n\n1. Build the production bundle:\n```bash\ncd web\nbun run build\n```\n\n2. Deploy the `dist` folder to your web server\n\n## Screenshots\n\n![20250713220825](https://s2.loli.net/2025/07/13/DnrzjmMKiJhTSZU.png)\n![20250713221142](https://s2.loli.net/2025/07/13/Le528iUjMcCNOPT.png)\n![20250713221201](https://s2.loli.net/2025/07/13/naKlgdQHcU4rv8R.png)\n![20250713221342](https://s2.loli.net/2025/07/13/iVShsOqcmPxAZdy.png)\n![20250713221835](https://s2.loli.net/2025/07/13/dpXNHIhU3xVeS91.png)\n![20250713221411](https://s2.loli.net/2025/07/13/PfjXEo2Ihb5VsYt.png)\n![20250713221435](https://s2.loli.net/2025/07/13/Bge4fpz5q19DiJj.png)\n![20250713221504](https://s2.loli.net/2025/07/13/1Dwb5YXfnAaLFzP.png)\n![20250713222043](https://s2.loli.net/2025/07/13/l3bN91SrmCMqo7I.png)\n![20250713222337](https://s2.loli.net/2025/07/13/eBUHbDSjLhmMYvd.png)\n![20250713223549](https://s2.loli.net/2025/07/13/zJkxWgA2pNBLmsy.png)\n![20250713223727](https://s2.loli.net/2025/07/13/DdN32c9b1mYICHX.png)\n![20250713223809](https://s2.loli.net/2025/07/13/YTgDIdMKki2UJoE.png)\n![20250713223832](https://s2.loli.net/2025/07/13/rmgVKXWOwaSs8Qq.png)\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- **Jimmer ORM**: For type-safe SQL with Kotlin\n- **Spring Boot**: For robust backend framework\n- **Vue.js**: For progressive frontend framework\n- **Naive UI**: For beautiful UI components\n\n---\n\n**Happy coding! 📚✨**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenaium%2Fjimmer-example-bookstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenaium%2Fjimmer-example-bookstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenaium%2Fjimmer-example-bookstore/lists"}