-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.txt
109 lines (74 loc) · 1.89 KB
/
readme.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Course Selling Apllication backend analysis
## create index.js
## add express and json web tokens
## add routing for user login, signup, create a course, purchse a couse, monitr a course -> view
## create a route skeleton
## add middlewares for user and admin auth
## add database
## define schema for user, admin, course, purchase
## use routing for ease
first build backend then frontend
set up mongo database
design the schema structure and the logic
step 1>
create index and basic routes
step 2>
add routers and handle req efficiently
step 3>
add user course and admin rooutes
step 4>
create a schema
> user
>admin
>course
>purchases
SCHEMA DESIGN:
user schema --
_id > default object _id
email
first name
lastname
password
admin schema:
_id
email
first name
passsword
lastname
Course schema:
_id
title
price
iamge url
description
purchase schema:
_id
courseID - linekd to course id in course schema
userID - linekd to user id in user scheamm
13th oct
// only start if database is up
// added main fuction
create middlewares`
use express.json();
//helps in parsing the incomming json requests andis based on bodu parser middleware
if the user exits geenrate a tokens // SIGNIN PROCESS
have a saperate kwt password for user and admin sinins
TO: DO: -----
USER ROUTER
plain text password should not be stored in the database
hash the passsword and then check with th passsword provided by used and using
Bcrypt library
ADMIN ROUTER
the same way
Middlewares:
Admin and user
now the suntionality is to be omplete within 10 days and then i shall proceede with irats assingnments
completing the application by today
//addingcourse content
TO:DO
-use cookies instead of jwts
-frontend design
-front end in react
-add a middleware for admin and user
-deploy the backend on render
-complete the project by 26th of January 2025