committing summative

This commit is contained in:
Archie committed 2026-11-06 10:02:29 +00:00
1 parent 73ac8e85be
commit 95b138f29e
44 files changed
+5319 -755

No files matched your search

+25
View File
@@ -34,3 +34,28 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
# CMS README - Archie McCulloch
### Setup Instructions
- copy `.env.example` to `.env` and fill in values
- ENFORCEADMIN is checked against "true" to determine whether to expose /users
- `npm install`
- `npx prisma validate --config ./prisma7.config.ts`
- `npx prisma migrate dev --name init --config prisma7.config.ts`
- `npx prisma generate --config prisma7.config.ts`
- `npx tsx prisma/seed.ts`
- `npm run dev`
- seeded login details: "seededTest@test.test" + password defined in .env
-
### Authentication Approach
- Registation is done by a custom registration endpoint that creates uses in the database with hashed passwords using bcrypt
- Email and passwod login is done with Auth.js Credentials provider which check against stored user and password hash
- Google login is done with Auth.js Google provider, a database account is created if not already existing linked to their Google account by their Google ID
- Routes access control is controlled by the proxy
- Newsletter actions check for ownership using logged in user's ID
- Auth.js signOut() endpoint clears the session and redirects to login page
- Front end uses SessionProvider to gain access to session data which is fed by Auth.js
- Auth.js uses JWT to store session information with http only cookies, a callback is used to append user.id to session