Fullstack Blog Application with Prisma 2, Next.js and Docker
Based on Blog Posts at:
Here's what the stack looks like:
What does it look like?
We are building a blog web app based on the example blog project that comes with the Prisma 2 CLI. Here are the actions we can perform from the backend:
- Read all published blog posts
- Read all draft blog posts
- Read all users
- Create a user
- Create a blog draft
- Publish a blog
- Delete a blog
Obviously in a real application, you’d never allow anyone to see all the users or unpublished blog posts- but doing this for here so we can see all the posts and users as they are created and modified right from our Next.js website.
In the root directory:
npm run build This will build your frontend, backend and prisma docker containers
npm start This will start up your docker compose docker containers
npm stop This will bring down the cluster and remove containers
npm run clean This will delete all containers, images, docker networks
npm run clean:volumes This will delete all docker volumes
npm run generate This will build the
frontend/generated/apollo-components.tsx based on the queries and mutations in the
frontend/graphql folder that it will run against the the backend server itself.