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
- Host: GitHub
- URL: https://github.com/moj124/chat-backend
- Owner: moj124
- Created: 2024-06-25T09:00:20.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-26T22:34:18.000Z (almost 2 years ago)
- Last Synced: 2025-03-13T13:44:43.048Z (over 1 year ago)
- Topics: chat-application, docker, flyio, nestjs-backend, socket-io, typeorm, typescript
- Language: TypeScript
- Homepage: https://chat-backend-autumn-silence-9958.fly.dev/
- Size: 2.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[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.
## 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).