Prisma1 Template


Caracteristicas

  • Scalable GraphQL server: The server uses graphql-yoga which is based on Apollo Server & Express
  • Static type generation: TypeScript types for GraphQL queries & mutations are generated in a build step
  • Authentication: Signup and login workflows are ready to use for your users
  • GraphQL database: Includes GraphQL database binding to Prisma (running on MongoDB)
  • Tooling: Out-of-the-box support for GraphQL Playground & query performance tracing
  • Extensible: Simple and flexible data model – easy to adjust and extend
  • No configuration overhead: Preconfigured graphql-config setup
  • Realtime updates: Support for GraphQL subscriptions
  • Custom Permissions: Added layer authorization for all methods on GraphQL

Requerimientos

  • NodeJS v10.+
  • Yarn v1.21.+
  • Docker v19.03.13

Instalando

Necesitas instalar todas las siguientes dependencias :

Para mas de detalles de instalación de Prisma1 visita Prisma1 Docs

$ yarn install
#pre
configurar entorno creando archivo .env
# 1. Situarse en el directorio de prisma
$ cd ./project  
# 2. Crear los contenedores necesarios
$ cd  docker-compose up -d
# 3. Realizar el deploy de prisma en el servicio `http://localhost:4466`
$ prisma deploy
# 4. Realizar la primera carga de datos con el archivo `seed.graphql`
$ prisma seed

para mas detalles consulta Aquí

Iniciando el Servicio

# Server start (corre en http://localhost:4000) y abre GraphQL Playground
$ yarn start

Documentation

Commands

  • $ yarn start starts GraphQL server on http://localhost:4000
  • $ prisma <subcommand> gives access to local version of Prisma CLI (e.g. yarn prisma deploy)

Note: We recommend that you're using yarn dev during development as it will give you access to the GraphQL API or your server (defined by the application schema) as well as to the Prisma API directly (defined by the Prisma database schema). If you're starting the server with yarn start, you'll only be able to access the API of the application schema.

Project structure

File name Description
├── .env Define las variables de entorno
├── .graphqlconfig.yml Configuration file based on graphql-config (e.g. used by GraphQL Playground).
└── prisma (directory) Contains all files that are related to the Prisma database service
├── docker-compose.yml Define la creación de servicios con Docker
├── prisma.yml The root configuration file for your Prisma database service (docs)
└── models (directory) Defines your data model (written in GraphQL SDL)
└── src (directory) Contains the source files for your GraphQL server
├── index.ts The entry point for your GraphQL server
├── schema.graphql The application schema defining the API exposed to client applications
├── resolvers (directory) Contains the implementation of the resolvers for the application schema
└── types (directory) Define los tipos previamente creados y enlazados a generated
└── generated (directory) Contains generated files
└── prisma-client (directory) The generated Prisma client

Modelos

Breve descripción de los modelos que componen el template

Model FileName description hasRelations
User user.prisma Usuario que interactua en el sistema

Contributors

Gracias a estas increibles personas (emoji key):

Enrique Aguilar
Enrique Aguilar

💻📖🤔🔌⚠️📓