apollo-universal-starter-kit

apollo-universal-starter-kit

通用JavaScript应用开发的综合解决方案

Apollo Universal Starter Kit是一个模块化的开发框架,用于构建跨平台的JavaScript应用。它整合了Apollo、GraphQL、React、Angular等主流技术,支持Web、移动和服务器端开发。该框架预置了身份验证、国际化、支付等常用模块,可显著提升开发效率。其SEO友好的特性和完善的配置,使其成为通用JavaScript应用开发的理想选择。

Apollo Universal Starter KitGraphQLReact全栈开发模块化架构Github开源项目
<p align="center"><a href="#"><img width="150" src="https://rawgit.com/sysgears/apollo-universal-starter-kit/master/logo.svg"></a></p>

Apollo Universal Starter Kit

Backers on Open Collective Sponsors on Open Collective Join the chat at https://gitter.im/sysgears/apollo-fullstack-starter-kit Build Status code style: prettier Twitter Follow

Use our chat to get help or discuss general topics about Apollo Universal Starter Kit.

Official Website

Visit apollokit.org to learn about Apollo Universal Starter Kit. You can also test a demo application deployed on Render.

Description

Apollo Universal Starter Kit is an SEO-friendly, fully configured, modular starter project for developing Universal JavaScript applications. You can use this kit to create your applications in JavaScript or TypeScript for all major platforms – mobile, web, and server.

Apollo Universal Starter Kit is built with Apollo, GraphQL, React, Angular, React Native, Expo, Knex.js, and Express with support for relational databases such as PostgreSQL, MySQL, and SQLite.

TypeScript is our language of choice and we use it across the entire project. However, you can freely mix vanilla JavaScript (the ES6 and ES7 syntax) and TypeScript when creating your modules.

The starter kit also integrates Twitter Bootstrap, Ant Design, and NativeBase to provide great possibilities for styling for your web and mobile applications.

Table of Contents

Overview

Why Use Apollo Universal Starter Kit

I am a Developer

  • Great productivity thanks to live reload and (partial) hot code reload
  • Fractal modular architecture that's easy to support and extend
  • The possibility to create modules in TypeScript and JavaScript at the same time
  • No need to develop typical features for your applications

I am a Project Manager

  • Your application will work faster thanks to GraphQL
  • Your team will be able to reuse the code for all the platforms
  • Your team can create client, server, and mobile JavaScript applications
  • Your application will be easier to support and evolve thanks to the fractal modular architecture
  • Your application will be based on a widely-used JavaScript ecosystem (it's easy to find JS developers)
  • Your team can develop new features straightaway instead of creating the basic features
  • Your application will be integrated with Stripe, one of the top payment processors

Concept

Developing client-server-mobile projects in JavaScript never was a trivial task. Not only do you have to spend time installing the application dependencies and configuring them, but you're also constrained to implement many basic functionalities over and over again. And you never have time to develop a starter codebase that you can reuse across all of your projects.

To relieve you from the burden of configuring the project, developing the application structure, and implementing typical features, we created Apollo Universal Starter Kit.

Apollo Universal Starter Kit provides you with a client-server-mobile application that you can employ as a foundation for developing new web or mobile projects using popular tools from the JavaScript ecosystem. But our starter kit does so much more than just creating a mix of popular JS technologies — it's powered by a few custom libraries and solutions to simplify managing project configurations, creating new modules, building GraphQL queries, and perform many other tasks.

The starter kit also consists of many modules that you can augment and adapt to develop your specific application. Also, you can use those prebuilt modules as a reference when implementing basic features for your applications even if you create them using other technologies.

Architecture and Implemented Modules

Among all the approaches to building the application architecture, we opt for the disposable fractal-based modular architecture. Thanks to it, it's possible to remove any built-in module from Apollo Universal Starter Kit without breaking the application. We recommend that you develop your custom modules with the same idea in mind when using our starter kit.

Apollo Universal Starter Kit comes with the following modules:

  • Authentication. Authentication via social networks (Facebook, GitHub, LinkedIn, and Google using OAuth) and password-based authentication; refreshing a forgotten password
  • Authorization. Permission-based authorization with various user roles
  • Contact Us Form. Functionality to send messages to the server
  • Internationalization. A complete internationalization solution for the client and server
  • Mobile Chat. A live chat based on the React Native Gifted Chat and powered by GraphQL subscriptions
  • Pagination. Navigation between pages and presentation of entities
  • Payments. Functionality for recurring payments based on Stripe
  • Posts and Comments. Functionality to add, delete, and update posts and comments
  • State Management. The application state stored in the database and on the client using different approaches
  • 404 Not Found Page. A minimalistic module for handling 404 requests

If you don't want to use the pre-built modules in your project, you can remove them using a [dedicated CLI]. For module names, see the names of directories under modules.

To learn more about the features and modules available in Apollo Universal Starter Kit, follow to the dedicated section [Features and Modules].

Demo

Here's a demo of Apollo Universal Starter Kit in action:

screencast

You can try out the latest version of Apollo Universal Starter Kit deployed on Render. If you want to see the mobile React Native application in action, check out this demo on Expo.io.

Branches

BranchDescription
stableThe latest stable version of the kit (recommended)
masterThe kit version with the latest features. May not work consistently
singleA single-package Apollo v2 version of the kit
[apollo1]The Apollo v1 version of the kit
[cli-crud]This kit version features a CLI to generate CRUD implementations

First Run of Apollo Universal Starter Kit

Verify if you use Node.js 6.x or higher (Node.js ^10 is recommended) before running the starter kit.

  1. Clone the stable branch of Apollo Universal Starter Kit.
git clone -b stable https://github.com/sysgears/apollo-universal-starter-kit.git
cd apollo-universal-starter-kit

NOTE: The master branch is not recommended for development. Use it at your own risk.

NOTE: If you're going to use Windows to develop with Apollo Universal Starter Kit, you need to additionally enable symlinks before you run the project.

For Windows 10:

  • Press Win + I to open Settings
  • Click Update & Security
  • Click the For Developers tab
  • In the Use developer features window, switch to Developer Mode

NOTE: You can remove the unnecessary stacks from Apollo Universal Starter Kit by using the CLI. Consult a [respective CLI section]. Alternatively, you can use the capabilities of your operating system. For example, by running the command below, you can remove all Scala server files:

find . -name server-scala | xargs rm -rf

If you don't need the ready-made modules, you can also remove them using the [custom CLI].

  1. Install the dependencies. Make sure that you use Yarn 1.0.0 or higher.
yarn

You can use NPM instead of Yarn to handle the starter kit dependencies and to run scripts. Throughout the Apollo Universal Starter Kit documentation, we'll always use Yarn.

  1. Seed sample data to the database. The command below will create new tables with sample data in SQLite:
yarn seed

SQLite is a typical default relational database installed in most Linux distributions including Mac OS X; otherwise, consult [SQLite installation guide].

  1. Run the starter kit in development mode:
yarn watch

The server application will be running on [http://localhost:3000], while the client application will be running on [http://localhost:8080]. The terminal will tell your the exact ports.

For more information about running this starter kit for mobile development or Docker, consult the [Getting Started] guide.

Project Structure

The project structure presents generally accepted guidelines and patterns for building scalable web and mobile applications.

The structure is fractal meaning the available functionality is grouped primarily by feature rather than by file type. But the current structure isn't prescriptive, and you can change it however you like.

apollo-universal-starter-kit
├── config                      # Various application configurations
├── docs                        # Documentation
├── node_modules                # Global Node.js modules
├── modules                     # All the prebuilt project modules
├── packages                    # Available packages
│   ├── client                  # React client
│   ├── client-angular          # Angular client
│   ├── client-vue              # Vue client
│   ├── common                  # Common code
│   ├── mobile                  # React Native mobile client
│   ├── server                  # Node.js and Express server
│   └── server-scala            # Scala server
└── tools                       # All build and CLI-related files

Inside modules, you'll find all the prebuilt modules that Apollo Universal Starter Kit comes with. Each module under modules contains sub-directories with module implementations for different technologies. For example, if you look up the module modules/core, you'll see the following sub-modules:

apollo-universal-starter-kit
├── modules                       # Available packages
│   ├── core                      # The core module
│       ├── client-angular        # Core functionality for Angular app
│       ├── client-react          # Core functionality for React app
│       ├── client-react-native   # Core functionality for React Native app
│       ├── client-vue            # Core functionality for Vue app
│       ├── common                # React Native mobile client
│       ├── server-scala          # Core functionality for Scala server
│       └── server-ts             # Core functionality for Express server
└── tools                         # All build and CLI-related files

Apollo Universal Starter Kit Documentation

Follow to the documentation concerning different aspects of how to run, configure, and develop with Apollo Universal Starter Kit.

  • [Getting Started]
    • [Installing and Running Apollo Universal Starter Kit]
    • [Running the Mobile App with Expo]
    • [Running the Starter Kit in a Mobile Simulator]
  • [Running Apollo Universal Starter Kit with Docker]
  • [Deploying Apollo Universal Starter Kit to Production]
  • [Configuring Apollo Universal Starter Kit]
  • [Features and Modules]
  • [Writing Code]
  • [Debugging Code]
  • [Available Scripts]
  • [Frequently Asked Questions]
  • [Project Structure]
  • [Importing Modules]

Tools

  • [Apollo Universal Starter Kit CLI]

Modules

  • [Stripe Payments]
  • [Mobile Chat]

Support

Community Support

  • [Gitter channel] – ask questions, find answers, and participate in general discussions
  • [GitHub issues] – submit issues and send feature requests
  • [Wiki] – read documentation for the usage scenarios of the starter kit; edit the documentation
  • [FAQ] – consult the Frequently Asked Questions section

Commercial Support

The [SysGears] team provides comprehensive support for commercial partners. Our team can guide you when you're using Apollo Universal Starter Kit to build your application.

You can contact us via [Skype] or email info@sysgears.com.

Contributors

Thanks a lot to all the wonderful people who contributed to Apollo Universal Starter Kit!

<a href="https://github.com/sysgears/apollo-universal-starter-kit/graphs/contributors"> <img src="https://opencollective.com/apollo-universal-starter-kit/contributors.svg?width=890" /> </a>

Backers

Thanks a lot to all our backers!

<a href="https://opencollective.com/apollo-universal-starter-kit#backers" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/backers.svg?width=890"></a>

Sponsors

You can support this project by becoming a sponsor! Your logo will show up here with a link to your website.

<a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/0/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/0/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/1/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/1/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/2/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/2/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/3/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/3/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/4/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/4/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/5/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/5/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/6/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/6/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/7/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/7/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/8/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/8/avatar.svg"></a> <a href="https://opencollective.com/apollo-universal-starter-kit/sponsor/9/website" target="_blank"><img src="https://opencollective.com/apollo-universal-starter-kit/sponsor/9/avatar.svg"></a>

License

Copyright © 2016-2019 [SysGears (Cyprus) Limited]. This source code is licensed under the MIT license.

[apollo1]:

编辑推荐精选

蛙蛙写作

蛙蛙写作

AI小说写作助手,一站式润色、改写、扩写

蛙蛙写作—国内先进的AI写作平台,涵盖小说、学术、社交媒体等多场景。提供续写、改写、润色等功能,助力创作者高效优化写作流程。界面简洁,功能全面,适合各类写作者提升内容品质和工作效率。

AI辅助写作AI工具蛙蛙写作AI写作工具学术助手办公助手营销助手AI助手
Trae

Trae

字节跳动发布的AI编程神器IDE

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

AI工具TraeAI IDE协作生产力转型热门
问小白

问小白

全能AI智能助手,随时解答生活与工作的多样问题

问小白,由元石科技研发的AI智能助手,快速准确地解答各种生活和工作问题,包括但不限于搜索、规划和社交互动,帮助用户在日常生活中提高效率,轻松管理个人事务。

热门AI助手AI对话AI工具聊天机器人
Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞智文

讯飞智文

一键生成PPT和Word,让学习生活更轻松

讯飞智文是一个利用 AI 技术的项目,能够帮助用户生成 PPT 以及各类文档。无论是商业领域的市场分析报告、年度目标制定,还是学生群体的职业生涯规划、实习避坑指南,亦或是活动策划、旅游攻略等内容,它都能提供支持,帮助用户精准表达,轻松呈现各种信息。

AI办公办公工具AI工具讯飞智文AI在线生成PPTAI撰写助手多语种文档生成AI自动配图热门
讯飞星火

讯飞星火

深度推理能力全新升级,全面对标OpenAI o1

科大讯飞的星火大模型,支持语言理解、知识问答和文本创作等多功能,适用于多种文件和业务场景,提升办公和日常生活的效率。讯飞星火是一个提供丰富智能服务的平台,涵盖科技资讯、图像创作、写作辅助、编程解答、科研文献解读等功能,能为不同需求的用户提供便捷高效的帮助,助力用户轻松获取信息、解决问题,满足多样化使用场景。

热门AI开发模型训练AI工具讯飞星火大模型智能问答内容创作多语种支持智慧生活
Spark-TTS

Spark-TTS

一种基于大语言模型的高效单流解耦语音令牌文本到语音合成模型

Spark-TTS 是一个基于 PyTorch 的开源文本到语音合成项目,由多个知名机构联合参与。该项目提供了高效的 LLM(大语言模型)驱动的语音合成方案,支持语音克隆和语音创建功能,可通过命令行界面(CLI)和 Web UI 两种方式使用。用户可以根据需求调整语音的性别、音高、速度等参数,生成高质量的语音。该项目适用于多种场景,如有声读物制作、智能语音助手开发等。

咔片PPT

咔片PPT

AI助力,做PPT更简单!

咔片是一款轻量化在线演示设计工具,借助 AI 技术,实现从内容生成到智能设计的一站式 PPT 制作服务。支持多种文档格式导入生成 PPT,提供海量模板、智能美化、素材替换等功能,适用于销售、教师、学生等各类人群,能高效制作出高品质 PPT,满足不同场景演示需求。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

热门AI辅助写作AI工具讯飞绘文内容运营AI创作个性化文章多平台分发AI助手
材料星

材料星

专业的AI公文写作平台,公文写作神器

AI 材料星,专业的 AI 公文写作辅助平台,为体制内工作人员提供高效的公文写作解决方案。拥有海量公文文库、9 大核心 AI 功能,支持 30 + 文稿类型生成,助力快速完成领导讲话、工作总结、述职报告等材料,提升办公效率,是体制打工人的得力写作神器。

下拉加载更多