Commit 7920e6a3 by Prayush Kumar

APP: update instructions to run on web

parent abe08c3e
{
"name": "ICTS Housing Allotment Portal",
"image": "mcr.microsoft.com/devcontainers/python:3.10",
"postCreateCommand": "pip install Flask pandas numpy",
"portsAttributes": {
"5000": {
"label": "Housing Portal Web GUI",
"onAutoForward": "openPreview"
}
},
"postStartCommand": "python app/server.py"
}
tasks:
- init: pip install Flask pandas numpy
command: python app/server.py
ports:
- port: 5000
onOpen: open-browser
...@@ -4,7 +4,27 @@ A responsive Web GUI dashboard application designed to automate the housing lott ...@@ -4,7 +4,27 @@ A responsive Web GUI dashboard application designed to automate the housing lott
--- ---
## 1. How to Run ## 0. Run Directly in your Browser (No Installation Required)
If your code is hosted on a web-based repository (like GitHub or GitLab), any user can run this application directly in their web browser without installing Python or configuring any settings on their local machine.
### Option 1: GitHub Codespaces (One-Click Launch)
You can launch a browser-based environment directly by clicking this link:
👉 **[Open in GitHub Codespaces](https://github.com/codespaces/new?repo=prayush/housing-allocator)**
1. Click the link above (or go to **Code -> Codespaces -> Create codespace** on GitHub).
2. A browser tab will open simulating a full coding environment. The system is pre-configured to automatically install requirements and launch the app in the background.
3. In 15–30 seconds, a notification saying **"Open in Browser"** or **"Ports: Open Preview"** will pop up in the bottom-right corner. Click it to open the allotment portal!
### Option 2: Gitpod
You can also launch the portal directly using Gitpod by clicking this link:
👉 **[Open in Gitpod](https://gitpod.io/#https://github.com/prayush/housing-allocator)**
The workspace will spin up, configure the Python libraries, and automatically open the web portal in your browser.
---
## 1. How to Run (Local Computer Setup)
### On Windows (Detailed Step-by-Step Guide): ### On Windows (Detailed Step-by-Step Guide):
If you have never used Python before, don't worry! Follow these simple instructions to set it up on your computer: If you have never used Python before, don't worry! Follow these simple instructions to set it up on your computer:
...@@ -21,7 +41,7 @@ If you have never used Python before, don't worry! Follow these simple instructi ...@@ -21,7 +41,7 @@ If you have never used Python before, don't worry! Follow these simple instructi
#### Part B: Launch the Portal #### Part B: Launch the Portal
1. Open the folder where this project is saved on your computer (e.g. inside your Documents or Desktop). 1. Open the folder where this project is saved on your computer (e.g. inside your Documents or Desktop).
2. Double-click the file named [**run.bat**](file:///home/prayush/Documents/ICTS/ICTSHousingCell/icts-housing/app/run.bat) inside the `app/` folder. 2. Double-click the file named [**run.bat**](run.bat) inside the `app/` folder.
3. A black command prompt window will open. On the first launch, it will automatically download and install standard Excel/Web parsing packages (`Flask`, `pandas`, `numpy`). This takes around 15 seconds. 3. A black command prompt window will open. On the first launch, it will automatically download and install standard Excel/Web parsing packages (`Flask`, `pandas`, `numpy`). This takes around 15 seconds.
4. **Keep this black command prompt window open** in the background (closing this window will stop the application engine). 4. **Keep this black command prompt window open** in the background (closing this window will stop the application engine).
5. Open your web browser (Chrome, Edge, Firefox, etc.) and type this address into the top URL bar: 5. Open your web browser (Chrome, Edge, Firefox, etc.) and type this address into the top URL bar:
......
...@@ -4,7 +4,16 @@ ...@@ -4,7 +4,16 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR" cd "$DIR"
# Launch Flask server with base Conda Python which contains pandas/numpy # Detect Python executable dynamically
echo "Starting ICTS Housing Lottery Web GUI..." if command -v python3 >/dev/null 2>&1; then
PYTHON_EXE="python3"
elif command -v python >/dev/null 2>&1; then
PYTHON_EXE="python"
else
echo "Error: Python is not installed or not in PATH."
exit 1
fi
echo "Starting ICTS Housing Allotment Portal Web GUI..."
echo "Open your browser at: http://localhost:5000" echo "Open your browser at: http://localhost:5000"
/home/prayush/miniconda3/bin/python server.py $PYTHON_EXE server.py
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment