Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ibrahimhabibeg/echo
- Owner: ibrahimhabibeg
- Created: 2023-10-04T17:39:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-05T18:03:05.000Z (about 1 year ago)
- Last Synced: 2024-10-11T18:08:27.020Z (25 days ago)
- Topics: chat, docker, docker-compose, express, mongodb, mongoose, nodejs, react-native, react-query, socket-io, typescript, websocket
- Language: TypeScript
- Homepage:
- Size: 693 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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