TigerPath is a web app that helps Princeton University students plan out their four-year course schedules. It began as a COS 333 project by Richard Chu, Barak Nehoran, Adeniji Ogunlana, and Daniel Leung.
You can visit TigerPath at tigerpath.io.
To learn about contributing to TigerPath, take a look at the contributing guidelines.
-
git clonethis repository. Install Python 3.6, node.js, and pipenv (which helps you manage your dependencies). -
Run
cd tigerpath && pipenv installto install all of the current dependencies from Pipfile.lock. -
Run
cd frontend && npm installto install the necessary node modules for React to work. -
Run
cd .. && cp .env-example .env. Then, set the environment variables in your.envfile; specifically, you should replace the value ofDATABASE_URLwith the proper database URL for your Postgres server. You should also fill in theTIGERBOOK_USERNAMEandTIGERBOOK_API_KEYfields if you want the prepopulation of the user's year and major in the onboarding flow to work (you can get a TigerBook API key by following the instructions here). -
You can start a server with the environment variables in the file
.envby runningpipenv run python manage.py runserver. For development, run the webpack server (React) along with the Django server by callingnpm startin the folder "frontend". Then you can navigate tohttp://localhost:8000/to see the app.
Note: this installation method is not recommended because you have to re-build and re-run for every change you make.
-
git clonethis repository.cdinto the directory you just cloned. -
Install the Docker Community Edition. Make sure you also have Docker Compose installed (should be automatically installed on Windows and Mac).
-
Run
cp .env-example .env. Then, set the environment variables in your.envfile; specifically, you should replace the value ofDATABASE_URLwith the proper database URL for your Postgres server. You should also fill in theTIGERBOOK_USERNAMEandTIGERBOOK_API_KEYfields if you want the prepopulation of the user's year and major in the onboarding flow to work (you can get a TigerBook API key by following the instructions here). -
Use the following commands to build your project and run it on a local server:
docker-compose build # Build code changes docker-compose up # Run a local server at http://localhost:8000 docker-compose down # Stop the server
If you're using pipenv and you want to run one of the following commands, you should prefix it with pipenv run to make sure you're using the settings in your .env file. You can also run pipenv shell, which allows you to run the commands directly without prefixing.
If you're using Docker, then you can run any of the following commands by using docker exec -it [CONTAINER_NAME_OR_ID] [YOUR_COMMAND].
You can do this by running the following commands:
python manage.py makemigrations # Makes migrations based on models.py
python manage.py migrate # Migrates the database
If you're using Docker, then once you make the migration files, you should copy them from the container to the host (your local computer) by running docker cp <containerId>:/file/path/within/container /host/path/target. You should then push the migration files to Git.
python manage.py tigerpath_get_courses # Scrapes courses and puts them in the database
To load the major mappings fixture, which populates the major table in the database, run the following command:
python manage.py loaddata major_mappings
Heroku deploys are set up to happen automatically based on the code in GitHub. You shouldn't need to deploy manually.
However, in the rare case that you do, then you can run the following command:
git push heroku <local_branch_name>:master # Push to the Heroku server