Server-Sent Events (SSE) is a unidirectional communication technique where the server pushes updates to the client over a single persistent connection. The client establishes the connection using HTTP, and the server sends updates whenever new data is available in a standardized format. SSE is efficient for real-time updates because it eliminates the need for continuous client polling and supports automatic reconnection.
Clone the repository.
git clone [email protected]:tyronejosee/prototype_sever_sent_events.git
Activate the virtual environment:
pipenv shell
Install dependencies:
pipenv install
pipenv install --dev
Verify dependencies:
pipenv graph
Run the development server using uvicorn
:
uvicorn core.asgi:application --host 127.0.0.1 --port 8000
Or using daphne
:
daphne -b 127.0.0.1 -p 8000 core.asgi:application
Run the migrations:
python manage.py migrate
Create a superuser to access the entire site without restrictions:
python manage.py createsuperuser
Log in to admin
:
http://127.0.0.1:8000/admin/
The front end of the application was created with Next.js using the App Router introduced in Next.js 13 and the package manager PNPM.
To get started, make sure you have PNPM installed on your system. Then, follow these steps:
Navigate to the frontend
folder:
cd ./frontend/
Install the dependencies:
pnpm install
Start the development server at http://localhost:5173/
:
pnpm dev
Enjoy! 🎉