Git Product home page Git Product logo

prisma-nexus-products's Introduction

Prisma Nexus Products API

๐Ÿ‘‹ Welcome!

This repo contains a GraphQL API build with Nexus backed by a SQLite database modeled and accessed using Prisma.

Download and Install

Clone the repository and install dependencies:

npm install

Run the Migrations

There is a file called schema.prisma found in the prisma directory. This is the definition for the database model. To create the tables for the database, we need to run migrations.

Start by saving a new migration.

npx prisma migrate save --experimental

Then run the migartion to create the tables.

npx prisma migrate up --experimental

Then generate the Prisma types for the data model.

npx prisma generate

Run the App

The API is built using Nexus with TypeScript and uses ts-node-dev for development. There is a script in package.json that runs the app in development mode.

npm run dev

The Database

This repo uses SQLite, a file-system database that is great for development and proof-of-concept work but is not well-suited to production. The data that we create and read here is found in the file called dev.db in the prisma directory. You are free to use a different database such as MySQL or Postgres if you like. To do so, adjust the datasource configuration in the schema.prisma file.

License

MIT

prisma-nexus-products's People

Contributors

chenkie avatar

Watchers

 avatar  avatar  avatar

Forkers

payne

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.