GithubHelp home page GithubHelp logo

isabella232 / relay-starter-kit-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kriasoft/relay-starter-kit

0.0 0.0 0.0 145.22 MB

๐Ÿ’ฅ Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, Material UI.

Home Page: https://graphqlstart.com

License: MIT License

Shell 0.03% JavaScript 21.90% TypeScript 74.34% HTML 0.50% Handlebars 1.33% HCL 1.92%

relay-starter-kit-1's Introduction

GraphQL
GraphQL API and Relay Starter Kit

Features

  • Monorepo project structure powered by Yarn with PnP
  • GraphQL API using code-first development approach (TypeScript, GraphQL.js, Knex, PostgreSQL)
  • Stateless JWT cookie-based authentication (supporting SSR, OAuth 2.0 via Google, Facebook, etc.)
  • Database tooling โ€” seed files, migrations, Knex.js REPL shell, etc.
  • Front-end boilerplate pre-configured with TypeScript, Webpack v5, React, Relay, and Materia UI
  • Serverless deployment โ€” api, img โ†’ Cloud Functions, web โ†’ Cloudflare Workers
  • HTML page rendering (SSR) at CDN edge locations, all ~100 points on Lighthouse
  • Pre-configured dev, test / QA, production, and review (per PR) environments
  • Pre-configured VSCode code snippets and other VSCode settings
  • The ongoing design and development is supported by these wonderful companies:

ย ย ย ย 


This project was bootstrapped with GraphQL API Starter Kit. Be sure to join our Discord channel for assistance.

Directory Structure

โ”œโ”€โ”€.github โ€” GitHub configuration including CI/CD workflows
โ”œโ”€โ”€.vscode โ€” VSCode settings including code snippets, recommended extensions etc.
โ”œโ”€โ”€env โ€” environment variables that are used for local development (local, test, prod)
โ”œโ”€โ”€db โ€” database schema, seeds, and migrations (Cloud SQL, Knex.js)
โ”œโ”€โ”€api โ€” GraphQL API and authentication (Could SQL, Cloud Functions, GraphQL.js)
โ”œโ”€โ”€img โ€” dynamic image resizing (Cloud Functions, [Cloud Storage](https:// cloud.google.com/storage))
โ”œโ”€โ”€infra โ€” cloud infrastructure configuration (Terraform)
โ”œโ”€โ”€web โ€” React / Relay web application with CDN rendering (Webpack, Cloudflare Workers)
โ”œโ”€โ”€scripts โ€” Automation scripts shared across the project
โ””โ”€โ”€ ... โ€” add more packages such as worker, admin, mobile, etc.

Requirements

Getting Started

Just clone the repo and run yarn install followed by yarn start:

$ git clone --origin=seed --branch=main --single-branch \
    https://github.com/kriasoft/relay-starter-kit.git example
$ cd ./example                  # Change current directory to the newly created one
$ yarn install                  # Install project dependencies
$ yarn setup                    # Configure environment variables
$ yarn db:reset                 # Create or update PostgreSQL database
$ yarn api:start                # Launch GraphQL API and authentication server
$ yarn web:start                # Launch React/Relay front-end app

The API server must become available at http://localhost:8080/api.
The web application front-end must become available at http://localhost:3000/.

How to Deploy

Before you can deploy the app, ensure that the target GCP project exists and that all the environment variables (found in /env/*.env files) are up-to-date, for both test (QA) and prod (production) environments.

If you just created a brand new GCP project, you can configure it by running:

$ yarn gcp:setup --env=test
$ yarn gcp:setup --env=prod

OR, by using Terraform (found in /infra), which one is more convenient for you.

Once a new commit or PR lands onto the main (or, release) branch, it's going to be deployed automatically using a GitHub Actions workflow. Alternatively, you can deploy the app manually by running:

# Build and deploy the GraphQL API (GCF)
$ yarn api:build
$ yarn api:deploy --env=prod

# Build and deploy the web front-end to Cloudflare Workers (CDN)
$ yarn web:build
$ yarn web:deploy --env=prod

# Migrate the target database to the latest version
$ yarn db:migrate --env=prod

Where --env=prod is the target (production) deployment environment, using --env=test when not specified.

References

How to Update

In the case when you kept the original Node.js Starter Kit git history, you can always pull and merge updates from the "upstream" repository back into your project by running:

$ git fetch seed                # Fetch Node.js Starter Kit (upstream) repository
$ git checkout main             # Switch to the main branch (or, master branch)
$ git merge seed/main           # Merge upstream/master into the local branch

In order to update Yarn and other dependencies to the latest versions, run:

$ yarn set version latest       # Upgrade Yarn CLI to the latest version
$ yarn upgrade-interactive      # Bump Node.js dependencies using an interactive mode
$ yarn install                  # Install the updated Node.js dependencies
$ yarn dlx @yarnpkg/sdks vscode # Update VSCode settings

Backers

ย ย ย ย ย ย ย ย ย ย ย ย ย ย 

How to Contribute

Anyone and everyone is welcome to contribute. Start by checking out the list of open issues marked help wanted. However, if you decide to get involved, please take a moment to review the guidelines.

License

Copyright ยฉ 2016-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE file.


Made with โ™ฅ by Konstantin Tarkus (@koistya, blog) and contributors.

relay-starter-kit-1's People

Contributors

0xflotus avatar aarmand avatar andrewkslv avatar aron123 avatar b-gran avatar buildbreakdo avatar bwoodlt avatar cmmartin avatar daveyedwards avatar dependabot-preview[bot] avatar dinno avatar domenicocolandrea86 avatar glennreyes avatar kernelsoe avatar koistya avatar kyledetella avatar lifeiscontent avatar maciej-ka avatar psyanite avatar rbadillap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.