HackNUThon 2024.
-
Install python, poetry, nodejs, mysql (make sure
mysql
is on PATH) and (optionally) stella on your system. -
Clone the repository (fork first if you want to contribute).
git clone https://github.com/shravanasati/hacknuthon-24.git
Change the github username in the above URL if you have forked the repository.
- Create a virtual environment (strongly recommended).
python -m venv venv
And activate it.
On Windows powershell
./venv/Scripts/Activate.ps1
On unix based systems
source ./venv/bin/activate
- Install all the dependencies.
To install all the python dependencies:
poetry install --no-root
To install all the npm dependencies:
npm i
- More configurations.
Another configuration you'd need to be able to run the server is SECRET_KEY
, which is used by login manager to keep client-side sessions secure.
Generate a safe secret key using python:
python -c "import secrets;print(secrets.token_hex(64))"
Set the value as follows, in the .env
file:
SECRET_KEY={secret_key}
- Run the server.
Open 3 terminal sessions and execute following commands in the respective session:
- Session 1
npm run tailwind
This will enable the tailwind watcher that detects changes in tailwind css.
- Session 2
npm run webpack
This will enable the webpack watcher to bundle javascript.
- Session 3
Always execute python-related commands inside an activated virtual environment.
flask --app app run
If you've installed stella, you can get live reloading capabilities for both backend and frontend.
stella run server
for just running the server.
stella run
for running the server as well as having reload on browser.
stella run serve-all
to serve on all interfaces (i.e., to view the website on a mobile on the same network).
ALWAYS use
ex
command to stop stella, don't useCTRL + C
.