• This repository has been archived on 05/Apr/2023
  • Stars
    star
    216
  • Rank 183,179 (Top 4 %)
  • Language
    Python
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

mongoke

Instantly serve your MongoDb database via graphql

Docs β€’ Examples

Features

  • Powerful Queries: Pagination, filtering, relation, relay-style connections built-in and generated in a bunch of seconds
  • Works with existing databases: Point it to an existing MongoDb database to instantly get a ready-to-use GraphQL API
  • Authorization via Jwt: Every collection can be protected based on jwt payload and document fields
  • Horizontally Scalable: The service is completely stateless and can be replicated on demand
  • Apollo Federation: The service can be easily glued with other graphql servers to handle writes and more complicated logic.
  • Resilient Idempotent Configuration: One YAML Configuration as the only source of truth, relations, authorization and types in one file

Quickstart:

Using Docker compose

The fastest way to try Mongoke is via docker-compose.

1. Write the configuration to describe the database schema and relations

The ObjectId scalar is already defined by default, it is converted to string when sent as json

# ./mongoke.yml
schema: |
    type User {
        _id: ObjectId
        username: String
        email: String
    }
    type BlogPost {
        _id: ObjectId
        author_id: ObjectId
        title: String
        content: String
    }

types:
    User:
        collection: users
    BlogPost:
        collection: posts

relations:
    - field: posts
      from: User
      to: BlogPost
      relation_type: to_many
      where:
          author_id: ${{ parent['_id'] }}

2. Run the mongoke image with the above configuration

To start the container mount copy paste the following content in a docker-compose.yml file, then execute docker-compose up.

# docker-compose.yml
version: '3'

services:
    mongoke:
        ports:
            - 4000:80
        image: mongoke/mongoke
        environment:
            DB_URL: mongodb://mongo/db
        volumes:
            - ./mongoke.yml:/conf.yml
    mongo:
        image: mongo

3. Query the generated service via graphql or go to http://localhost:4000/graphiql to open graphiql

{
    User(where: { username: { eq: "Mike" } }) {
        _id
        username
        email
        posts {
            nodes {
                title
            }
        }
    }

    BlogPostNodes(first: 10, after: "Post 1", cursorField: title) {
        nodes {
            title
            content
        }
        pageInfo {
            endCursor
            hasNextPage
        }
    }
}

Tutorials

Check out the /examples directory in this repo

Please help the project making new tutorials and submit a issue to list it here!

More Repositories

1

genql

Type safe TypeScript client for any GraphQL API
TypeScript
616
star
2

dokz

Effortless documentation with Next.js and MDX
TypeScript
461
star
3

vitro

Build and showcase your react components in isolation
TypeScript
397
star
4

esbuild-plugins

Collection of useful esbuild js plugins
JavaScript
244
star
5

bundless

Dev server and bundler based on esbuild
TypeScript
212
star
6

actions-cli

Monitor your GitHub Actions in real time from the command line
TypeScript
173
star
7

next-superjson

Automatically transform your Next.js Pages to use SuperJSON, without losing swc support
TypeScript
67
star
8

youtube-video-upload

Upload videos starting from a declarative yaml file
Python
36
star
9

bump-version

Action to bump version files
JavaScript
35
star
10

codebase-owners

Get the owners of a file tree using git
TypeScript
35
star
11

apollo-federation-gateway

A docker image to merge graphql servers using Apollo federation
TypeScript
34
star
12

mini-graphiql-playground

Graphiql playground for documentation websites
JavaScript
32
star
13

figma-gpt

TypeScript
32
star
14

compose-watcher

Watch volumes and restart services in docker compose
Python
27
star
15

smart-glob

Glob search in constant time thanks to git cache
TypeScript
25
star
16

split-classnames

Split long className attributes in jsx files
TypeScript
22
star
17

landing-blocks

Landing pages building blocks
TypeScript
20
star
18

profile-next-cold-starts

Next.js cold start profiling for the masses
17
star
19

baby-i-am-faded

Reveal animations using React and Emotion
TypeScript
15
star
20

middleflare

Deploy Next.js middleware to Cloudflare Workers
TypeScript
13
star
21

pypi

Shell
12
star
22

dark-github-theme

VSCode github dark theme
11
star
23

skema

Universal schema language that compiles to many type systems
Python
9
star
24

cloud-run-compose

Generate Google Cloud Run terraform plan from a docker-compose file
Python
8
star
25

es-module-traversal

Traverse the es modules import graph
JavaScript
7
star
26

lemonsqueezy-webhooks

Types and utilities for handling lemon-squeezy webhooks in JavaScript and TypeScript
TypeScript
7
star
27

react-virtualized-fixed-import

6
star
28

catalina-hackintosh

i7-7700k msi Z270 hackintosh
Rich Text Format
5
star
29

instagram-botnet

Use concise yaml files to control your botnet
Python
4
star
30

dashboard-blocks

Modern dashboards building blocks
TypeScript
4
star
31

tsc-shame

Shame your node_modules type checking speed
TypeScript
4
star
32

framer-motion-visualizer

Visualize framer-motion spring animations
TypeScript
4
star
33

cloud-run-node-sdk

Sdk to deploy cloud run services
TypeScript
3
star
34

server-actions-for-pages

Like Next.js server actions but for the pages directory
TypeScript
3
star
35

mongoke-examples

Examples of Mongoke services made using docker compose
JavaScript
3
star
36

smspva

node package to interact with smspva.com API
JavaScript
3
star
37

fixpls

Fix your compiler errors automatically with GPT
TypeScript
3
star
38

lenskit

Product photography with AI
TypeScript
2
star
39

beskar

TypeScript
2
star
40

vite-esbuild-optimizer

Convert your dependencies to ESM bundles using esbuild
TypeScript
2
star
41

python-lib-template

Python
2
star
42

form-blocks

Forms easy to use and compose
TypeScript
2
star
43

layout-kit-react

Components to easy and modern layouts
TypeScript
2
star
44

edit-this-page

TypeScript
2
star
45

bundless-benchmark

JavaScript
2
star
46

setup-typescript-monorepo

setup typescript monorepo tsconfig files and package.json entrypoints
TypeScript
2
star
47

react-extra-hooks

TypeScript
2
star
48

s3-filepond-uploads-container

Container to upload files to s3 when filepond makes a new upload from the frontend
Go
2
star
49

inline-styled

Tailwindcss as react properties
TypeScript
2
star
50

tartiflette-plugin-apollo-federation

Plugin to compose your Tartiflette Graphql service in an Apollo federation
Python
1
star
51

graphql-easy-mocks

Mock server for graphql frontend development
TypeScript
1
star
52

nextjs-website-template

TypeScript
1
star
53

async-graphql

Async graphql client for python
Python
1
star
54

next-13-bug

1
star
55

react-landing-components

Components for creating a landing page
TypeScript
1
star
56

notion-custom-blocks

TypeScript
1
star
57

website-downloader

Download a website and all its js modules
TypeScript
1
star
58

auto-bet

Automate bets
TypeScript
1
star
59

react-graphql-parcel

template
TypeScript
1
star
60

ip-homeworks

qui ci stanno i compiti di IP
1
star
61

generic-repost-routine

Python
1
star
62

react-multi-step

demo: https://react-multi-step.xmorse.now.sh
TypeScript
1
star
63

puppeteer-script

Execute actions through a readable YAML script
TypeScript
1
star
64

lambda-containers

container that wrap lambda functions
Dockerfile
1
star
65

repro-next-verce-base-path

JavaScript
1
star
66

get-git-config

TypeScript
1
star
67

gatsby-landing

Gatsby starter
TypeScript
1
star
68

populate-mongo

Generate fake data to populate mongodb for demos and tutorials
Python
1
star
69

vercel-repro-plus-encoded-as-space

CSS
1
star
70

graphql-go-subscription-example

Go
1
star
71

try-next-getserversideprops-edge

TypeScript
1
star
72

f-redux

Manage global shared state easily via hooks
TypeScript
1
star
73

compound

Deploy docker-compose services as scalable serverless containers
Python
1
star
74

prtty

Dumb pretty function for python
Python
1
star
75

firebase-react-components

TypeScript
1
star
76

react-isomorphic-context

Experimental React context that can be used both on client and server components
TypeScript
1
star
77

repro-edge-basepath-next

CSS
1
star
78

fly-node-api

Type safe client for the Fly.io Graphql API
TypeScript
1
star
79

workers-kv-in-vercel

TypeScript
1
star
80

instagram-botnet-gateway

1
star
81

amv-generator

Create an anime music video based on a music track.
Python
1
star
82

nextjs-template

TypeScript
1
star
83

sanity-nextjs-landing-pages

Next.js landing pages
JavaScript
1
star
84

next-text-decoder-repro

1
star
85

pnpm-store-contains-url-characters

1
star
86

laboratorio-3-asd

C++
1
star
87

is-next-app-ready

1
star
88

nextjs-edge-vercel-stale-while-revalidate-bug

CSS
1
star
89

slashkit-test-suite

Testing the stability of Slashkit: host any website on a subdirectory of your domain.
TypeScript
1
star
90

vite-plugin-nft

TypeScript
1
star
91

modeller

Generate models from json schema
Python
1
star
92

react-graphql

template
TypeScript
1
star
93

workspace-info

Yarn workspace info for yarn v2 and any other similar workspaces implementation
TypeScript
1
star
94

email-forwarder

Verifiy email via instances of chrome
TypeScript
1
star