Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More β†’
Socket
Sign inDemoInstall
Socket

create-apollo-app

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-apollo-app - npm Package Compare versions

Comparing version 0.0.34 to 0.0.35

LICENSE

16

package.json
{
"name": "create-apollo-app",
"version": "0.0.34",
"version": "0.0.35",
"description": "Apollo GraphQL apps creator",

@@ -19,6 +19,6 @@ "author": "Victor Vlasenko <victor.vlasenko@sysgears.com>",

"clean": "rm -rf ./lib",
"build": "tsc -p tsconfig.build.json",
"watch": "tsc -p tsconfig.build.json -w",
"lint": "tslint -p tsconfig.json --fix -c ../../tslint.json",
"tests": "jest",
"build": "tsc",
"watch": "tsc -w",
"lint": "tslint -p tsconfig.json --fix -c tslint.json",
"tests": "jest --passWithNoTests",
"test": "yarn tests && yarn lint",

@@ -39,7 +39,9 @@ "prepublishOnly": "yarn clean && yarn build"

"@types/node": "^7.0.18",
"jest": "^24.5.0",
"prettier": "^1.6.1",
"ts-jest": "^24.0.0",
"tslint": "^5.10.0",
"tslint-config-prettier": "^1.5.0",
"tslint-plugin-prettier": "^1.3.0",
"typescript": "^2.8.3"
"typescript": "^3.3.3"
},

@@ -53,3 +55,3 @@ "prettier": {

"transform": {
".(ts|tsx)": "<rootDir>/../../node_modules/ts-jest/preprocessor.js"
".(ts|tsx)": "ts-jest"
},

@@ -56,0 +58,0 @@ "testRegex": "(/__tests__/.*\\.(test|spec))\\.(ts|tsx|js)$",

@@ -1,2 +0,2 @@

## Create Apollo App
# Create Apollo App

@@ -6,8 +6,92 @@ [![npm version](https://badge.fury.io/js/create-apollo-app.svg)](https://badge.fury.io/js/create-apollo-app)

Create GraphQL apps quickly.
## Description
## Usage
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](https://developer.apple.com/xcode/) (optional; an IDE for iOS development)
* [Android Studio](https://developer.android.com/studio/) (optional; an IDE for Android development)
Installing [Expo Client](https://expo.io/tools#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):
```bash
npx create-apollo-app new-apollo-app
```
If you’re using Yarn, run:
```bash
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](https://yarnpkg.com/blog/2017/05/12/introducing-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:
```bash
yarn create apollo-app my-app@web
```
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](#apollo-project-templates) 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:
```bash
cd my-app

@@ -17,3 +101,91 @@ 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.
The client-side application will be automatically opened in your default browser at [http://localhost:3000](http://localhost:3000).
The server-side GraphQL application runs on [http://localhost:8080](http://localhost:8080).
If you installed a template for mobile development, the React Native app will be opened at [http://localhost:3020](http://localhost:3020)
for iOS and at [http://localhost:3010](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:
```bash
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 &ndash; `@web` &ndash; 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` &ndash; (default) a complete solution for building a client-server app.
* `@server-mobile` &ndash; a complete solution for building a server-side app and mobile front end.
* `@universal` &ndash; 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.

@@ -20,0 +192,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc