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

https://github.com/kustiks/simple-chat

Simple chat is an application that helps you to communicate with other people in real time
https://github.com/kustiks/simple-chat

chat chat-app-using-firebase chat-application firebase firebase-auth firestore react redux-toolkit storybook styled-components typescript vite

Last synced: 3 months ago
JSON representation

Simple chat is an application that helps you to communicate with other people in real time

Awesome Lists containing this project

README

          



Logo

Simple Chat


Application that helps you to communicate with other in real time




Live Demo
·
Video Demo
·
Report Bug
·
Request Feature


## About this project

![preview](/public/screenshot.png)

Simple chat is an application that helps you to communicate with other in real time

### Built With

- [React](https://reactjs.org/)
- [Typescript](https://www.typescriptlang.org/)
- [Firebase](https://firebase.google.com/)
- [Vite](https://vitejs.dev/)
- [Redux Toolkit](https://redux-toolkit.js.org/)
- [Styled Components](https://styled-components.com/)

### Additional Tools

- [Storybook](https://storybook.js.org/)
- [Figma](https://www.figma.com/)

(back to top)

## Getting Started

### Prerequisites

In this project yarn is used, so make sure, you have it installed

```sh
npm install yarn@latest -g
```

### Installation

1. Clone the repo

```sh
git clone https://github.com/KUSTIKs/simple-chat.git
```

or

```sh
git clone git@github.com:KUSTIKs/simple-chat.git
```

1. Install dependencies

```sh
yarn
```

1. To start a project run

```sh
yarn dev
```

(back to top)

## Mobile adaptive

This application is fully mobile responsive
![mobile_chat-page](https://user-images.githubusercontent.com/62993891/185960537-a4d4ad3a-5ab9-49af-937b-911a9b27c0a4.png) | ![mobile_chats-page](https://user-images.githubusercontent.com/62993891/185962139-7d04a01d-afad-4629-95f7-ae41bb90021d.png) | ![mobile_auth-page](https://user-images.githubusercontent.com/62993891/185960587-74ddfbe8-573b-4d75-8841-02b89d1ac620.png)
---|---|---

(back to top)

## Bot

Bot is just a user, which responds with joke from [chucknorris.io](https://api.chucknorris.io/) api on every user message

(back to top)

## Data

This project is using Firebase auth for authentication and Firestore to manage data. Interfaces of entities look look like so

```typescript
type Account = {
id: string;
name: string;
avatarUrl: string;
isOnline: boolean;
lastTimeOnlineAt: Timestamp;
email: string;
};

type Chat = {
id: string;
members: [Account, Account];
messages: Message[];
};

type Message = {
id: string;
author: Account;
content: string;
createdAt: Timestamp;
};
```

By the help of firebase `onSnapshot` function, real time updating is working. For example, when you send message, it immediately appears on both accounts

(back to top)

## Storybook

To start storybook locally, use following command

```sh
yarn storybook
```

![storybook preview](/public/storybook-screenshot.png)

there are two groups of components here: components, and widgets, that can use other components and have some side effects

(back to top)