Giter VIP home page Giter VIP logo

vasily-polonsky / cosmo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wundergraph/cosmo

0.0 0.0 0.0 13.8 MB

The open-source solution to building, maintaining, and collaborating on GraphQL Federation at Scale. An alternative to Apollo Studio and GraphOS.

Home Page: https://cosmo-docs.wundergraph.com/

License: Apache License 2.0

Shell 0.14% JavaScript 0.19% Go 10.05% TypeScript 50.22% CSS 0.21% Makefile 0.10% HTML 38.02% Smarty 0.24% FreeMarker 0.68% Dockerfile 0.08% SCSS 0.07%

cosmo's Introduction

WunderGraph Cosmo - The GraphQL federation platform
Reach for the stars, ignite your cosmo!
CLI CI Controlplane CI Studio CI Router CI

WunderGraph Cosmo is the full Lifecycle API Management for (Federated) GraphQL. Schema Registry, composition checks, analytics, metrics, tracing and routing. Deploy 100% on-prem or use our Managed Service. Apache 2.0 licensed, no vendor-lock. The platform consists of the following components:

Core:

  • CLI: The cosmo CLI tool wgc. Used to manage the cosmo platform e.g. pushing schema, check schemas, creating new projects, managing users, etc. It interacts with the control plane.
  • Control Plane: The control plane is the central component of the cosmo platform. It consists of a platform API and a node API. The platform API is used by the cosmo CLI tool and the Studio to manage the platform.
  • Router: The router is the component that understands the GraphQL Federation protocol. It is responsible for routing requests to the correct service and for aggregating the responses. It is in connection with the control plane to register itself for advanced fleet management.
  • Studio: The studio is the web interface for the cosmo platform. It is used to manage the platform and to collaborate on GraphQL Federation. It is in connection with the control plane through the Platform API to manage the platform.

Collectors:

  • OpenTelemetry Collector: The OpenTelemetry Collector is used to collect and export metrics and traces from the platform. It is configured to collect metrics and traces from the router and instrumented subgraphs.
  • GraphQLMetrics Collector: The GraphQLMetrics collector is used to collect and export metrics from the platform that doesn't fit into the OpenTelemetry model. Primarily, it is used to collect operation usage metrics from the router to allow advanced breaking changes analysis of client applications.

Migrate from Apollo GraphOS / Apollo Federation

We've made it super easy for you to migrate from Apollo by using our fully automatic Migration Assistant. Signup to Cosmo Cloud, enter your Graph API Token and Graph variant, and the Assistant migrates over your Graph in just a few seconds. That's it, migrate over with a single click!

Demo Cosmo on your machine in 3 minutes

Prerequisites

Running cosmo is as easy as running a single command. It can take a few seconds (~30s) until all services are up and running. A seed container and few migrations are running in the background to bootstrap the platform. They might restart a few times until the database is ready. Creates a small demo project and starts the router and subgraphs:

  1. Start the platform:
make full-demo-up
  1. Navigate to the Studio Playground and query the router. Login with the default credentials:
Username: [email protected]
Password: wunder@123
  1. If you are done, you can clean up the demo by running make full-demo-down.

Local Development

Prerequisites

Bootstrapping your development environment is easy. Just run the following commands in order:

# 1️⃣ Setup the repository and start all services (Wait a few seconds until Keycloak is ready)
make

# 2️⃣ Run migrations and seed the database
make migrate && make seed

# 3️⃣ Start the control plane
make start-cp

# 4️⃣⃣ Create the demo and copy the JWT printed at the bottom
make create-demo

# 5️⃣ Start the subgraphs
OTEL_AUTH_TOKEN=<jwt-token> make dc-subgraphs-demo

# 6️⃣⃣ Put the JWT from the previous step into the router/.env as GRAPH_API_TOKEN and start the router
make start-router

# ✨ Finally, Start the studio (http://localhost:3000) and explore the Cosmo platform
make start-studio

Navigate to http://localhost:3000/ and login with the default credentials:

Username: [email protected]
Password: wunder@123

Your API key to access the platform is: cosmo_669b576aaadc10ee1ae81d9193425705. Set the following environment variable to use it with the CLI:

export COSMO_API_KEY=cosmo_669b576aaadc10ee1ae81d9193425705
export COSMO_API_URL=http://localhost:3001

cd cli && pnpm wgc -h

All services work with environment variables. You can find the default values in the .env.example file. Please copy it to .env (Except studio which works with .env.local) and adjust the values to your needs.

Clean up all containers and volumes by running make infra-down-v.

Docker Compose

We manage multiple compose files:

  • docker-compose.yml: The default compose file. It contains all services that are required to run the platform for development.
  • docker-compose.full.yml: This compose file contains the full Cosmo platform. It is used for demo and testing.
  • docker-compose.cosmo.yml: This compose file allows to build all cosmo components and manage them in a single compose file. It is used for testing and releasing.

Clean up a compose stack before starting another one!

On-Premise

Cosmo was designed to be deployed on-premise e.g. Kubernetes. We provide a helm chart to deploy the platform on any Kubernetes like AKS, GKE, AKS or Minikube. You can find the helm chart in the helm directory. If you need help with the deployment, please contact us here.

Managed Service

If you don't want to manage the platform yourself, you can use our managed service WunderGraph Cosmo Cloud. It is a fully managed platform that eliminates your worries about infrastructure, allowing you to concentrate on building. This managed service includes a generous free tier of 10 million monthly requests. If you require extended data retention or are subject to strict compliance requirements, please contact us. We offer custom plans for Hybrid SaaS and On-Premises deployments.

License

Cosmo is licensed under the Apache License, Version 2.0.

cosmo's People

Contributors

starptech avatar jivusayrus avatar thisisnithin avatar aenimus avatar fiam avatar pagebakers avatar jensneuse avatar devsergiy avatar clayne11 avatar github-actions[bot] avatar cs-clarence avatar alejandrobelleza avatar wunderhawk avatar matt-potter avatar paulpdaniels avatar seendsouza avatar voslartomas 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.