Skip to content

Latest commit

 

History

History
33 lines (33 loc) · 1.11 KB

README.md

File metadata and controls

33 lines (33 loc) · 1.11 KB

Nested Comments React and Node

Follow these steps to reproduce the project

The Server

  1. npm init -y
  2. npm i --save-dev prisma nodemon
  3. npm i @prisma/client
  4. npx prisma init
  5. Fill in prisma->prisma.prisma file with models and run the following command to generate the tables in DB:
    npx prisma generate
  6. Create a file "seed.js" inside prisma folder

    Add the following section to package.json

        "type": "module",
        "prisma": {
            "seed": "node prisma/seed.js"
        }
        

    RUN: npx prisma db seed

  7. We will use FASTIFY instead of Express since it is simpler for creating APIs
    > npm i fastify dotenv @fastify/cookie @fastify/cors @fastify/sensible

The Client

Follow these steps to reproduce the project

  1. CD into the client folder and run npx create-react-app . to create a new React application
  2. Install axios: npm i axios
  3. npm i react-router-dom react-icons