Skip to content

IdrisAkintobi/nestjs-with-redis

Repository files navigation

NestJS with Redis

Description

This is a simple Node.js application that uses the NestJS framework to create a REST API for a simple server. The application uses ioredis to connect to a Redis database. The redis database is used for caching and to persist shot lived data i.e token. The application uses Jest for unit testing.

Requirements

Environment Variables

# Redis Host
REDIS_HOST=
# Redis Port
REDIS_PORT=

Installation

$ yarn

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Code Structure

src
├── app.module.ts
├── controller
│   ├── app.controller.ts
│   ├── dto
│   │   ├── password-reset-token-request.dto.ts
│   │   ├── password-update-request.dto.ts
│   │   └── product.request.dto.ts
│   ├── password-reset.controller.ts
│   └── product.controller.ts
├── domain
│   ├── enum
│   │   └── redis-prefix-enum.ts
│   └── interface
│       ├── product.interface.ts
│       ├── redis.repository.interface.ts
│       └── reset.token.interface.ts
├── infrastructure
│   └── redis
│       ├── redis.client.factory.ts
│       ├── redis.module.ts
│       └── repository
│           └── redis.repository.ts
├── main.ts
└── service
    ├── app.service.ts
    ├── password-reset.service.ts
    ├── product.service.ts
    └── redis.service.ts

License

MIT licensed

About

NestJS application with Redis database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published