Skip to content

vboechat/tasks-crud

Repository files navigation

tasks-crud

A simple CRUD application using NestJS, TypeORM, and MariaDB.

This project is an educational project to learn how to use TypeORM with NestJS, I learned a lot and hope this project can help you too.

Getting started

Requirements / Prerequisites

  1. Node.js
  2. Recommended: Yarn. You can use NPM as an alternative.
  3. MariaDB or MySQL

Installation

Install the dependencies with:

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

Documentation

API

You can see the API documentation at the repository wiki.

Swagger

You can enable swagger in the environment variable file by setting the SWAGGER variable to true.
Swagger will be available at the path /api by default, you can change this path by setting the SWAGGER_PATH variable.

Environment Variables

Variable Description Default
API_PORT Port to run the application 3000
API_ADDRESS Address to run the app 0.0.0.0
DB_HOST Database host localhost
DB_PORT Database port 3306
DB_USERNAME Database username -
DB_PASSWORD Database password -
DB_NAME Database name -
DB_TEST_NAME Database test name for E2E tests -
DB_SYNCHRONIZE Database synchronize true
SWAGGER_PATH Swagger path /api
SWAGGER Enable swagger false

License

This project is licensed under the MIT LICENSE.

About

A simple CRUD to study TypeORM. Made with NestJS.

Topics

Resources

License

Stars

Watchers

Forks