Skip to content

Commit

Permalink
instructions added
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainith123 committed Feb 4, 2024
1 parent 62eca32 commit eeb7486
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions week-10/10.1-prisma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,46 @@ The application allows users to create and participate in surveys. Each survey c
- Prisma: Next-generation Node.js and TypeScript ORM
- Jest: JavaScript testing framework

## Getting Started

Please follow the standard instructions to initiate a node app


- Clone the repo


1.change your directory
```
cd survey-poll-app
```
2.initiate a node app

```
npm init -y
```
```
npm install express prisma @prisma/client
```
3. Create Prisma schema file

Create a schema.prisma file in the root of your project and paste the provided schema into it.

4. Configure Database Connection

In the schema.prisma file, update env("DATABASE_URL") with your actual PostgreSQL database connection URL.

5. Generate Prisma Client

```
npx prisma generate
```
6. Create an Express App

7. Implement CRUD Operations

Start Coding!!!


## Directory Structure

**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)**
Expand Down Expand Up @@ -73,6 +113,13 @@ survey-poll-app/

## Prisma Schema for your Reference

**Note : Not mandatory to follow this. this is just for your reference**

Just try to follow this basic structure for creating a survey

![img](./basic-survey.png)


```
datasource db {
provider = "postgresql"
Expand Down Expand Up @@ -107,9 +154,7 @@ model Option {
```

## Getting Started

Please follow the standard instructions to initiate a node app

## Testing

Expand Down
Binary file added week-10/10.1-prisma/basic-survey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit eeb7486

Please sign in to comment.