Code Monkey home page Code Monkey logo

prisma-test's Introduction

SaaS

Deploy with Vercel

Generic Prisma schema example for a SaaS that has a referral system.

Database diagram

(Generated via https://github.com/notiz-dev/prisma-dbml-generator + https://dbdiagram.io)

Setting this project up locally

Once you clone your repo, you'll want to set up this repo for local development. In order to start using Prisma locally, you need to make Prisma aware of your database. The most portable way to do this is to use environment variables via a .env file.

  1. You'll see that your Prisma Schema file (at prisma/schema.prisma) is already configured to use an environment variable called DATABASE_URL. Read more about environment variables in Prisma
  2. You'll need a database to connect to. You may use the same one you used while setting this project up on the Prisma Data Platform, but we recommend setting up a local database and use that during development. If you're new to databases, we recommend reading up on them. This guide also has instructions on how to set up a local database.
  3. Once you have a locally accessible database connection string, create a new file called .env in the prisma directory, and populate it with: DATABASE_URL="<replace-me-with-your-connection-string>". Prisma will automatically pick up the environment variable used in the schema and use its value to connect to your database.
  4. Now you can run npm run init to set up your local database. This will create tables corresponding to models in your Prisma Schema and populate them with fake data for you to play around with.

To learn more about Prisma, we recommend reading through our Getting Started guide

prisma-test's People

Contributors

lutif avatar

Watchers

 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.