Skip to content

Example application based on NestJS + TypeORM + JWT + Swagger

License

Notifications You must be signed in to change notification settings

H6LS1S/link-shortener

Repository files navigation

Description 📖

REST-API service witch visual documentation support API. Allows users to reduce links to sources, and authorized users to keep history and statistics. Rest-API based in the NestJS framewerk + TypeORM + Some magic 🐳 + Swagger

In future 💡

  • DbSchema creation ✔️
  • Install and configure project ecosystem ✔️
  • User entities creation and Authentication flow
  • Link initial flow
  • Full coverage
  • Migration to Docker container

Installation 🔧

$ npm install

Test ☕

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Running the app 🚀

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Environment variable 👾

The following are environment variables for different usage modules. The prefixes for .env can only be:

  • For development: development
  • For testing: test
  • For production: [ EMPTY ]

Server:

NODE_TLS_REJECT_UNAUTHORIZED=0
NEST_PORT=80
NEST_API_PREFIX=/api/v1
NEST_ROOT_URL=//localhost + NEST_API_PREFIX

Authentication strategies:

NEST_DEF_STRATEGY=jwt
NEST_DEF_SESSION=false
JWT_SECRET_KEY=testToken
JWT_EXPIRES_TIME=3600

TypeORM:

TYPEORM_PORT=5432
TYPEORM_CONNECTION=postgres
TYPEORM_HOST=localhost
TYPEORM_USERNAME=postgres
TYPEORM_PASSWORD=postgres
TYPEORM_DATABASE=link_exapmle
TYPEORM_LOGGING=true
TYPEORM_SYNCHRONIZE=true
TYPEORM_DROP_SCHEMA=true
TYPEORM_ENTITIES=src/modules/**/*.entity.ts
TYPEORM_SUBSCRIBERS=src/modules/**/*.subscriber.ts
TYPEORM_MIGRATIONS_DIR=src/database/migrations/
TYPEORM_MIGRATIONS_TABLE_NAME=migration_project
TYPEORM_ENTITIES=src/modules/**/*.entity.ts
TYPEORM_MIGRATIONS_DIR=src/database/migrations/

Support :octocat:

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

License 📜

Nest is MIT licensed.

About

Example application based on NestJS + TypeORM + JWT + Swagger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published