This is a chat application where the backend is written in Golang, the frontend is created in React, and MongoDB is used for data storage. Both the backend and frontend are dockerized into a Docker container for easy deployment.
- Real-time Chat: Utilizing Websockets for instant messaging.
- User Authentication: Secured via JWT for user access.
- Chat Room Management: Users can create and manage chat rooms.
- Backend: Golang
- Frontend: React
- Database: MongoDB
- Docker
- Install Docker on your machine.
- In the project root, create a
.env
file based on.example.env
and fill in the environment variables. - Inside the client folder, create a
.env
file based on.example.env
.
- Golang installed on your machine.
- Node.js and npm installed on your machine.
- MongoDB installed and running on your machine.
- Create a .env file in the root directories of both the backend and frontend based on their respective .env.example files and fill in the environment variables.
-
Clone this repository:
git clone https://github.com/Sahil-4555/GOLANG_CHAT_DEMO.git
-
Navigate to the project directory:
cd GOLANG_CHAT_DEMO
-
Create a .env file in the root directories of both the backend and frontend based on their respective .env.example files and fill in the environment variables.
-
Start the application using Docker Compose:
docker compose up --build
- Backend
-
Navigate to the backend directory:
cd backend
-
Create a .env file in the root directory of the backend based on .env.example and fill in the environment variables.
-
Install dependencies and run the backend:
go mod tidy go run main.go
- Frontend
-
Navigate to the frontend directory:
cd frontend
-
Create a .env file in the root directory of the frontend based on .env.example and fill in the environment variables.
-
Install dependencies and run the frontend:
npm install npm start