Giter Site home page Giter Site logo

fuse's Introduction

Turborepo starter

This is an official starter turborepo.

Using this example

Run the following command:

npx create-turbo@latest -e with-prisma

What's inside?

This turborepo includes the following packages/apps:

Apps and Packages

  • web: a Next.js app
  • @repo/eslint-config: eslint configurations (includes eslint-config-next and eslint-config-prettier)
  • @repo/database: Prisma ORM wrapper to manage & access your database
  • @repo/typescript-config: tsconfig.jsons used throughout the monorepo

Each package/app is 100% TypeScript.

Utilities

This turborepo has some additional tools already setup for you:

Database

We use Prisma to manage & access our database. As such you will need a database for this project, either locally or hosted in the cloud.

To make this process easier, we offer a docker-compose.yml file to deploy a MySQL server locally with a new database named turborepo (To change this update the MYSQL_DATABASE environment variable in the docker-compose.yml file):

cd my-turborepo
docker-compose up -d

Once deployed you will need to copy the .env.example file to .env in order for Prisma to have a DATABASE_URL environment variable to access.

cp .env.example .env

If you added a custom database name, or use a cloud based database, you will need to update the DATABASE_URL in your .env accordingly.

Once deployed & up & running, you will need to create & deploy migrations to your database to add the necessary tables. This can be done using Prisma Migrate:

npx prisma migrate dev

If you need to push any existing migrations to the database, you can use either the Prisma db push or the Prisma migrate deploy command(s):

yarn run db:push

# OR

yarn run db:migrate:deploy

There is slight difference between the two commands & Prisma offers a breakdown on which command is best to use.

An optional additional step is to seed some initial or fake data to your database using Prisma's seeding functionality.

To do this update check the seed script located in packages/database/src/seed.ts & add or update any users you wish to seed to the database.

Once edited run the following command to run tell Prisma to run the seed script defined in the Prisma configuration:

yarn run db:seed

For further more information on migrations, seeding & more, we recommend reading through the Prisma Documentation.

Build

To build all apps and packages, run the following command:

yarn run build

Develop

To develop all apps and packages, run the following command:

yarn run dev

Useful Links

Learn more about the power of Turborepo:

fuse's People

Contributors

iowathe3rd 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.