Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ibrahimhabibeg/echo

Chat application built with micro-services architecture and front-end caching
https://github.com/ibrahimhabibeg/echo

chat docker docker-compose express mongodb mongoose nodejs react-native react-query socket-io typescript websocket

Last synced: 1 day ago
JSON representation

Chat application built with micro-services architecture and front-end caching

Awesome Lists containing this project

README

        

logo

Echo


Chat application built with microservices architecture and frontend caching.

ยท Documentation ยท Report Bug ยท Request Feature

# ๐Ÿ“™ Table of Contents

- [About the Project](#โญ-about-the-project)
- [Tech Stack](#๐Ÿง‘โ€๐Ÿ’ป-tech-stack)
- [Folder Structure](#๐Ÿ“-folder-structure)
- [Local Installation](#๐Ÿงฐ-local-installation)
- [Contact](#๐Ÿค-contact)
- [Acknowledgements](#๐Ÿ’Ž-acknowledgements)

## โญ About the Project

Echo is a chat system that is built using modern technologies including docker, react native, node, typescript, express, mongo, and websocket.

## ๐Ÿง‘โ€๐Ÿ’ป Tech Stack

**Client:** React Native, Expo, React Query, React Native Paper, Socket.io, Typescript

**Server:** Docker, Node, Typescript, Mongo, mongoose, Express, Socket.io, jsonwebtoken

## ๐Ÿ“ Folder Structure
```
Echo
| README.md
|
|โ”€โ”€โ”€ backend
| | compose.yaml
| | compose.dev.yaml
| | message
| | mongo
| | user
|
|โ”€โ”€โ”€ mobile
| | ...
```

- backend/compose.yaml contains the data docker needs to run the backend services in production environment

- backend/compose.dev.yaml contains the rules used by docker run the backend in development environment. These rules override backend/compose.yaml rules.

- backend/message contains the source code for the service used for managing messages.

- backend/mongo contains the service responsible for the mongo database.

- backend/user contains the source code for the service used for users authentication, creation, and adminstration.

- mobile contains the source code for the mobile app built with React Native.

## ๐Ÿงฐ Local Installation

### โš ๏ธ Prerequisites

- Install Docker in your computer Here

- Install Node JS in your computer for the mobile app Here

- This mobile app uses Yarn as package manager
```bash
npm i -g yarn
```
- We will use docker to run the backend without installing the packages.

- Installing packages in the backend will only be used for IDE autocompletion.

### ๐Ÿƒโ€โ™‚๏ธ Run Locally

Clone the project

```bash
git clone https://github.com/ibrahimhabibeg/Echo
```
Go to the project directory
```bash
cd Echo
```
Create environment variables files for mobile
```bash
touch mobile/.env mongo/.env user/.env message/.env
```
Add backend services url to mobile/.env file
```
EXPO_PUBLIC_USER_SERVICE_URL=http://MY_LOCAL_IP:3000
EXPO_PUBLIC_MESSAGE_SERVICE_URL=http://MY_LOCAL_IP:3001
EXPO_PUBLIC_MESSAGE_WEBSOCKET_URL=ws://MY_LOCAL_IP:3002
```
Add mongo initial data to mongo/.env file
```
DB_USER=USER_USERNAME
DB_PASS=USER_PASSWORD
SALT_ROUNDS=10
JWT_SECRET=MY_JWT_SECRET
MONGO_INITDB_ROOT_USERNAME=ROOT_USERNAME
MONGO_INITDB_ROOT_PASSWORD=ROOT_PASSWORD
MONGO_INITDB_DATABASE=chat
```
Add db user data to both user/.env and message/.env files
```
DB_USER=USER_USERNAME
DB_PASS=USER_PASSWORD
```

Add JWT and Bcrypt data to user/.env file
```
...
SALT_ROUNDS=10
JWT_SECRET=MY_JWT_SECRET
```
Start the backend in production mode
```bash
cd backend
docker compose up --build
```

Start the backend in development mode
```bash
cd backend
docker compose -f compose.yaml -f compose.dev.yaml up --build
```
Start the mobile app
```bash
cd mobile
yarn start
```

## ๐Ÿค Contact

Ibrahim Habib - - [email protected] - - [LinkedIn](https://www.linkedin.com/in/ibrahim-habib-a2948b286/)

Project Link: [Github](https://github.com/ibrahimhabibeg/Echo)

## ๐Ÿ’Ž Acknowledgements

- https://hotpot.ai/ for Images and Splash Screen Creation