An open API service indexing awesome lists of open source software.

https://github.com/tyronejosee/prototype_long_polling

Prototype for long polling using Django, Django REST Framework, and React. Demonstrates a basic setup for real-time data updates with long polling.
https://github.com/tyronejosee/prototype_long_polling

css django django-rest-framework html javascript long-polling python react typescript

Last synced: 3 months ago
JSON representation

Prototype for long polling using Django, Django REST Framework, and React. Demonstrates a basic setup for real-time data updates with long polling.

Awesome Lists containing this project

README

          

# **Prototype Long Polling**

**Long Polling** is a communication technique where the client sends a request to the server, which keeps the connection open until new data is available or a timeout occurs. Once the server responds, the client immediately sends a new request, creating a cycle that simulates real-time updates.

![Long Polling](./main.webp)

## 💻 General

### 🗃️ Repository

Clone the repository.

```bash
git clone git@github.com:tyronejosee/prototype_long_polling.git
```

## 🛠️ Backend

### ⚙️ Installation

Install the project dependencies.

```bash
poetry install
```

Run the virtual environment.

```bash
poetry shell
```

Add a new dependency.

```bash
poetry add
```

Add development dependencies (such as linters or testing tools):

```bash
poetry add --group dev
```

Run the project.

```bash
python manage.py runserver
```

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! 🎉