You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: week-10/10.1-prisma/README.md
+47-2Lines changed: 47 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,46 @@ The application allows users to create and participate in surveys. Each survey c
42
42
- Prisma: Next-generation Node.js and TypeScript ORM
43
43
- Jest: JavaScript testing framework
44
44
45
+
## Getting Started
46
+
47
+
Please follow the standard instructions to initiate a node app
48
+
49
+
50
+
- Clone the repo
51
+
52
+
53
+
1.change your directory
54
+
```
55
+
cd survey-poll-app
56
+
```
57
+
2.initiate a node app
58
+
59
+
```
60
+
npm init -y
61
+
```
62
+
```
63
+
npm install express prisma @prisma/client
64
+
```
65
+
3. Create Prisma schema file
66
+
67
+
Create a schema.prisma file in the root of your project and paste the provided schema into it.
68
+
69
+
4. Configure Database Connection
70
+
71
+
In the schema.prisma file, update env("DATABASE_URL") with your actual PostgreSQL database connection URL.
72
+
73
+
5. Generate Prisma Client
74
+
75
+
```
76
+
npx prisma generate
77
+
```
78
+
6. Create an Express App
79
+
80
+
7. Implement CRUD Operations
81
+
82
+
Start Coding!!!
83
+
84
+
45
85
## Directory Structure
46
86
47
87
**NOTE:Please adhere to the below directory structure, follow the same naming convention for files and directories in your app(Inorder to run tests w/o any trouble)**
@@ -73,6 +113,13 @@ survey-poll-app/
73
113
74
114
## Prisma Schema for your Reference
75
115
116
+
**Note : Not mandatory to follow this. this is just for your reference**
117
+
118
+
Just try to follow this basic structure for creating a survey
119
+
120
+

121
+
122
+
76
123
```
77
124
datasource db {
78
125
provider = "postgresql"
@@ -107,9 +154,7 @@ model Option {
107
154
108
155
```
109
156
110
-
## Getting Started
111
157
112
-
Please follow the standard instructions to initiate a node app
0 commit comments