Skip to content

Commit

Permalink
adjust readme, add travis
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch committed Oct 28, 2018
1 parent d39f10b commit 339f509
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 45 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: node_js

node_js:
- stable

install:
- npm install

script:
- npm test
57 changes: 14 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# fullstack-apollo-react-express-boilerplate-project
# fullstack-apollo-react-boilerplate

[![Slack](https://slack-the-road-to-learn-react.wieruch.com/badge.svg)](https://slack-the-road-to-learn-react.wieruch.com/)
[![Build Status](https://travis-ci.org/the-road-to-graphql/fullstack-apollo-react-boilerplate.svg?branch=master)](https://travis-ci.org/the-road-to-graphql/fullstack-apollo-react-boilerplate) [![Slack](https://slack-the-road-to-learn-react.wieruch.com/badge.svg)](https://slack-the-road-to-learn-react.wieruch.com/)

A full-fledged Apollo Server 2 with Apollo Client 2 starter project with React, Express and PostgreSQL.
A full-fledged Apollo Server 2 with Apollo Client 2 starter project with React and Express. [Read more about it in this tutorial to build it yourself](https://www.robinwieruch.de/graphql-apollo-server-tutorial/).

[GraphQL Server Tutorial](https://www.robinwieruch.de/graphql-apollo-server-tutorial/)
This is the client project which uses React. You can find various working server applications that can be used with this client.

## Features
* [PostgreSQL](https://github.com/the-road-to-graphql/fullstack-apollo-express-postgresql-boilerplate)
* [MongoDB](#)

* React (create-react-app) with Apollo Client 2
## Features of Client + Server

* React (create-react-app) with Apollo Client
* Queries, Mutations, Subscriptions
* Node.js with Express and Apollo Server 2
* Node.js with Express and Apollo Server
* cursor-based Pagination
* PostgreSQL Database with Sequelize
* PostgreSQL Database with Sequelize or MongoDB
* entities: users, messages
* Authentication
* powered by JWT and local storage
Expand All @@ -27,45 +30,13 @@ A full-fledged Apollo Server 2 with Apollo Client 2 starter project with React,

## Installation

* `git clone [email protected]:rwieruch/fullstack-apollo-react-express-boilerplate-project.git`
* `cd fullstack-apollo-react-express-boilerplate-project`

### Client

* `cd client`
* `git clone [email protected]:rthe-road-to-graphql/fullstack-apollo-react-boilerplate.git`
* `cd fullstack-apollo-react-boilerplate`
* `npm install`
* `npm start`
* visit `http://localhost:3000`

### Server

* `cd server`
* `touch .env`
* `npm install`
* fill out *.env file* (see below)
* `npm start`
* optional visit `http://localhost:8000` for GraphQL playground

#### .env file

Since this boilerplate project is using PostgreSQL, you have to install it for your machine and get a database up and running. You find everything for the set up over here: [Setup PostgreSQL with Sequelize in Express Tutorial](https://www.robinwieruch.de/postgres-express-setup-tutorial). After you have created a database and a database user, you can fill out the environment variables in the *server/.env* file.

```
DATABASE=mydatabase
DATABASE_USER=postgres
DATABASE_PASSWORD=postgres
SECRET=asdlplplfwfwefwekwself.2342.dawasdq
```

The `SECRET` is just a random string for your authentication. Keep all these information secure by adding the *.env* file to your *.gitignore* file. No third-party should have access to this information.

#### Testing

* adjust `test-server` npm script with `TEST_DATABASE` environment variable in package.json to match your testing database name
* to match it from package.json: `createdb mytestdatabase` with psql
* one terminal: npm run test-server
* second terminal: npm run test
See Server Installation instructions in the other GitHub repository.

## Want to learn more about React + GraphQL + Apollo?

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "fullstack-apollo-react-boilerplate-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"apollo-cache-inmemory": "^1.2.5",
"apollo-client": "^2.3.5",
Expand All @@ -23,7 +22,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"test": "react-scripts test --env=jsdom --passWithNoTests",
"eject": "react-scripts eject"
}
}

0 comments on commit 339f509

Please sign in to comment.