All Projects → subzerocloud → Subzero Starter Kit

subzerocloud / Subzero Starter Kit

Licence: mit
Starter Kit and tooling for authoring GraphQL/REST API backends with subZero

Projects that are alternatives of or similar to Subzero Starter Kit

Postgrest Starter Kit
Starter Kit and tooling for authoring REST API backends with PostgREST
Stars: ✭ 657 (+383.09%)
Mutual labels:  api, rest, openresty, automatic-api, plpgsql, postgresql, starter-kit, boilerplate
Graphql Starter
💥 Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, Relay, and Material UI.
Stars: ✭ 3,377 (+2383.09%)
Mutual labels:  api, graphql, postgresql, starter-kit, boilerplate
Go Restful Api
An idiomatic Go REST API starter kit (boilerplate) following SOLID principles and Clean Architecture
Stars: ✭ 1,043 (+666.91%)
Mutual labels:  api, rest, starter-kit, boilerplate
Wertik Js
💪 A library that powers your app with GraphQL + Rest API
Stars: ✭ 56 (-58.82%)
Mutual labels:  api, graphql, starter-kit, boilerplate
Express Graphql Typescript Boilerplate
A starter kit for building amazing GraphQL API's with TypeScript and express by @w3tecch
Stars: ✭ 163 (+19.85%)
Mutual labels:  api, graphql, starter-kit, boilerplate
Niklick
Rails Versioned API solution template for hipsters! (Ruby, Ruby on Rails, REST API, GraphQL, Docker, RSpec, Devise, Postgress DB)
Stars: ✭ 39 (-71.32%)
Mutual labels:  graphql, postgresql, starter-kit, boilerplate
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+7963.97%)
Mutual labels:  api, graphql, automatic-api, postgresql
Cookiecutter Django Rest
Build best practiced apis fast with Python3
Stars: ✭ 1,108 (+714.71%)
Mutual labels:  api, rest, boilerplate
Gorsk
🔥 Idiomatic Golang Restful Starter Kit
Stars: ✭ 1,108 (+714.71%)
Mutual labels:  rest, starter-kit, boilerplate
Dreamfactory
DreamFactory API Management Platform
Stars: ✭ 1,148 (+744.12%)
Mutual labels:  api, rest, automatic-api
Meteor Apollo Starter Kit
Meteor, Apollo, React, PWA, Styled-Components boilerplate
Stars: ✭ 91 (-33.09%)
Mutual labels:  graphql, starter-kit, boilerplate
K2
Koa2 API template with passport, GraphQL, flowtype, knex and more.
Stars: ✭ 44 (-67.65%)
Mutual labels:  graphql, postgresql, starter-kit
Laravel Api Boilerplate Jwt
A Laravel 5.8 API Boilerplate to create a ready-to-use REST API in seconds.
Stars: ✭ 1,155 (+749.26%)
Mutual labels:  api, rest, boilerplate
Serverless Postgraphql
Serverless GraphQL endpoint for PostgresSQL using AWS, serverless and PostGraphQL
Stars: ✭ 105 (-22.79%)
Mutual labels:  graphql, plpgsql, postgresql
Fullstack Apollo Express Postgresql Boilerplate
💥 A sophisticated GraphQL with Apollo, Express and PostgreSQL boilerplate project.
Stars: ✭ 1,079 (+693.38%)
Mutual labels:  postgresql, starter-kit, boilerplate
Directus
Open-Source Data Platform 🐰 — Directus wraps any SQL database with a real-time GraphQL+REST API and an intuitive app for non-technical users.
Stars: ✭ 13,190 (+9598.53%)
Mutual labels:  api, graphql, postgresql
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+829.41%)
Mutual labels:  graphql, automatic-api, postgresql
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-18.38%)
Mutual labels:  api, graphql, postgresql
Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-20.59%)
Mutual labels:  api, graphql, rest
Automatic Api
A list of software that turns your database into a REST/GraphQL API
Stars: ✭ 1,583 (+1063.97%)
Mutual labels:  graphql, rest, automatic-api

subZero GraphQL/REST API Starter Kit

Base project and tooling for authoring data API backends with subZero.

Runs Anywhere

Run subZero stack as a hassle-free service (free plan available) or deploy it yourself anywhere using binary and docker distributions.

Features

✓ Out of the box GraphQL/REST endpoints created by reflection over a PostgreSQL schema
✓ Authentication using email/password or using 3rd party OAuth 2.0 providers (google/facebook/github preconfigured)
✓ Uses PostgREST+ with features like aggregate functions (group by), window functions, SSL, HTTP2, custom relations
✓ Cross-platform development on macOS, Windows or Linux inside Docker
PostgreSQL database schema boilerplate with authentication and authorization flow
✓ Debugging and live code reloading (sql/configs/lua) functionality using subzero-cli
✓ Full migration management (migration files are automatically created) through subzero-cli
✓ SQL unit test using pgTAP
✓ Integration tests with SuperTest / Mocha
✓ Community support on Slack

✓ Scriptable proxy level caching using nginx proxy_cache or Redis

Directory Layout

.
├── db                        # Database schema source files and tests
│   └── src                   # Schema definition
│       ├── api               # Api entities available as REST and GraphQL endpoints
│       ├── data              # Definition of source tables that hold the data
│       ├── libs              # A collection of modules used throughout the code
│       ├── authorization     # Application level roles and their privileges
│       ├── sample_data       # A few sample rows
│       └── init.sql          # Schema definition entry point
├── html                      # Place your static frontend files here
├── tests                     # Tests for all the components
│   ├── db                    # pgTap tests for the db
│   ├── graphql               # GraphQL interface tests
│   └── rest                  # REST interface tests
├── docker-compose.yml        # Defines Docker services, networks and volumes
└── .env                      # Project configurations

Installation

Prerequisites

Create a New Project

Click [Use this template] (green) button. Choose the name of your new repository, description and public/private state then click [Create repository from template] button. Check out the step by step guide if you encounter any problems.

After this, clone the newly created repository to your computer. In the root folder of application, run the docker-compose command

docker-compose up -d

The API server will become available at the following endpoints:

Try a simple request

curl http://localhost:8080/rest/todos?select=id,todo

Try a GraphQL query in the integrated GraphiQL IDE

{
  todos{
    id
    todo
  }
}

Development workflow and debugging

Execute subzero dashboard in the root of your project.
After this step you can view the logs of all the stack components (SQL queries will also be logged) and if you edit a sql/conf file in your project, the changes will immediately be applied.

Unit and integration tests

The starter kit comes with a testing infrastructure setup. You can write pgTAP tests that run directly in your database, useful for testing the logic that resides in your database (user privileges, Row Level Security, stored procedures). Integration tests are written in JavaScript.

Here is how you run them locally

yarn install         # Install test dependencies
yarn test            # Run all tests (db, rest, graphql)
yarn test_db         # Run pgTAP tests
yarn test_rest       # Run rest integration tests
yarn test_graphql    # Run graphql integration tests

All the test are also executed on on git push (on GitHub)

Deployment

The deployment is done using a GitHub Actions script. The deploy action will push your migrations to the production database using sqitch and the static files with scp. The deploy step is triggered only on git tags in the form of v1.2

Note that the deploy action pushes to production the database migrations (db/migrations/) not the current database schema definition (db/src/) so you'll need execute subzero migrations init --with-roles before the first deploy and when iterating, you'll create new migrations using subzero migration add <migration_name>

You'll also need to configure the following "secrets" for your github deploy action

PRODUCTION_DB_MASTER_USER
PRODUCTION_DB_MASTER_PASSWORD
PRODUCTION_DB_HOST
PRODUCTION_DB_PORT
PRODUCTION_DB_NAME
SFTP_USER
SFTP_PASSWORD
SUBZERO_PASSWORD
SUBZERO_EMAIL
SUBZERO_PASSWORD
SUBZERO_APPLICATION_ID

While the deploy action is written for subzero.cloud (DEPLOY_TARGET: subzerocloud) it can easily be adapted for other deploy targets that run the subzero stack

Contributing

Anyone and everyone is welcome to contribute.

Support and Documentation

License

Copyright © 2017-2021 subZero Cloud, LLC.
This source code in this repository is licensed under MIT license
Components implementing the GraphQL interface (customized PostgREST+ and OpenResty docker images) are available under a commercial license
The documentation to the project is licensed under the CC BY-SA 4.0 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].