This page will cover how to set up the development environment for Crowd Emporium.
The following are the basic requirements for the software, which will be expanded upon below:
Versions other than the ones specified here may work, but are not guaranteed.
- Clone the repository;
- Clone the repository in whatever way you prefer, one option is to click the "Code" button and opening it in a compatible editor.
- Download and install Python v3.12.3, this is the only version that we can guarantee our API will run on. Attempting to run another version of Python is not supported.
- Download and install PostgreSQL v16.2.
- Download and install Flyway v10.7.1.
After the repo and core programs have been installed, you are able to move onto setting up the rest of the project.
Open a console window of your choice, windows; powershell; bash; etc. in the crowd-emporium
folder and run the following commands:
-
This will create a virtual environment to install packages to.
python -m venv .venv
-
This will activate the virtual environment.
.venv/Scripts/activate
-
This will install all requirements as they are listed in the
pip install -r ./src/requirements.txt
requirements.txt
file.
*Note that some terminals may instead require using backslashes (\
) instead of forward slashes.
- Download and install PostgreSQL.
- Launch PSQL shell and run the following command:
CREATE DATABASE crowd_emporium
- Download and install Flyway.
- Leave the folder you installed it to open, you will need the file path.
- Create a file named
run_flyway.cmd
in theflyway
folder and paste the following:Make sure to replace@ECHO OFF set FLYWAY_HOME=C:\Path\to\your\flyway\folder @REM This command will allow parameters to be passed such as info or migrate %FLYWAY_HOME%\flyway.cmd -configFiles="./flyway/conf/flyway_postgresql.toml" %1 %2 %3 %4
\Path\to\your\flyway\folder
with the full path to your installation of flyway. E.g.C:\Programs\flyway-10.7.1
- Open a new terminal in the
crowd-emporium
folder if you closed the window from the previous steps. - Run
./flyway/run_flyway.cmd clean baseline migrate info
- This will remove any existing data, re-run all SQL files to generate the mock data, and then print a table showing the status of all operations.
If every step has been followed correctly, running the tools/run.bat
file will open the website and then launch the API.
If you receive an error saying the page does not exist, wait a moment and refresh the page.
If you are looking to contribute to the project, make sure to read the style guide.