Artur-Poffo / Learning-Prisma-ORM

I'm learning Prisma yey, so I made a rest api to train

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learning Prisma ORM

I'm learning Prisma ORM, so to train I created this rest API that I had seen in this video by Full-Cycle

Technologies

Here are the technologies used in this project.

  • Node.js
  • TypeScript
  • Express.js
  • Prisma
  • PostgreSQL
  • ts-node-dev

Services Used

  • Github

Getting started

  • Clone the repository
  git clone https://github.com/Artur-Poffo/Learning-Prisma-ORM.git
  • Install PostgreSQL in your machine

    • Follow the steps in the documentation for your operating system and install
  • Connect your database to the application

    • Create a .env file on root directory
    • insert one environment variable:
        DATABASE_URL="postgresql://<YOUR USER>:<YOUR PASSWORD>@localhost:5432/postgres?schema=public"
    • That's it, in the Prisma schema it calls this environment variable to connect the DB, just replace it with your PostgreSQL user information
  • install dependencies.

    • npm install on root directory (you need installed node and npm for this)
    • Run on root directory: npx prisma migrate dev
  • To run the project.

    • npm run dev on root directory

How to use

Obs: you will need a program to test the Endpoints, like Insomnia but i recommended the Thunder Client VScode extension

Routes and Features

  • /

    • GET
      • Show a Welcome! message
  • /students

    • POST
      • Adds a new Student to DB
  • /trails

    • POST
      • Adds a new Trail to DB
  • /courses

    • POST
      • Adds a new Course to DB
  • /lessons

    • POST
      • Adds a new lesson to DB
  • /enrollments

    • POST
      • Adds a new enrollment to DB

Links

Versioning

1.0.0

Authors

Artur Poffo

Please follow github and join us! Thanks to visiting me and good coding!

About

I'm learning Prisma yey, so I made a rest api to train


Languages

Language:TypeScript 100.0%