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.
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.
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
One time setup of yarn
One time install of node packages
npm install --global yarn
One time install of node packages
yarn install
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
.
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.
yarn generate
yarn dev
- build prisma client
- build crud system
- start dev server
Good work
Add mockup data using the data data in seed.tse
yarn seed-dev
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.
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.