docs/1.15/get-started/01-setting-up-prisma-demo-server-a001.mdx
import QueryChooser from 'components/Markdown/QueryChooser'
export const meta = { title: 'Setting up Prisma', gettingStartedTitle: 'Free & hosted demo server', position: 1, gettingStartedOrder: 1, nextText: 'Great work! 👏 Move on to learn how you can extend your data model and make changes to your Prisma API.' }
On this page, you will learn how to:
The Prisma CLI is used to deploy and manage Prisma services. You can install it using NPM:
npm install -g prisma
To bootstrap the configuration files for your first Prisma service, create a new directory and initalize it using the prisma init command:
mkdir hello-world
cd hello-world
prisma init
After running prisma init, the Prisma CLI prompts you to select how you want to deploy your Prisma service:
The prisma init command created the minimal service configuration needed to deploy a Prisma service: prisma.yml and datamodel.graphql. This service configuration now needs to be deployed so you can use the Prisma API of your service:
prisma deploy
The Prisma API of your service exposes CRUD operations for the User type defined in datamodel.graphql. Here are a few sample queries and mutations you can send to explore the API.
<QueryChooser titles={["Create new user", "Query all users", "Update a user's name", "Delete user"]}>
mutation {
createUser(data: {
name: "Alice"
}) {
id
}
}
query {
users {
id
name
}
}
mutation {
updateUser(
where: { id: "__USER_ID__" },
data: { name: "Sarah" }
) {
id
name
}
}
mutation {
deleteUser(where: {
id: "__USER_ID__"
}) {
id
name
}
}