IT2566 Infosecurity Project Client
- Sqlite3 Tools Must Be Installed
- Required Pip Dependencies Are Installed
- The
ISPJ_API_KEYEnvironment Variable Must Be Set
- Visit this page and download
sqlite-tools-win32-x86-3330000.zip(or use this direct link). - In the zip file, extract the 3 EXE files to the
C:\sqlite3directory. - Use the keyboard shortcut
Windows key + R, type insystempropertiesadvancedand pressEnter. A new window titled System Properties should open. - Click on the button labeled
Environment Variablesnear the bottom. - In the
System Variablessection, scroll down and double-click on thePathvariable. A new window titled Edit environment variable should open. - Click on
New, type inC:\sqlite3, and pressEnter. - Press
OKon all the previous dialogs to close them.
- Open an administrator command prompt.
- Change directory to the project folder (e.g.
C:\Users\<username>\infosecurity-project\). - Run
python -m venv venvand wait for it to finish. - Run
venv\scripts\activate. - Run
pip install -r requirements.txt.
NOTE: If you installed a new package, update
requirements.txtby following the steps below (since thevenvdirectory will not be pushed to the remote repository):
- Open an administrator command prompt.
- Change directory to the project folder (e.g.
C:\Users\<username>\infosecurity-project\).- Run
venv\scripts\activate.- Run
pip freeze > requirements.txt.- Commit the changes to
requirements.txtand push it to the remote repository.
This application sends requests to the infosecurity-project server for database queries, which will require an API key (which is read from the ISPJ_API_KEY environment variable). The steps below details how to set this environment variable.
- Use the keyboard shortcut
Windows key + R, type insystempropertiesadvancedand pressEnter. A new window titled System Properties should open. - Click on the button labeled
Environment Variablesnear the bottom. - In the
User variables for <username>section, click on theNew...button. A new window titled New User Variable should open. - Type in
ISPJ_API_KEYfor the Variable name field and the appropriate API key for the Variable value field. - Press
OKon all the previous dialogs to close them.
- Open a command prompt window and change directory to the project folder (e.g.
C:\Users\<username>\infosecurity-project-client). - If you are using a virtual environment, activate it by typing
venv\scripts\activateand pressEnter. If not, then make sure that all packages listed inrequirements.txtare installed globally, and move on to the next step. - Type in
.\run.batand pressEnter. - The batch file will generate and display a report on any packages with known security vulnerabilities, and pause execution.
- Press any key to continue with the execution of the batch file, where it will then proceed to run the web application, and automatically open it in a new browser tab.
This project is formatted using Black. Instructions for how to install black can be found here.
Please remember to run black . before committing your changes to any Python file(s) to ensure consistent formatting across all Python files in this project.
camelCase: first word is all lowercase, then subsequent words are capitalized. Has no delimiters.PascalCase: likecamelCase, but the first word is also capitalized.snake_case: all words are in lowercase, delimited by a single underscore.SCREAMING_SNAKE_CASElikesnake_case, but all words are in uppercase.kebab-caseall words are in lowercase, delimited by a single hyphen.
Use snake_case for most names, except:
- Class names:
PascalCase - Constants:
SCREAMING_SNAKE_CASE
You DO NOT use camelCase in Python.
Use camelCase for most names, except:
- Class names:
PascalCase - Constants:
SCREAMING_SNAKE_CASE
You DO NOT use snake_case in JavaScript.
CSS (e.g. background-color), HTML attribute names and values (e.g. <button data-target="#generate-new-api-key-prompt">Generate New API Key</button>), and URLs (e.g. /api/key-management)
Use kebab-case for all names.
Use snake_case for Jinja variables, since they are essentially Python variables under the hood.