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

https://github.com/kieran-lawrence/quill

A real-time chat application built with Next.js on the frontend and NestJS on the backend, using WebSockets for truly instant messaging.
https://github.com/kieran-lawrence/quill

nestjs nextjs postgresql websockets

Last synced: 27 days ago
JSON representation

A real-time chat application built with Next.js on the frontend and NestJS on the backend, using WebSockets for truly instant messaging.

Awesome Lists containing this project

README

          

# ðŸŠķ Quill ðŸŠķ

Quill is a full stack real-time chat application I have built for fun and to further my TypeScript abilities.
The backend is running NestJS with TypeORM for the database. It has all the essential stuff working like real time messages, personalisation, group and private messaging.

The base application is done, and you can clone this repo and get it running locally by following the below instructions. I have some stretch goals I hope to be able to implement in the future as I get time outside of work which are:

- Audio/Video calling using WebRTC (in progress)

Big Plans.
> me thinking about all the things I want to do in this project

### Apps and Packages

```shell
.
├── apps
│ ├── api # Backend / API (NestJS app)
│ └── web # Frontend (Next.js app)
└── packages
├── @repo/api # Shared types, and NestJS DTOs/entities
├── @repo/eslint-config # `eslint` configurations (includes `prettier`)
├── @repo/jest-config # `jest` configurations
├── @repo/typescript-config # `tsconfig.json`s used throughout the app
```

## Project Configuration

There are a few pre-requisites you will need before starting in order for the project to build successfully:

1. **Yarn:** This project is using yarn, so if you wish to use another package manager you will need to update the scripts in `package.json`
2. **Postgres:** If you wish to use another db type, such as mysql, you will need to update `/apps/api/src/app.module.ts`
3. Create a `.env` file in `/apps/api` and populate it with the following

```sh
PORT=value_goes_here # The port the express server will run on
COOKIE_SECRET=value_goes_here # A good secret for session serialisation
COOKIE_MAX_AGE=86400000 # 24 Hours (Adjust as desired for a longer session time)
SESSION_NAME=quill_sessionID # Change if desired
DB_HOST=value_goes_here # Probably localhost, but depends on your configuration
DB_PORT=value_goes_here # Port for your database provider, mine is running in a docker container
DB_USERNAME=username # Your postgres user creds
DB_PASSWORD=password # Your postgres user creds
DB_NAME=quill # Change if desired
FILE_UPLOAD_DESTINATION= # The path where you want uploaded files to go, eg ~/User/{path_to_repo}/quill/assets/images
```

4. Create a `.env.local` file in `/apps/web` and populate it with the following:

```sh
NEXT_PUBLIC_SOCKET_URI= Url the backend is running on, probably http://localhost:3001
```

5. Create a database with the name you specified in `DB_NAME`
6. Run `yarn` to install all dependencies

## Running Quill

Once you've finished setting up, you can run it with the following commands:

```sh
yarn dev # Starts both the front and backend using Turbo
```