adr1enbe4udou1n / nestjs-realworld-example-app

Home Page:https://nestjsrealworld.okami101.io/api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RealWorld Example App

NestJS codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

CI

This codebase was created to demonstrate a fully fledged fullstack application built with NestJS (with Feature orientation) including CRUD operations, authentication, routing, pagination, and more.

For more information on how to this works with other frontends/backends, head over to the RealWorld repo.

See my works for my personal Backend & Frontend RealWorld apps collection.

Usage

PostgreSQL

This project use PostgreSQL as main database provider. You can run it easily via docker-compose up -d.

Two databases will spin up, one for normal development and one dedicated for integrations tests.

Run app

pnpm i
pnpm prisma generate # generate prisma client
pnpm prisma migrate deploy # migrate database schema
pnpm prisma db seed # migrate and fill db with fake data
pnpm start:dev

And that's all, go to http://localhost:3000/api

Validate API with Newman

Launch follow scripts for validating realworld schema :

# be sure to start with empty database
pnpm start
npx newman run postman.json --global-var "APIURL=http://localhost:3000/api" --global-var="USERNAME=johndoe" --global-var="EMAIL=john.doe@example.com" --global-var="PASSWORD=password"

Full test suite

This project is fully tested via Jest, just run pnpm test for launching it.

Use pnpm test:watch for realtime test watching, perfect for TDD.

About

https://nestjsrealworld.okami101.io/api


Languages

Language:TypeScript 98.9%Language:JavaScript 0.9%Language:Dockerfile 0.2%