Prisma, Authentication & Security
Move Tally onto Prisma, give it real accounts with hashed passwords and secure sessions, keep every user's data private, and defend the API against common web attacks.
Modules
6
Lessons
37
Level
Advanced
Project
Reviewed by a mentor
About This Course
Until now, Tally has been an API that trusts everyone and talks to the database with hand-written SQL. This course replaces both: you model Tally in Prisma ORM 7, query it with Prisma Client, and give the app real user accounts, so each person sees only their own expenses. Security is taught alongside the code, with every feature, from password hashing to ownership checks, paired with the attack it prevents. AI is a tutor only in this course: you write and understand every line. The course project rebuilds the Tally API on Prisma with user accounts, proves with automated checks that one user can never read, change or delete another user's data, and ends with a short security review of your API against the OWASP Top 10.
You'll Be Able To
- Model a relational schema in Prisma, run migrations, and query it with Prisma Client, including relations, aggregations and transactions.
- Register and authenticate users with securely hashed passwords and validated input.
- Implement session- or JWT-based authentication and protect Express routes with middleware.
- Enforce ownership and role-based access so one user can never read or change another user's data.
- Recognise and defend against common web vulnerabilities such as injection, XSS, CSRF and misconfigured CORS.
- Keep secrets out of code, audit dependencies, and review an API against the OWASP Top 10.
What's Inside
- 1
Prisma foundations
6 lessons
Install Prisma 7, describe Tally's users, accounts, categories, transactions and budgets in schema.prisma, create the tables with migrations and fill them with sample data.
- 2
Querying with Prisma Client
6 lessons
Read and write Tally's data with Prisma Client: CRUD, filters, sorting and pages, relations, monthly totals and transactions, then move the API from raw SQL to Prisma.
- 3
Passwords and accounts
6 lessons
Give Tally real accounts: hash passwords with Argon2id, build registration and log-in endpoints, and validate their input so nothing leaks a password or an account's existence.
- 4
Sessions and JWT
7 lessons
Keep users logged in: build secure cookie sessions, learn how JWTs and refresh tokens compare, and protect Tally's private routes with authentication middleware.
- 5
Ownership and authorisation
5 lessons
Make Tally's data private to its owner: scope every query to the logged-in user, add roles, understand IDOR, and prove with a two-user test that nobody sees anyone else's expenses.
- 6
Web security essentials
7 lessons
Defend Tally against the attacks that cause most breaches: injection, XSS, CSRF and bad CORS, plus rate limits, secure headers, safe secrets and dependency audits.