Skip to content

spopp20/MusicProgram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MusicProgram

A full-stack application for tracking music events and song and associated song lists. It will track the sheet music for each of the songs in an event for each of the participating instruments.

It uses pal.js and an Apollo GraphQL server and a Prisma2 generated client. Queries and mutations are generated using Nexus.

Current State

Added a "yarn seed-dev" command to seed a dev database with sample data

The GraphQL API Server compiles and runs and proides an Admin interface to view the GraphQL schema and run queries. The GraphQL Playground runs GraphQL Queries and displays data.

Setup

Create an empty mysql database schema Copy the "env.example" file (which is publicly viewable) into a .env file that you create. Your ".env" file must never become publicly viewable since it will contain your actual database connection string. Your .env file should never be checked into a code repository like GitHub

Code Setup

One time setup of yarn

One time install of node packages

npm install --global yarn

One time install of node packages

yarn install

Database

Create an empty mysql database and give a user permissions to connect and operate on that database.

I am using mysql as db provider in schema.prisma.

Prisma2 Create DB Schema

After any update to your schema.prisma file you will need to update your database schema by running:

yarn db-dev

This commands will save your schema changes into your database in a process called a migration. You will be prompted to enter a name for that migration step. The migration name should reflect the idea behind your schema.prisma file change.

Build and Run

yarn generate
yarn dev
  • build prisma client
  • build crud system
  • start dev server

Good work

Seed your dev database

Add mockup data using the data data in seed.tse

yarn seed-dev

Run a GraphQL Query in Playgound

Open http://localhost:4000/ to view the GraphQL Playground

Enter this query

query UserList {

  findManyUser {
    id
    name
    email
    createdAt
    updatedAt
  }
}

Click the center run button. If you have run yarn seed-dev you will have that that is displayed to the right of the run button.

Open Prisma Studio

For a closer look at your data run Prisma

yarn studio

Before you can re-seed your database; delete your old data in Prisma Studio or in any database client.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published