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

https://github.com/moj124/chat-backend

NestJS Backend Chat Application
https://github.com/moj124/chat-backend

chat-application docker flyio nestjs-backend socket-io typeorm typescript

Last synced: about 2 months ago
JSON representation

NestJS Backend Chat Application

Awesome Lists containing this project

README

          


Nest Logo

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

A progressive Node.js framework for building efficient and scalable server-side applications.



NPM Version
Package License
NPM Downloads
CircleCI
Coverage
Discord
Backers on Open Collective
Sponsors on Open Collective
Donate us
Support us
Follow us on Twitter


## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript Chat Backend application.

## Endpoints
### GET users/
Description:
- Get all users.

### GET users/:id
Description:
- Get user by ID in parameters.

### POST users/register
Description:
- Create a user with a given body.

Body:
- {username: string, password: string,firstname: string,lastname: string}

### POST users/remove/:id
Description:
- Delete the specified :id user from the Database.

### POST users/login
Description:
- Add JWT token to cookie and return user upon successful authentication with body.

Body:
- {username: string, password: string}

## Installation

```bash
$ npm install
```

## Running the app

```bash
# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod
```

## Test

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## TypeORM Migrations

### Generate migration file
```
npx typeorm-ts-node-commonjs migration:generate ./src/database/migrations/nameDescription -d ./src/database/dataSource.ts
```

### Run migration
```
npx typeorm-ts-node-commonjs migration:run -d ./src/database/dataSource.ts
```

### Revert migration
```
npx typeorm-ts-node-commonjs migration:revert -d ./src/database/dataSource.ts
```
## License
[MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).