Skip to content

eugenelow13/IS212_SPM

Repository files navigation

IS212_SPM

Github Repo

Frontend: Bootstrap, Javascript, React
Backend: Python (Flask)
Database: MySQL (Requires WAMP to be running)

Python virtual environment

Set up python virtual environment (if not done so yet)

  • python -m venv env

Activate your virtual environment based on your local environment (Have to activate to be in the virtual environment) (For consistency purposes when testing and for the CI/CD pipeline)

  • source env/bin/activate # Linux/macOS

  • env\Scripts\activate.bat # In CMD

  • env\Scripts\Activate.ps1 # In Powershell

Install python dependencies (if not done so yet)

Make sure that any newly installed dependencies are added to the requirements.txt with pip freeze >> requirements.txt

  • pip install -r requirements.txt

Create a .env file (if not yet created) and add the following environment variables

  • SQLALCHEMY_DATABASE_URI=mysql://root@localhost:3306/spm_db # for default MySQL settings on Windows

Start Wampserver (Required for MySQL Database)

  • Ensure that Wampserver is installed and running.

  • Configure MySQL settings within Wampserver if necessary.

  • If first time opening the app, run the spm_db.sql file in MySQL Workbench to set up the database

Navigate to the back-end folder and start the Flask application

  • cd backend

  • python run.py

In another terminal, navigate to the front-end folder and start the React application

cd sbrp_client
npm i
npm run dev

Linting (using flake8, doesn't need python app to be running)

  • Open a new shell (as the previous one should have been locked with python run.py)

  • python -m flake8 backend/

Formatting (using yapf, doesn't need python app to be running)

  • python -m yapf --recursive --diff --parallel backend

Testing

Run unit tests (unit_tests.py)

  • cd backend

  • python unit_tests.py

Run integration tests (integration_tests.py)

  • python integration_tests.py

To deactivate the environment

  • deactivate # Or use the deactivate scripts in env/Scripts/

  • env\Scripts\deactivate.bat # In CMD

Remove env (if needed)

  • Simply delete the env folder

E2E Testing with Cypress

  • With npm run dev running the frontend on localhost:5173 and with backend/run.py running the flask app on localhost:5000
  • In a new separate terminal:
    • cd sbrp_client
    • npx cypress run

How to Use

  • At the login page, select the user role (You can type to filter out). Sample users are provided at the top.

HR

  • As a HR, navigate to Create Listing to create a new role listing.
  • Go to Listings to see posted role listings. Click to see details and edit
  • All tables are interactive, with text filtering and sorting for every column (click to toggle)
  • Click on view applicants to see incoming applications. Click on an application to view applicant details, role-skill match, and self-description

Staff

  • As a staff, go to Listings to browse role listings using the interactive table, where you can sort by fields like role-skill match
  • Click on a role listing to apply and fill up an optional self-description

Manager

  • In this release, manager shares the same fucntionality as a staff.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published