Skip to content

Making a modern api with the best from node and ts

Notifications You must be signed in to change notification settings

Joabesv/beautiful-api

Repository files navigation

Build a REST API with modern node techs

How to run?

  # clone the project
  git clone https://github.com/Joabesv/beautiful-api.git

  # install deps
  pnpm i

  # Populate the .env file with your secrets
  cp .env.example .env

  # Init Docker-compose 
  docker-compose up -d

  # Migrate your schema
  pnpm prisma migrate dev --name 
  
  # Finally start the server in watch mode
  pnpm start:dev

What are we using?

  • Fastify - Web server
  • Prisma - Database ORM
  • Zod - Request and response validation
  • Swagger - API docs
  • TypeScript - Types & other cool stuff

What you will need

Features

  • Create a user
  • Login
  • List users
  • Create a product
  • List products
  • Authentication
  • Request & response validation
  • Swagger docs

Testing

What are we testing with?

What have I learn?

  • How to test an API end-to-end
  • How to inject http requests to your Fastify application (amazing feature)
  • How to mock function calls
  • How to test with a test database (this one i need to understand more)

Where can I learn more about testing Fastify?

About

Making a modern api with the best from node and ts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published