Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
AtilMohAmine committed Feb 1, 2024
1 parent aa6f00e commit d080952
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Chat App

A real-time chat application built with Express.js, Socket.io, React, MongoDB, and JWT authentication.

<p align="center">
<img src="https://github.com/AtilMohAmine/Chat-App/assets/86023602/a6d9e2f8-6244-4d67-a62c-9da051fbae35" style="border-radius: 1%">
</p>

## Features

- **Real-time Chat Functionality:** Real-time chat functionality using Socket.io for bidirectional communication.
- **User Authentication using JWT:** Secure user authentication using JWT (JSON Web Tokens).
- **Responsive and Intuitive User Interface:** The application features a responsive design, ensuring a seamless user experience on various devices, including desktops, tablets, and mobile phones.
Expand All @@ -14,6 +16,7 @@ A real-time chat application built with Express.js, Socket.io, React, MongoDB, a
- **Allowed File Types for Messages:** Support for sharing images and files in the chat.

## Architecture Diagram

Below is the architecture diagram illustrating the components and flow of the Chat App:

<p align="center">
Expand All @@ -25,16 +28,19 @@ Below is the architecture diagram illustrating the components and flow of the Ch
### Installation

Clone the repository:

```bash
git clone https://github.com/AtilMohAmine/Chat-App.git
```

Navigate to the project directory:

```bach
cd chat-app
```

Install dependencies for both the server and client:

```bach
cd chat-app/server
npm install
Expand All @@ -53,14 +59,16 @@ DATABASE_URI=your_database_uri
ACCESS_TOKEN_SECRET=your_access_token_secret
REFRESH_TOKEN_SECRET=your_refresh_token_secret
```

Adjust the values according to your preferences.

Create a .env file in the client directory and set the following environment variable:

```env
REACT_APP_SERVER_URL=your_server_url
```

### Editing allowedOrigins.js:
### Editing allowedOrigins.js

In the server/config directory, edit the `allowedOrigins.js` file:

Expand All @@ -75,12 +83,14 @@ const allowedOrigins = [
export default allowedOrigins;
```

This configuration indicates that your server will allow requests from https://www.yoursite.com and http://localhost:3000.
This configuration indicates that your server will allow requests from <https://www.yoursite.com> and <http://localhost:3000>.

### Editing allowedFileTypes.js

### Editing allowedFileTypes.js:
The `allowedFileTypes.js` configuration is specifying which types of files accepted for sending in messages and uploading profile pictures within your chat application.

In the server/config directory, Modify the content of `allowedFileTypes.js` to specify the types of files that are allowed. For example, you might have:

```javascript
// server/config/allowedFileTypes.js

Expand All @@ -100,13 +110,15 @@ const allowedFileTypes = {

export default allowedFileTypes
```

This configuration provides a structured approach, allowing you to define specific file types for messages and profile pictures. Adjust the file types based on your application's requirements.

### Why These Configurations Matter:
### Why These Configurations Matter

These configurations are essential for security and access control. The allowedFileTypes configuration determines which types of files are accepted by your server, and the allowedOrigins configuration restricts requests to your server from specific domains. Adjust these configurations based on your project's requirements and security policies.

## Usage

Start the server and client:

```bach
Expand All @@ -116,4 +128,9 @@ npm start
# In the client directory
npm start
```

This will run the server on the specified port and the client on its respective port.

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/AtilMohAmine/Chat-App/blob/main/LICENSE) file for details.

0 comments on commit d080952

Please sign in to comment.