git clone https://github.com/jennyzeng/CourseScheduling-Web.git
install Docker at https://www.docker.com/
Then, cd
to the repo, run
$ docker-compose up --build
you will see the demo page at http://localhost:8000/
after that you can run
$ docker-compose up
to start it, and
$ docker-compose down
to stop. Note that use Ctrl-C to stop the service after you enter docker-compose up
does not stop it, so
you should do docker-compose down
to ensure it is not running anymore actually.
some other related operations:
# Remove stopped containers
docker-compose rm -f
# Remove "dangling" images
docker rmi -f $(docker images -qf dangling=true)
You should remove old course and requirements data in the old version before doing the following operations.
You can manage your data in database using Robo 3T.
URL: http://localhost:8000/admin/upload/
admin username: admin
admin password: admin
Upload Courses
- Select 'Courses' in the selectbox
- Choose json files in the database/courses/ folder, and upload them one by one.
Upload Requirements
- Select 'Requirements' in the selectbox
- Choose json files in the database/requirements/ folder, and upload them one by one.
When our services are running, in another terminal, do
# To load course:
docker-compose exec website python database/manage.py load_course -f [path-to-the-file]
# To load requirements:
# general:
docker-compose exec website python database/manage.py load_requirement -f [path-to-the-file]
## for universial
docker-compose exec website python database/manage.py load_requirement -f database/requirements/UNIVERSAL.json
## cs major:
docker-compose exec website python database/manage.py load_requirement -f "database/requirements/COMPUTER SCIENCE.json"
remember that if you want to access the database in docker, the host name is the name of the database container name. That is, 'mongodb' in our case (You can see it in docker-compose.yml).
docker-compose exec website python database/WebSoc.py
dept list and save path can be edited in database/WebSoc.py main
write tests in CourseScheduling/tests, following the test pattern in page folder.
To test, use docker-compose up
to run services,
then in another terminal,
do
$ docker-compose exec website CourseScheduling test
or
$ docker-compose exec website CourseScheduling conv
Course
Requirement
- SubSreq
Major
- Requirement
Parsing student id and name are easy, but parsing requirements that student has completed and computing how many courses away from completion from degreework is hard.
basic structure
1,
rule
/ | \ \
requirement rule rule ... (mutiple rules)
(self-defining tag
describing how many
rules to pick)
2,
rule
/ | \
classes_applied ... requirement (attr : classes_begin)
/ | \
course course ...