All Projects → sysgears → Create Apollo App

sysgears / Create Apollo App

Licence: mit
Create Apollo App is a command-line tool designed to generate fully-configured starter Apollo GraphQL projects with essential dependencies for developing web, server and mobile applications and zero build configuration.

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects
es6
455 projects

Projects that are alternatives of or similar to Create Apollo App

Kit
ReactQL starter kit (use the CLI)
Stars: ✭ 232 (+110.91%)
Mutual labels:  graphql, apollo, sass, less
Reactql
Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
Stars: ✭ 1,833 (+1566.36%)
Mutual labels:  graphql, apollo, sass, less
Meteor Apollo Starter Kit
Meteor, Apollo, React, PWA, Styled-Components boilerplate
Stars: ✭ 91 (-17.27%)
Mutual labels:  graphql, apollo
Angular Fullstack Graphql
🚀 Starter projects for fullstack applications based on Angular & GraphQL.
Stars: ✭ 92 (-16.36%)
Mutual labels:  graphql, apollo
React Fullstack Graphql
Starter projects for fullstack applications based on React & GraphQL.
Stars: ✭ 1,352 (+1129.09%)
Mutual labels:  graphql, apollo
Apollo
Meteor & Apollo integration
Stars: ✭ 87 (-20.91%)
Mutual labels:  graphql, apollo
Quell
Quell is an easy-to-use, lightweight JavaScript library providing a client- and server-side caching solution for GraphQL. Use Quell to prevent redundant client-side API requests and to minimize costly server-side response latency.
Stars: ✭ 90 (-18.18%)
Mutual labels:  graphql, apollo
Booben
Web app constructor based on React, with GraphQL bindings
Stars: ✭ 96 (-12.73%)
Mutual labels:  graphql, apollo
Vertical Rhythm
Put some typographical vertical rhythm in your CSS. LESS, Stylus and SCSS/SASS versions included.
Stars: ✭ 83 (-24.55%)
Mutual labels:  sass, less
Apollo Link
🔗 Interface for fetching and modifying control flow of GraphQL requests
Stars: ✭ 1,434 (+1203.64%)
Mutual labels:  graphql, apollo
Guide
📖 The GraphQL Guide website
Stars: ✭ 104 (-5.45%)
Mutual labels:  graphql, apollo
Thorium
Platform for starship simulator controls
Stars: ✭ 109 (-0.91%)
Mutual labels:  graphql, apollo
React Dashboard
🔥React Dashboard - isomorphic admin dashboard template (React.js, Bootstrap, Node.js, GraphQL, React Router, Babel, Webpack, Browsersync) 🔥
Stars: ✭ 1,268 (+1052.73%)
Mutual labels:  graphql, sass
Boilerplate Vue Apollo Graphql Mongodb
Start your magical stack journey!
Stars: ✭ 85 (-22.73%)
Mutual labels:  graphql, apollo
Puzzle Tokens
Batch create, manage and update Sketch styles and symbols using SCSS/LESS
Stars: ✭ 90 (-18.18%)
Mutual labels:  sass, less
Graphql Transform Schema
Transform, filter & alias resolvers of a GraphQL schema
Stars: ✭ 84 (-23.64%)
Mutual labels:  graphql, apollo
Generator Ngx Rocket
🚀 Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+1108.18%)
Mutual labels:  mobile, sass
Meteor Integration
🚀 meteor add apollo
Stars: ✭ 107 (-2.73%)
Mutual labels:  graphql, apollo
Apollo Prophecy
🔮 GraphQL error management made Easy, generate custom machine-readable errors for Apollo Client/Server from the CLI
Stars: ✭ 83 (-24.55%)
Mutual labels:  graphql, apollo
Apollo Scalajs
Use Apollo GraphQL from Scala.js apps!
Stars: ✭ 83 (-24.55%)
Mutual labels:  graphql, apollo

Create Apollo App

Join the chat at https://gitter.im/sysgears/create-apollo-app npm version Twitter Follow

Description

Create Apollo App is a command-line tool that generates a fully configured starter Apollo (GraphQL) project with only essential dependencies. With Create Apollo App, you can start developing a client, server, or mobile app, or a universal application in no time.

The projects generated with Create Apollo App are built of familiar technologies from the JavaScript ecosystem: TypeScript, Webpack, React, Express, and React Native. Depending on the type of the project you want to develop, the mentioned technologies are used in different combinations to provide particular setups for server, client, or mobile development.

Create Apollo App relieves you from the pain of installing and configuring an Apollo project while making it easy to change project configurations if necessary.

Generating a Project with Create Apollo App

Prerequisites

Install the following dependencies:

  • Node.js 6.x or higher (Node.js 8.x is recommended)
  • NPM or Yarn to manage JavaScript packages and run scripts

Besides the dependencies for Node.js, you may also need to install and set up additional tools for mobile development:

  • iOS Simulator or Android emulation software
  • Xcode (optional; an IDE for iOS development)
  • Android Studio (optional; an IDE for Android development)

Installing Expo Client is also optional. If you set up iOS Simulator or a similar tool, Create Apollo App will automatically download Expo Client if it's not installed.

Generating a Project

Start a new project with Create Apollo App using the following command (the default NPM utility is used):

npx create-apollo-app new-apollo-app

If you’re using Yarn, run:

yarn create apollo-app my-app

yarn create will automatically prefix apollo-app with create-. For more information, you can consult this blog post on Yarn.

From this point onward, we'll use Yarn in our examples for running the project.

During installation, the terminal will prompt the following six options:

❯ @server-web: TypeScript, Apollo (GraphQL), Express server, React for web
  @server-mobile: TypeScript, Apollo (GraphQL), Express server, React Native for mobile
  @universal: TypeScript, Apollo (GraphQL), Express server, React for web, React Native for mobile
  @server: TypeScript, Apollo (GraphQL), Express server
  @web: TypeScript, Apollo (GraphQL), React web app
  @mobile: TypeScript, Apollo (GraphQL), React Native for mobile

You can select the necessary project template using the arrow keys on your keyboard. Alternatively, you can start typing the name of the template to filter the list.

You can also specify the name of the template by attaching the @name_of_the_template after the project name, for example:

yarn create apollo-app [email protected]

If you run the command above, Create Apollo App will create a my-app/ project directory with the @web template meaning the client-side Apollo app. Similarly, add @server-web, @universal, or other template name instead of @web to choose a particular template.

Consult the Apollo Project Templates section to know what templates are currently available.

Select the first (default) option @server-web from the list and press Enter. Create Apollo App will generate a client-server application.

Note that it may take a while (usually up to a minute) for all dependencies to be installed and for the project to be configured. The terminal will confirm when the project is ready.

Running the Project in Development Mode

Once the installation is complete, run:

cd my-app
yarn start

A development build will be generated. You can start changing the source code in the project files located in the packages/server/src/ and packages/web/src/ directories.

NOTE: If you want to add CSS, SCSS, Sass, or Less to the frontend React application, you need to add the PostCSS configuration file postcss.config.js under the {app-root}/src for the @web template or the {app-root}/packages/web/src folder for the @server-web and @universal templates.

The PostCSS configuration file can be empty, like this:

module.exports = {};

The client-side application will be automatically opened in your default browser at http://localhost:3000. The server-side GraphQL application runs on http://localhost:8080.

If you installed a template for mobile development, the React Native app will be opened at http://localhost:3020 for iOS and at http://localhost:3010 for Android.

Generating the Production-Ready Code

If you want to build a production version of the app (i.e., the code will be minified), run:

yarn build

The production-ready code will be saved to packages/server/build/ and packages/web/build/ directories for server-side and client-side code respectively.

Apollo Project Templates

Create Apollo App provides you with the default configurations for different kinds of projects. For example, if you need to build only a client-side application, you can select a respective template – @web – during installation.

Overall, you can choose one of the six templates:

  • @web for a client-side application.
  • @server for a server-side application.
  • @mobile for a mobile application.
  • @server-web – (default) a complete solution for building a client-server app.
  • @server-mobile – a complete solution for building a server-side app and mobile front end.
  • @universal – the most comprehensive solution for building an app for the client, server, and mobile.

Project Structure

We'll review the structure of the @universal project, meaning it will have the client/, server/, and mobile/ packages under the packages/ directory. The @server-web template that you installed comes without the mobile package.

Here's an overview of the @universal project structure:

my-apollo-app
├── node_modules/
├── packages/
    ├── mobile
        ├── node_modules/
        ├── src/
            ├── App.tsx
            ├── AwakeInDevApp.js
            └── index.ts
        ├── typings/
        ├── app.json
        ├── package.json
        ├── tsconfig.json
        └── tslint.json        
    ├── server/
        ├── node_modules/
        ├── src/
            ├── index.ts
            ├── resolvers.ts
            ├── schema.graphql
            ├── schema.ts
            └── server.ts
        ├── typings/
        ├── package.json
        ├── tsconfig.json
        └── tslint.json
    └── web/
        ├── src/
            ├── App.tsx
            └── index.tsx
        ├── typings/
        ├── package.json
        ├── tsconfig.json
        └── tslint.json
├── .gitignore
├── package.json
├── tsconfig.json
├── tslint.json
└── yarn.lock

You'll work with the files located in packages/mobile/src/, packages/server/src, and packages/web/src/ when working on your Apollo project. In those directories, you can view the default project files, which you may freely change or delete.

License

Copyright © 2018 SysGears Limited. This source code is licensed under the MIT license.

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].