Sing me a song

This project was created for users to share their favorite youtube songs!

Build with

  • TypeScript
  • NodeJS
  • Postgres
  • Prisma
  • Jest

Getting Started

Prerequisites

  • npm

Installation

  1. Clone the backend in a folder
https://github.com/GuilhermeArrudda/sing-me-a-song-api.git
  1. Install the dependencies executing command
npm i
  1. Create a .env file on the backend that matches the database, for example:
DATABASE_URL=postgres://USER:USER_PASSWORD@localhost:5432/DATABASE_NAME
  1. Create a .env.tests file on the backend that matches the tests database and tests ambient, for example:
DATABASE_URL=postgres://USER:USER_PASSWORD@localhost:5432/DATABASE_NAME_TESTS
NODE_ENV=test
  1. Create database with prisma
npx prisma init
npx prisma migrate dev

How to run

  1. Start backend
npm run dev

How to run tests

  1. Tests backend
npm run test