shravanasati / squirrel

An AI SQL query builder and executor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hacknuthon

HackNUThon 2024.

System idea

image

Development Environment Setup

  1. Install python, poetry, nodejs, mysql (make sure mysql is on PATH) and (optionally) stella on your system.

  2. 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.

  1. 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
  1. Install all the dependencies.

To install all the python dependencies:

poetry install --no-root

To install all the npm dependencies:

npm i
  1. 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}
  1. 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 use CTRL + C.

About

An AI SQL query builder and executor.

License:MIT License


Languages

Language:CSS 68.2%Language:Python 16.6%Language:JavaScript 8.8%Language:HTML 6.4%