ChatUp is a full-stack chat communication application. It uses Django for the backend, React for the frontend, and WebSockets for real-time communication.
- Features
- Technologies Used
- Installation and Setup
- Testing
- Contributing
- License
- Secure authentication
- Real-time chat messaging
- Chat room creation and management
- Responsive design
-
Backend (Django)
- Django, Django REST Framework, Django Channels
- JWT authentication
- WebSocket support
- APIs for room management
-
Frontend (React)
- React, Axios
- Registration & login forms
- Chat interface
-
Others
- Redis for WebSockets
-
Integration
- JWT authentication connected between frontend and backend (access and refresh token both handled in cookie as http only)
- WebSocket real-time updates
- Clone the repository
git clone https://github.com/VishnuCheruvakkara/ChatUp.git
cd ChatUp
- Create and activate a virtual environment
cd backend
- Create and activate a virtual environment
python -m venv env
activate env on Windows
env\Scripts\activate
activate env macOS/Linux
source env/bin/activate
-
Install dependencies
pip install -r requirements.txt -
Configure environment variables
- Create a new
.envfile in the backend folder. - Copy the contents of
.env.exampleinto.env. - Update the placeholder values with your actual local configuration (e.g.,
SECRET_KEY,DEBUG,DATABASE_URL,REDIS_URL, etc.).
-
Install Redis (required for WebSocket communication)
-
Windows:
On Windows, you can use Memurai (a lightweight Redis alternative), Redis for Windows from the GitHub archive (older but works), or WSL (Windows Subsystem for Linux) to run the native Linux version inside Windows.
-
macOS:
brew install redis brew services start redis -
Linux (Ubuntu/Debian):
sudo apt update sudo apt install redis-server sudo systemctl enable redis-server sudo systemctl start redis-server
Verify installation by running:
redis-cli pingNote : After running the above command you will get a reponse as : PONG
-
-
Apply database migrations
python manage.py migrate -
Create a superuser (for admin access)
python manage.py createsuperuser -
Run the development server You can use either Daphne or Uvicorn:
- Run with Daphne:
daphne project_chatup.asgi:application - Run with Uvicorn:
uvicorn project_chatup.asgi:application --reload
Backend will now be running at: http://127.0.0.1:8000/
- Run with Daphne:
-
Navigate to the frontend folder:
cd frontend -
Install dependencies:
npm install -
Configure environment variables:
- Create a new
.envfile in the frontend folder. - Copy the contents of
.env.exampleinto.env. - Update values (e.g.,
VITE_API_BASE_URL,VITE_WS_URL) according to your local backend setup.
- Create a new
-
Start the Vite development server:
npm run dev
The frontend will now be running at: http://localhost:5173/ (default Vite port).
-
Run all tests:
pytest -v -
Run only unit tests:
pytest .\apps\users\testpytest .\apps\chat\test -
Run only integration tests:
pytest integration_test
- Frontend tests:
npm run test
Note : This project was developed as part of a machine test.
Contributions are not required, but if you’d like to suggest improvements, feel free to open an issue or pull request.
- Fork the repository
- Create a new branch
- Commit changes
- Open a pull request
This project is for machine test purposes.
