https://github.com/tyronejosee/prototype_websockets
Prototype for WebSockets using Django and React. Demonstrates real-time communication between the backend and frontend.
https://github.com/tyronejosee/prototype_websockets
django javascript python react sqlite typescript websockets
Last synced: 7 months ago
JSON representation
Prototype for WebSockets using Django and React. Demonstrates real-time communication between the backend and frontend.
- Host: GitHub
- URL: https://github.com/tyronejosee/prototype_websockets
- Owner: tyronejosee
- License: mit
- Created: 2024-12-13T21:53:02.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-03T20:36:55.000Z (about 1 year ago)
- Last Synced: 2025-05-14T12:21:25.087Z (9 months ago)
- Topics: django, javascript, python, react, sqlite, typescript, websockets
- Language: Python
- Homepage:
- Size: 68.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prototype WebSockets
Los **WebSockets** son un protocolo de comunicación que permite la comunicación bidireccional y persistente entre un servidor y un cliente a través de una única conexión TCP. A diferencia de los métodos tradicionales como HTTP, donde el cliente realiza una solicitud y el servidor responde, WebSockets permiten una comunicación en tiempo real, donde el servidor puede enviar datos al cliente en cualquier momento sin necesidad de que el cliente realice una nueva solicitud.

## 💻 General
### 🗃️ Repository
Clone the repository.
```bash
git clone git@github.com:tyronejosee/prototype_websockets.git
```
## 🛠️ Backend
### ⚙️ Installation
Activate the virtual environment:
```bash
pipenv shell
```
Install dependencies:
```bash
poetry install
```
Verify dependencies:
```bash
poetry show
```
Run the development server using `uvicorn`:
```bash
uvicorn core.asgi:application --host 127.0.0.1 --port 8000
```
Or using `daphne`:
```bash
daphne -b 127.0.0.1 -p 8000 core.asgi:application
```
Run the migrations:
```bash
python manage.py migrate
```
Create a superuser to access the entire site without restrictions:
```bash
python manage.py createsuperuser
```
Log in to `admin`:
```bash
http://127.0.0.1:8000/admin/
```
## 🎨 Frontend
The front end of the application was created with [Next.js](https://nextjs.org/) using the App Router introduced in Next.js 13 and the package manager [PNPM](https://pnpm.io/).
### ✅ Requirements
- [Node.js](https://nodejs.org/) >= 16.8.0
- [PNPM](https://pnpm.io/installation) >= 7.0
### ⚙️ Installation (Front-end)
To get started, make sure you have [PNPM](https://pnpm.io/installation) installed on your system. Then, follow these steps:
Navigate to the `frontend` folder:
```bash
cd ./frontend/
```
Install the dependencies:
```bash
pnpm install
```
### Available Scripts
Start the development server at `http://localhost:5173/`:
```bash
pnpm dev
```
Enjoy! 🎉