A scheduling platform for student to choose courses.
To successfully run the following configuration commands, you will need:
You can check whether or not your system has the above binaries via:
# For python version checking,
python3 --version
python --version
# For Node.js
node -v
# Install virtualenv for python
# Do make sure that your `python3` points to a python3.7 or python3.8 version
python -m pip install --user virtualenv
python -m virtualenv --help
virtualenv -p python3 venv
# Activate virtualenv for python
source venv/bin/activate
# Install python packages
# If in test env
pip install -r requirements/dev.txt
# If in prod env, which you usually do not need to
pip install -r requirements.txt
npm install
# Ubuntu
# postgresql requirement for python package psycopg2
sudo apt install libpq-dev
# Build in dev setting, allow compilation on file changes
npm run dev
# Build in production setting, maximize performance and minimize space
npm run build
Prepare the environment for projects
# Use the virtualenv for python
source venv/bin/activate
# Frontend code realtime compilation
# Run this in another terminal tab
npm run dev
Since the project has included email service, you will need a dummy smtp server to listen to it in order to get, for instance, the verification email link. To run the email server, simply run the following command in another terminal tab:
make dummy-smtp
Which will launch a fake smtp server listening on localhost:1025
The project uses a redis database as a queue for pushing jobs to backend worker process in order to separate the external API requests from frontend website rendering. Therefore, a redis database installation is necessary, you can install and run the redis database via:
make start_redis
Which will fetch and install the redis db when redis-server
is not in the PATH
params. The
first this command runs might takes a few minutes due to download, compiling, and testing the
redis db. After the first pass, it will be pretty quick.
In addition to redis db, a redis queue worker process must be started prior to launching the server via
make start_worker_%
Where %
is the setting file config like local
, remote
Database migration will apply database changes to the database specified in the setting file
specified by the --settings
flag here. You can change the setting file specified by changing
the package string after it. Currently we have four setting configuration:
homiehomie.settings_d.local
sqlite3
dbDEBUG=True
homiehomie.settings_d.remote
homiehomie.settings_d.local
thexyzlab.studio
homiehomie.settings_d.dev
homiehomie.settings_d.remote
DEBUG=False
whitenoise
to serve static file, need to run python manage.py collectstatic --noinput
before launchinghomiehomie.settings_d.prod
You should always run this part prior to start the server.
# Migrate database for local testing setting
# Python
python manage.py migrate --settings=homiehomie.settings_d.local
# Or makefile
make migratedb_local
If you use makefile command, collectstatic
and migrate
are automatically
handled by it so you do not need to run them again
# Development Use local db
make testserver
# Or
make testserver_local
# Use remote db
make testserver_remote
# Use Production server and local setting
make prodserver_local
# Use dev db
make testserver_dev
You can use either the IDE or manage.py
to run the test scripts, but
a series of makefile commands are already set up for you to use:
# Python Django testing
# Run coverage testing on local machine
make coverage
# See coverage report
make coverage-report
A series of makefile commands are set up to ease debugging.
# Display help message
make help
# Run coverage test
make coverage
# Display coverage report
make coverage-report
# Run test smtp server
make dummy-smtp
# Run test server
make testserver
# Generate Django key
make random-key