All Projects → geekmall → Geekshop

geekmall / Geekshop

Licence: mit
极客商城 ~ 一个面向开发者的、基于Spring+GraphQL+Angular的、无前端(headless)电商框架

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Geekshop

Vendure
A headless GraphQL ecommerce framework for the modern web
Stars: ✭ 2,961 (+5594.23%)
Mutual labels:  graphql, ecommerce, headless
Ever
Ever® - Open-Source Commerce Platform for On-Demand Economy and Digital Marketplaces
Stars: ✭ 980 (+1784.62%)
Mutual labels:  graphql, ecommerce, headless
Saleor
A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React.
Stars: ✭ 14,720 (+28207.69%)
Mutual labels:  graphql, ecommerce, headless
Example Storefront
Example Storefront is Reaction Commerce’s headless ecommerce storefront - Next.js, GraphQL, React. Built using Apollo Client and the commerce-focused React UI components provided in the Storefront Component Library (reactioncommerce/reaction-component-library). It connects with Reaction backend with the GraphQL API.
Stars: ✭ 471 (+805.77%)
Mutual labels:  graphql, ecommerce, headless
Reaction
Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
Stars: ✭ 11,588 (+22184.62%)
Mutual labels:  graphql, ecommerce, headless
Falcon
DEITY Falcon - Progressive Web App library for any type of website. Fully Open Source, Platform Agnostic and headless. OSL3.0. Supports Magento 2 PWA storefront, Wordpress PWA and BigCommerce PWA Storefront. Built with ReactJS, NodeJS and GraphQL. Join our community and become a contributor at https://slack.deity.io
Stars: ✭ 501 (+863.46%)
Mutual labels:  graphql, ecommerce, headless
Navalia
A bullet-proof, fast, and reliable headless browser API
Stars: ✭ 950 (+1726.92%)
Mutual labels:  graphql, headless
Jbone
jbone基于Spring Cloud框架开发,旨在为中小企业提供稳定的微服务解决方案,为开发人员提供基础开发骨架,jbone包含微服务中所有常用组件,例如注册中心、服务管理、服务监控、JVM监控、内存分析、调用链跟踪、API网关等等。业务功能包括系统权限的统一管理、单点登录、CMS、电商平台、工作流平台、支付平台等等。
Stars: ✭ 961 (+1748.08%)
Mutual labels:  spring-boot, spring
Devops Service
DevOps Service is the core service of Choerodon. It integrated several open source tools to automate the DevOps process of planning, coding, building, testing, and deployment, operation, monitoring.
Stars: ✭ 36 (-30.77%)
Mutual labels:  spring-boot, spring
Spring Boot
spring-boot 项目实践总结
Stars: ✭ 989 (+1801.92%)
Mutual labels:  spring-boot, spring
Spring Thrift Api Gateway
Gateway for Apache Thrift requests processing that is built on Spring Cloud stack
Stars: ✭ 38 (-26.92%)
Mutual labels:  spring-boot, spring
Botwall4j
A botwall for Java web applications
Stars: ✭ 41 (-21.15%)
Mutual labels:  spring-boot, spring
Example Kotlin Springboot Graphql
Projeto de exemplo com API GraphQL com dois crud’s simples, utilizando Kotlin, Spring Boot, Gradle etc.
Stars: ✭ 28 (-46.15%)
Mutual labels:  graphql, spring-boot
Ecommerce
A powerful and lightweight eCommerce platform using ReactJs, Graphql, PHP, and Mysql.
Stars: ✭ 28 (-46.15%)
Mutual labels:  graphql, ecommerce
Cms
Statamic 3: The Core Composer Package
Stars: ✭ 965 (+1755.77%)
Mutual labels:  graphql, headless
Spring Mvc Thymeleaf Crud
Spring MVC CRUD Application with Thymeleaf, HTML5, CSS3 and Bootstrap
Stars: ✭ 14 (-73.08%)
Mutual labels:  spring-boot, spring
Spring Reactive Sample
Spring 5 Reactive playground
Stars: ✭ 867 (+1567.31%)
Mutual labels:  spring-boot, spring
Disconf Spring Boot Starter
disconf-spring-boot-starter 让你可以使用spring-boot的方式开发依赖disconf的程序 只需要关心disconfi的配置文件和配置项,省略了编写xml的麻烦
Stars: ✭ 44 (-15.38%)
Mutual labels:  spring-boot, spring
Dynamic Data Source Demo
基于事务的读写分离
Stars: ✭ 43 (-17.31%)
Mutual labels:  spring-boot, spring
Mini Platform
Mini-Platform致力于更简洁易用的轻量级微服务治理平台。
Stars: ✭ 45 (-13.46%)
Mutual labels:  spring-boot, spring

极客商城~GeekShop

一个面向开发者的、基于Spring+GraphQL+Angular的、无前端的(headless)电商框架。

无前端Headless指的是GeekShop框架专注于后端实现,它不关心具体前端界面的实现方式。GeekShop主要是面向开发者的。GeekShop暴露了一组基于GraphQL的电商APIs,通过这些APIs,开发者可以查询(query)数据,例如查询商品数据,或者修改(mutate)数据,例如将商品'123'添加都当前订单中。所以,基于GeekShop开发电商应用的话,开发者需要自己根据业务需要去实现前端的“店面”,例如可以使用诸如Angular/React/Vue等不同的前端展示技术来实现。GeekShop已经实现好了后端,它相当于一个电商中台

Geekshop已经实现了电商的核心功能,但是GeekShop也是可以扩展的,它的代码是开源的(MIT License),开发者可以根据需要进一步定制扩展GeekShop的功能。

注意,该框架主要为教学而开发,目前是Alpha状态,如需生产化,需自行严格测试+定制

电商框架功能亮点

  • 支持产品和变体(Products & Variants)
  • 支持库存管理(Stock management)
  • 支持产品分面和基于分面的搜索(Product facets & faceted search)
  • 支持产品分类/产品集(Product categories / collections)
  • 支持产品搜索(Product Search)
  • 支持支付供应商集成(Payment provider integrations)
  • 支持快递供应商集成(Shipping provider integrations)
  • 支持打折和推广(Discounts and promotions)
  • 支持多种管理员角色和细粒度权限控制(Multiple administrators with fine-grained permissions)
  • 支持基于Angular的管理后台(Built-in admin interface)
  • 支持访客直接结账模式(Guest checkouts)
  • 支持集成多种登录认证方式(Multiple Authentication Methods)

技术栈

  1. 后端开发框架:Spring Boot 2.x
  2. 前端(管理后台)开发框架:Angular 10.x
  3. GraphQL框架:graphql-java-kickstart
  4. 持久层框架:Mybatis-Plus
  5. 异步任务框架:Guava EventBus
  6. 安全框架:自研,基于集中式令牌(token) + AOP
  7. 数据库存储:支持H2(测试)和MySQL(生产)

如何运行

一、如何运行测试

通过maven运行所有单元和集成测试:

mvn clean test

目前已经编写527个测试用例,覆盖大部分框架逻辑,且所有测试全部在本地跑通过。测试时默认使用嵌入式H2数据库。

[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.42 s - in io.geekshop.e2e.StockControlTest
[INFO] Running io.geekshop.common.utils.TimeSpanUtilTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 s - in io.geekshop.common.utils.TimeSpanUtilTest
[INFO] Running io.geekshop.data_import.ImportParserTest
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 s - in io.geekshop.data_import.ImportParserTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 527, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:22 min
[INFO] Finished at: 2021-01-11T18:08:32+08:00
[INFO] ------------------------------------------------------------------------

二、如何运行应用

在Intellij IDE中运行Spring Boot启动类GeekShopApplication,默认使用嵌入式H2数据库。

访问GraphQL Playground:

http://127.0.0.1:8080/playground

关于GraphQL Playground如何使用,不复杂,请自行网上找资料。具体每个API的接口规范,可以参考GraphQL Playground反射出来的Schema文档,或者直接看源码resources/graphql中的schema文档

如果不想用GraphQL Playground,也可以使用最新版本的Postman访问GraphQL端点:

http://127.0.0.1:8080/graphql

具体操作也不复杂,请自行摸索或网上找资料。

待开发功能(TODO List)

  • [ ] [Plan 2021 Q1]支持基于Angular的后台管理(Admin)界面
  • [ ] [Plan 2021 Q1]支持基于Angular的演示用的购物Shopping Web App
  • [ ] [Plan 2021 Q1]支持MySQL数据库。目前暂支持嵌入式H2数据库
  • [ ] [Plan 2021 Q1]支持本地图片访问和图片缩放/剪切
  • [ ] [Plan 2021 Q1]支持事件可DB持久化的异步任务机制,集成killbill common queue。目前仅支持事件不可持久化的Guava EventBus
  • [ ] [Plan 2021 Q1]Docker自动部署脚本
  • [ ] [Plan 2021 Q1]开发者文档
  • [ ] [Plan 2021 Q1]性能测试脚本+性能测试
  • [ ] [Plan 2021 Q2]极客时间课程《Spring + GraphQL电商中台实战》
  • [ ] [Plan 2021 Q3/Q4] 微服务版本+K8s部署+课程
  • [ ] 汉化,目前仅支持英文,需企业自行定制,欢迎pull request。
  • [ ] 支持ElasticSearch产品搜索,需企业自行定制,欢迎pull request。目前仅支持基于DB的简单文本搜索(Like方式)。
  • [ ] 支持图片的云存储和处理,需企业自行定制,欢迎pull request。目前暂支持本地存储和简单图片处理。
  • [ ] 集成微信/支付宝等支付方式,需企业自行定制,欢迎pull request。目前仅支持Mock支付方式。
  • [ ] 集成快递供应商,需企业自行定制,欢迎pull request。目前仅支持Mock快递方式。

源码目录说明

Java源码

├── java
│   └── io
│       └── geekshop
│           ├── GeekShopApplication.java # Spring Boot主应用入口,可直接运行
│           ├── common # 公共类
│           ├── config # Spring配置Beans
│           ├── custom # 安全/GraphQL/Mybatis等定制类
│           ├── data_import # 产品数据导入
│           ├── email # 邮件发送功能
│           ├── entity # 实体层
│           ├── eventbus # 异步事件处理
│           ├── exception # 异常类
│           ├── mapper # MyBatis-Plus Mapper
│           ├── options # 配置项
│           ├── resolver # GraphQL API resolvers(相当于控制器层)
│           ├── service # 服务层
│           └── types # GraphQL类型(相当于DTO)

Resoures源码

└── resources
    ├── application-mysql.yml # 支持mysql数据库的spring配置文件
    ├── application.yml # spring配置文件,默认支持h2数据库
    ├── banner.txt # banner
    ├── db
    │   ├── h2 # h2数据库schema
    │   └── mysql # mysql数据库schema
    ├── graphql
    │   ├── admin-api # 管理端GraphQL API契约
    │   ├── common # 公共类型契约
    │   ├── shop-api # 购物端GraphQL API契约
    │   └── type # 传输对象类型契约
    └── templates
        └── email # 邮件模版

测试Java源码:

├── java
│   └── io
│       └── geekshop
│           ├── ApiClient.java # 测试用GraphQL API client,支持admin和shop模式
│           ├── ApiException.java # API调用异常
│           ├── GeekShopGraphQLTest.java # 集成测试注解(基于SpringBootTest)
│           ├── MockDataService.java # 填充测试用Mock数据的服务
│           ├── PopulateOptions.java # 填充测试用Mock数据的选项
│           ├── common # 对公共类的一些测试
│           ├── config # 测试用Spring配置Beans
│           ├── data_import # 对产品导入功能的测试
│           ├── e2e # 对GraphQL resolvers的端到端测试,对整个电商框架的主要测试代码都在该目录中!
│           ├── event # 测试用事件处理类
│           ├── service # 对服务层助手类的一些测试
│           └── utils # 一些测试用工具类

测试Resources源码:

.
├── application.yml # 测试用Spring应用配置
├── fixtures # 测试用产品Mock数据
├── graphql # 测试用API调用GraphQL文件,说明调用的API和返回哪些字段,主要用于上面测试Java源码的e2e测试。
└── test_fixtures # 用于测试产品数据导入功能的一些Mock数据

感谢

该框架主要参考vendure-ecommerce电商框架(基于TypeScript/Nestjs/Angular),感谢原作者的贡献🙏

Copyright

Copyright © 2020-present GeekShop. All rights reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].