This Document is for Skeet v1.

Basic Architecture - GraphQL

Skeet Framework can be assembled with a combination of SQL and NoSQL.

Here we describe the basic structure for building a GraphQL backend.

The basic structure of the Skeet Framework GraphQL backend is as follows.

Common Backend Required FeaturesSkeet Framework GraphQL
DatabasesGoogle Cloud SQL
Login AuthenticationFirebase Authentication
APIGraphQL on Google Cloud Run
Load BalancerCloud Load Balancer
Schedule TasksCloud Scheduler
Pub/SubCloud Pub/Sub
DomainsCloud DNS
SecurityCloud Armor

Basic Structure of Skeet Framework

src contains the front-end source code.

Cloud Functions for Firebase projects are placed under the functions directory.

You can add multiple functions to functions.

GraphQL API source code is placed under the graphql directory.

bash
├── src │ ├── public │ └── types ├── graphql │ ├── prisma │ └── src ├── functions │ └── skeet ├── package.json ├── skeet-cloud.config.json └── firebase.json
DirectoryDescription
srcFrontend source code
src/publicFrontend source code
src/typesFrontend type definitions
graphq/prismaPrisma source code
graphq/srcGraphQL source code
functionsCloud Functions for Firebase source code
functions/skeetfunctions related to the OpenAI API etc
package.jsonBackend package management
skeet-cloud.config.jsonSkeet Framework configuration file
firebase.jsonFirebase configuration file

Basic Structure of Skeet GraphQL

Skeet GraphQL uses the following packages.

The Cloud Functions for Firebase project is placed under the graphql directory.

e.g.: graphql

bash
. ├── Dockerfile ├── build.ts ├── devBuild.ts ├── dist │ ├── index.js │ ├── nexus-typegen.ts │ └── schema.graphql ├── env.sample ├── jest.config.js ├── nodemon.json ├── package.json ├── prisma │ ├── migrations │ ├── schema.prisma │ └── seed.ts ├── src │ ├── graphql │ ├── index.ts │ ├── lib │ └── schema ├── tests │ ├── graphql │ └── jest.setup.ts ├── tsconfig.json └── yarn.lock
DirectoryDescription
build.tsbuild script
devBuild.tsbuild script
distsource code after build
nodemon.jsonLocal launch settings
package.jsonBackend package management
srcsource code
src/index.tsentry point
src/libLibraries
src/graphqlGraphQL files
src/schemaGraphQL Schema/Permission Settings
src/scriptsscripts
prismaPrisma file
prisma/migrationsPrisma migration file
prisma/schema.prismaPrisma schema file
prisma/seed.tsPrisma seed file
tsconfig.jsonTypeScript settings
yarn.lockPackage lock file

Skeet GraphQL File Structure

The GraphQL API source code is placed under the ./src directory.

bash
./src ├── graphql │ ├── authManager │ ├── enums.ts │ ├── index.ts │ ├── modelManager │ ├── responseManager │ └── taskManager ├── index.ts ├── lib │ ├── firebaseConfig.ts │ └── getLoginUser.ts └── schema ├── Node.ts ├── index.ts ├── nexus-typegen.ts ├── permissions.ts ├── schema.graphql └── schema.ts

Skeet GraphQL Manager

Under the ./src/graphql directory is a manager that manages GraphQL queries.

bash
├── authManager │ ├── index.ts │ └── me.ts ├── enums.ts ├── index.ts ├── modelManager │ ├── ChatRoom │ ├── ChatRoomMessage │ ├── User │ ├── UserChatRoom │ ├── enums.ts │ └── index.ts ├── responseManager │ └── index.ts └── taskManager ├── index.ts └── postTweet.ts
manager typedescription
authManagerManage mutations/queries related to authentication.
modelManagerCRUD related to the model is automatically generated in this directory.
responseManagerManages mutations/queries on Workers.
taskManagerManage mutations/queries on Tasks.
enums.tsManage Enums.

Basic Structure of Skeet DB Schema

Under the ./src/schema directory are files that manage GraphQL schemas.

bash
./src/schema ├── Node.ts ├── index.ts ├── nexus-typegen.ts ├── schema.graphql ├── permissions.ts └── schema.ts
file namedescription
Node.tsManages the Node interface.
nexus-typegen.tsFile automatically generated by Nexus.
schema.graphqlFile automatically generated by Nexus.
permissions.tsThis file manages permissions using GraphQL Shield.
schema.tsA file that manages the GraphQL schema.

Skeet CLI

Add new Cloud Functions for Firebase with Skeet CLI, You can run a yarn command for each function.

Command list

bash
$ skeet --help Usage: skeet [options] [command] CLI for Skeet - Full-stack TypeScript Serverless framework Options: -V, --version output the version number -h, --help display help for command Commands: create <appName> Create Skeet Framework App server|s Run Skeet App deploy Deploy Skeet APP to Firebase init [options] Initialize Google Cloud Setups for Skeet APP yarn [options] <yarnCmd> Skeet Yarn Comannd to run yarn command for multiple functions login [options] Skeet Login Command - Create Firebase Login Token curl [options] <methodName> Skeet Curl Command - Call Firebase Functions Endpoint post [options] <queryType> Skeet Post Command - Call Skeet GraphQL Endpoint g|generate Skeet Generate Comannd docker Docker commands db Database commands iam Skeet IAM Comannd to setup Google Cloud Platform add Skeet Add Comannd to add new functions sync Skeet Sync Comannd to sync backend and frontend delete|d Skeet Delete Command list Get Skeet App List help [command] display help for command