Skip to content
/ prisma Public
forked from prisma/prisma1

⚡️ Prisma turns your database into a realtime GraphQL API

License

Notifications You must be signed in to change notification settings

aafa/prisma

 
 

Repository files navigation

WebsiteDocsBlogForumSlackTwitter

CircleCI Slack Status npm version

Prisma - turn your database into a GraphQL API. Prisma lets you design your data model and have a production ready GraphQL API online in minutes.

The Prisma GraphQL API provides powerful abstractions and building blocks to develop flexible, scalable GraphQL backends:

  1. Type-safe API that can be used from frontend and backend, including filters, aggregations and transactions.
  2. Data modeling with declarative SDL. Prisma migrates your underlying database automatically.
  3. Realtime API using GraphQL Subscriptions.
  4. Advanced API composition using GraphQL Bindings and schema stitching.
  5. Works with all frontend frameworks like React, Vue.js, Angular (Quickstart Examples).

Contents

Quickstart

Watch this 4 min tutorial or follow the steps below to get started with Prisma:

  1. Install the CLI via NPM:
npm install -g prisma
  1. Create a new service:

The following command creates all files you need for a new service.

prisma init
  1. Define your data model:

Edit datamodel.graphql to define your data model using the GraphQL SDL notation.

type Tweet {
  id: ID! @unique
  createdAt: DateTime!
  text: String!
  owner: User!
  location: Location!
}

type User {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  handle: String! @unique
  name: String
  tweets: [Tweet!]!
}

type Location {
  latitude: Float!
  longitude: Float!
}
  1. Deploy your service:

To deploy your service simply run the following command and select one of the hosted development clusters or setup a local Docker-based development environment:

prisma deploy
  1. Connect to your GraphQL endpoint:

Use the endpoint from the previous step in your frontend (or backend) applications to connect to your GraphQL API.

  1. Read more in the dedicated quickstarts for your favorite technology

Examples

Architecture

Prisma is a secure API layer that sits in front of your database. Acting as a proxy, Prisma exposes a powerful GraphQL API and manages Rate-Limiting, Authentication, Logging and a host of other features. Because Prisma is a standalone process, it can be scaled independently from your application layer and provide scalable subscriptions infrastructure.

Database Connectors

Database connectors provide the link between Prisma and the underlying database.

You can connect the following databases to Prisma already:

  • MySQL
  • Postgres

More database connectors will follow.

Upcoming Connectors

If you are interested to participate in the preview for one of the following connectors, please reach out in our Slack.

Further Connectors

We are still collecting use cases and feedback for the API design and feature set of the following connectors:

Join the discussion or contribute to influence which we'll work on next!

GraphQL API

The most important component in Prisma is the GraphQL API:

  • Query, mutate & stream data via GraphQL CRUD API
  • Define and evolve your data model using GraphQL SDL

Try the online demo: open GraphQL Playground

Community

Prisma has a community of thousands of amazing developers and contributors. Welcome, please join us! 👋

Contributing

Contributions are welcome and extremely helpful 🙌 Please refer to the contribution guide for more information.

Releases are separated into two channels - the stable and unstable channel.

  • The stable channel is released every two weeks, incrementing the minor version number. Irregular releases in between minor releases can occur and increment the patch version.

  • The unstable channel is released with every commit to master and therefore gives access to features and bug fixes before the stable release. You can find more information about running the Prisma on the unstable channel here.

About

⚡️ Prisma turns your database into a realtime GraphQL API

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 81.6%
  • TypeScript 17.5%
  • Other 0.9%