> For the picky ones, everything inside the repository is free to use. > No "damage" will affect me. 😊
A web-app that will show a list of people and their information once the clicked user is clicked.
I wanted to learn how to work with these tehcnologies since there are not much resources talking about the implementation of a custom CRUD app.
Let me explain, everyone landing on the page will have read only access to the data. Only certain logged in users will be able to create, update and delete data. By "custom" I mean only those users having a certain role
in the database. That's why on the prisma schema you will find a role
field added on the User
model. Only users with a role
higher than 1 will be able to create, update and delete data.
The app is built using the following technologies:
- NextJS 13, NextAuth, tRPC, Prisma, PlanetScale and Tailwind CSS
You can benefit all these technologies from... 🥁🥁 HERE !
Credits goes to Theo and his collaborators for the amazing work!
The data presented in the app is fake and is generated using mockAPI (You may find the URL endpoint somewhere 😉)
- Fork or clone the repository
- Run
npm install
to install all the dependencies - Define your environment variables in a
*.env
file - Run the following commands:
npm run build && npm run start
-
(Optional) Run
npx prisma studio
and give yourself arole
greater than 1 on theUser
table to be able to w/ data. -
Enjoy ! 🎉
-
Don't forget to star the repository if you liked it! 😊
DATABASE_URL="mysql://user:password@host/database"
NEXTAUTH_SECRET="your-nextauth-secret"
NEXTAUTH_URL="http://localhost:3000"
# Since I am using GitHub's provider:
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"
NEXT_PUBLIC_API_ENDPOINT="https://XXXX.mockapi.io"
NEXT_PUBLIC_NODE_ENV="development"
There is also an example file named .env-example
that you can use as a template.
Important! Make sure not to include the double quotes in the file.