• Stars
    star
    412
  • Rank 105,018 (Top 3 %)
  • Language
    JavaScript
  • Created over 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A GraphQL project with a backend component written with GraphQL-js and Apollo Server and a frontend component written in React.

GraphQL In Action

A GraphQL project with a backend component written with GraphQL-js and Apollo Server and a frontend component written in React. Branch "main" is the starting point for the GraphQL In Action book. Other branches are used to track the progress of updates throughout the book:

  • Branch "5.0" is the starting point (Chapter 5 in the book). This is an alias for the "main" branch.

  • Branch "9.0" has a working version of the React app before using the GraphQL API. This is the point where the GraphQL API is complete (except for subscriptions, which are implemented in Chapter 10)

  • Branch "10.0" has a worknig version of using a GraphQL client with a React app without a client library (like Apollo).

  • Branch "10.10" (aliased as "final") has the same React app after converting all data communications to use Apollo Client, adding subscriptions operations, and doing the entire local app state management with Apollo.

Install dependencies

npm install

Start databases

You’ll need Docker Compose (which is part of Docker Desktop).

Then run:

npm run start-dbs

This will download and start a PostgreSQL database container on port 5432 and a MongoDB container on port 27017. Both databases have some sample development data loaded in. The connection credentials for these databases are:

PG_CONNECTION_STRING  = "postgres://postgres:password@localhost:5432/azdev"
MDB_CONNECTION_STRING = "mongodb://localhost:27017/azdev"

If you already have a PostgreSQL database that you would like to use instead of the provided Docker containers, you will need to create the database schemas for the project using the dev-db/schema.* files (which will also load the sample data).

Using psql:

psql -d "postgres://postgres:password@localhost:5432" -c "create database azdev"
psql -d "postgres://postgres:password@localhost:5432/azdev" < dev-dbs/schema.sql

Using mongo:

mongo mongodb://127.0.0.1:27017/ < dev-dbs/schema.mongo

Run for dev

In 2 different terminals:

npm run api-server
npm run web-server

Defaults:

More Repositories

1

ngs

Node.js: Getting Started
JavaScript
445
star
2

learn-fullstack-javascript

For help, ask in #questions at jscomplete.com/help
429
star
3

advanced-nodejs

For help, ask in #questions at slack.jscomplete.com
JavaScript
304
star
4

advanced-react

For help, ask in #questions at slack.jscomplete.com http://slack.jscomplete.com/
JavaScript
193
star
5

graphfront

Generate a GraphQL schema for any PostgreSQL database using the database schema information
JavaScript
143
star
6

rgs-star-match

JavaScript
106
star
7

reactful

An opinionated CLI for full-stack server-rendered React applications
JavaScript
105
star
8

react-native-essential-training

JavaScript
86
star
9

rgs-template

JavaScript
85
star
10

graphfront-ui

A multi-user admin interface on database schemas with a GraphQL API - Powering https://graphfront.com/
JavaScript
79
star
11

name-contests

52
star
12

learning-graphql-and-relay

For help, ask in #questions at slack.jscomplete.com
JavaScript
29
star
13

mnr

MNR (MongoDB, Node.js, React.js)
TypeScript
26
star
14

react-blog-example

JavaScript
24
star
15

express-webpack-template

JavaScript
23
star
16

node-bb

JavaScript
17
star
17

react-virtual-dom-demo

React's Virtual DOM demo
16
star
18

learning-reactjs

For help, ask in #questions at slack.jscomplete.com
JavaScript
13
star
19

graphql-makers

Functions to make GraphQL types based on schema-language definitions.
TypeScript
11
star
20

azdev

Code repo for https://az.dev
TypeScript
9
star
21

node-react-template

Server-render ready Node/React template
JavaScript
6
star
22

example-graphql-mongodb-schema

For help, ask in #questions at slack.jscomplete.com
JavaScript
4
star
23

graphql-project

For help, ask in #questions at slack.jscomplete.com
JavaScript
2
star
24

mngr

Learning Fullstack JavaScript Development: MongoDB, Node.js, and React.js
HTML
1
star