Skip to content

PrettyLegit/spudify-server

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

If you are on the MAIN branch then use the env value called "DATABASE_URL" otherwise use "DEV_DATABASE_URL" for the DEVELOP branch.

First, npm i or yarn install

Second,

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Running the database instance

pscale connect --port 3306

pscale connect spudify dev --port 3306

Useful planetscale commands

https://planetscale.com/docs/reference/shell.
pscale shell <DATABASE_NAME> <BRANCH_NAME>

Prisma Studio is a GUI for the database ORM

npx prisma studio --port 5555

Useful prisma commands

Formats the prisma schema file:

npx prisma format

Generates the prisma client

npx prisma generate

Migrate the database schema into Planetscale database

npx prisma db push