-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharchitecture.txt
89 lines (60 loc) · 2.55 KB
/
architecture.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
RANDOM LINKS FOR NEXT.JS LAYOUTS
// https://sampotter.me/tech/how-not-to-do-layouts-in-nextjs
// https://adamwathan.me/2019/10/17/persistent-layout-patterns-in-nextjs/
// https://nextjs.org/docs/basic-features/layouts
API ROUTES:
-nothing planned yet
ROLE BASED AUTHENTICATION & AUTHORIZATION:
AUTHENTICATION & AUTHORIZATION
STEP 1
Add Next-Auth
https://next-auth.js.org/getting-started/example
STEP 2
Connect with Github
https://next-auth.js.org/providers/github
STEP 3
Build protected pages / api / routes
STEP 4
Connect to MongoDB
https://hevodata.com/learn/next-js-mongodb-connection/
STEP 5
Add MongoDB adapter
- or -
Add Prisma w/ MongoDB database connector
https://next-auth.js.org/adapters/mongodb
https://www.prisma.io/docs/concepts/database-connectors/mongodb
STEP 6
Add "Register with credentials"
https://next-auth.js.org/providers/credentials
STEP 7
Add Passwordless authentication (magic links)
https://www.youtube.com/watch?v=GPBD3acOx_M
STEP 8
Add connect with all other providers (Facebook, Twitter, etc...)
BUILD AND ASSIGN ROLES
Design User Roles and Permision
- Store User Roles
- Assign User Roles
- Edit User Roles
-https://www.reddit.com/r/nextjs/comments/reofzj/update_user_object_inside_nextauth_session/
Random Links for ROLE BASED AUTHENTICATION & AUTHORIZATION
// EXAMPLE NEXT PROJECT
// https://github.com/vercel/next.js/tree/canary/examples
// Prisma - Nextjs
// https://www.youtube.com/watch?v=FMnlyi60avU
// Prisma - Mongodb
// https://www.youtube.com/watch?v=b4nxOv91vWI
// Has Tutorial for persistanc Passwordless User Login
// https://next-auth.js.org/tutorials
// This is that tutorial
// https://alterclass.io/tutorials/magic-link-authentication-in-nextjs-with-nextauth-and-fauna
// Had alot of random stuff, not very organized but cover alot (I think)
// https://www.youtube.com/watch?v=uLjS5DVgSvc&t=732s
// Example Next.js Next-Auth app:
// https://github.com/nextauthjs/next-auth-example
Random Explination of Next-Auth & User Registration
Registration is the process of registering the user, saving new users' credentials into the database. It is independent of next-auth. You create a form, submit the form and save the form data properly into the database.
next-auth takes over when you are logged in, in other words, you are authenticated meaning that you are already a registered, genuine user. Once you pass the security checks and successfully logged in, next-auth creates a session for the user.
// data base / prisma / orm / postgres / supabase / mongodb
INTERNATIONALIZATION:
monorepo / yarn works bases? / turbo repo / nx: