Skip to content

ACM-VIT/Diversion-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diversion-Server

WebSocket + FastAPI Server Setup

This repository contains two major components:

  1. A WebSocket server written in Node.js
  2. A FastAPI backend (Python) served using uvicorn with uv for environment management

Prerequisites

Make sure you have the following installed:

  • Node.js (for the WebSocket server)
  • Python 3.10+
  • uv (a modern Python packaging tool)
  • Git (to clone the repository)

Setup Instructions

Clone the Repository

[bash] git clone cd Part 1: WebSocket Server Setup (Node.js) Initialize & Install Dependencies [bash] npm init -y npm install ws Run the WebSocket Server [bash] node server.js Part 2: FastAPI Backend Setup (Python with uv) Make sure uv is installed globally. If not, install it using: pip install uv

Setup Virtual Environment If this is your first time setting it up, run:

[bash] uv venv On Windows [powershell] Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted .venv/Scripts/Activate.ps1 On Linux/macOS [bash] source .venv/bin/activate To deactivate the environment:

[bash] deactivate Install Python Dependencies Inside the project folder, ensure main.py is present.

[bash] uv add

or

uv sync # If dependencies are listed in pyproject.toml Run the FastAPI Server [bash] uvicorn main:app --reload File Structure [bash] ├── server.js # WebSocket server ├── main.py # FastAPI backend ├── pyproject.toml # Python dependencies (if using uv) └── README.md # This file Notes Make sure ports used by the WebSocket and FastAPI servers do not conflict.

Always activate the Python virtual environment before running Python-related commands.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors