Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/leosuncin/nest-typeorm-custom-repository

TypeORM with a Custom Repository
https://github.com/leosuncin/nest-typeorm-custom-repository

example-project nestjs nodejs sqlite3 supertest typeorm typescript

Last synced: 4 months ago
JSON representation

TypeORM with a Custom Repository

Awesome Lists containing this project

README

        

# 🗄️ Nest.js + TypeORM with a Custom Repository

[![MegaLinter](https://github.com/leosuncin/nest-typeorm-custom-repository/workflows/MegaLinter/badge.svg?branch=master)](https://github.com/leosuncin/nest-typeorm-custom-repository/actions/workflows/mega-linter.yml)
[![Tests](https://github.com/leosuncin/nest-typeorm-custom-repository/workflows/Tests/badge.svg?branch=master)](https://github.com/leosuncin/nest-typeorm-custom-repository/actions/workflows/tests.yml)
![Prettier](https://img.shields.io/badge/Code%20style-prettier-informational?logo=prettier&logoColor=white)
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)
[![HitCount](https://hits.dwyl.com/leosuncin/nest-typeorm-custom-repository.svg)](https://hits.dwyl.com/leosuncin/nest-typeorm-custom-repository)

> An example of how to use a custom repository of TypeORM within Nest.js
> **🚨 NOTICE 🚨** this example now works with TypeORM v0.3.x for previous version check out [v1.0.0](https://github.com/leosuncin/nest-typeorm-custom-repository/tree/v1.0.0)


Nest Logo

## Features

- [TypeORM](https://typeorm.io/) with custom repository
- Unit tests and E2E tests
- Check code quality with [MegaLinter](https://oxsecurity.github.io/megalinter/latest/)
- Run tests with [github actions](.github/workflows/tests.yml)

## Run Locally

Clone the project

```bash
git clone https://github.com/leosuncin/nest-typeorm-custom-repository.git
```

Go to the project directory

```bash
cd nest-typeorm-custom-repository
```

Install dependencies

```bash
yarn install
```

Start the server

```bash
yarn start:dev
```

## Running Tests

To run unit tests, run the following command:

```bash
pnpm test
```

To run e2e tests (the MySQL instance must be available), run the following command:

```bash
pnpm test:e2e
```

## Tech Stack

**Server:** Typescript, SQLite, Nest.js, TypeORM

**Test:** Jest, SuperTest

## Author

👤 **Jaime Leonardo Suncin Cruz**

- Twitter: [@jl_suncin](https://twitter.com/jl_suncin)
- Github: [@leosuncin](https://github.com/leosuncin)
- LinkedIn: [@jaimesuncin](https://linkedin.com/in/jaimesuncin)

## Show your support

Give a ⭐️ if this project helped you!

## Related

Here are some more example projects with Nest.js

[![Authentication example](https://github-readme-stats.vercel.app/api/pin/?username=leosuncin&repo=nest-auth-example)](https://github.com/leosuncin/nest-auth-example)

[![API example](https://github-readme-stats.vercel.app/api/pin/?username=leosuncin&repo=nest-api-example)](https://github.com/leosuncin/nest-api-example)

[![GraphQL example](https://github-readme-stats.vercel.app/api/pin/?username=leosuncin&repo=nest-graphql-example)](https://github.com/leosuncin/nest-graphql-example)

## License

Release under the terms of [MIT](./LICENSE)