Skip to content

Commit

Permalink
added deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
April Xie committed Aug 26, 2020
1 parent 8b4e93b commit 7529ac5
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Simmons DB
**A temporary deployed version of the DB can be found here: https://temp-sdb-2020.herokuapp.com/**
This project is an attempt to completely re-write, with all its existing
functionality, the database system and interface used in Simmons Hall at MIT. These
include, but are not limited to,
Expand Down Expand Up @@ -63,7 +64,7 @@ the codebase: https://www.django-rest-framework.org/
To get your environment set up for local development, perform for the following actions in the specified order
1. Navigate to the `frontend` directory.
2. Run `yarn install`. This installs the packages necessary for the frontend site.
3. Navigate to the `backend` directory.
3. Navigate to the root directory.
4. Optionally create a Python venv and activate it (recommended). To do this, run `python -m venv PATH_TO_YOUR_VENV`
followed by `source PATH_TO_YOUR_VENV/bin/activate`. `PATH_TO_YOUR_VENV` can be anywhere on your machine; note that
venv paths cannot contain spaces. Make sure the Python version in this venv satisfies the requirements above.
Expand All @@ -74,15 +75,21 @@ given username and password that can be used to log into the site with.
7. Run `python manage.py setadmin YOUR_USERNAME` where `YOUR_USERNAME` was the username you used in the previous
step. This adds your account to the `Administrator` group on the DB.
8. Run `python manage.py initdb`. This does two things:
1. Creates all the `Room` and `Section` objects needed for the DB. This data comes from `backend/data/room_sections.csv`.
2. Creates an account on the DB for every row (user) in `backend/data/sample_user_csv.csv`. This is all dummy data.
1. Creates all the `Room` and `Section` objects needed for the DB. This data comes from `data/room_sections.csv`.
2. Creates an account on the DB for every row (user) in `data/sample_user_csv.csv`. This is all dummy data.

Once you perform these actions, to get the development servers running you need to
1. Run `yarn start` from the `frontend` directory to get the frontend development server (React) started.
2. In a separate terminal, run `python manage.py runserver` from the `backend` directory to get the backend server
2. In a separate terminal, run `python manage.py runserver` from the root directory to get the backend server
(Django) started.
3. Navigate to http://localhost:3000/ in your browser.

## Deploying to Heroku
Currently the DB is being hosted temporarily using Heroku's free tier. To deploy changes to Heroku, complete the following steps:
1. First make sure you have Heroku installed
2. Commit your changes
3. Run `git push heroku branch:master` and replace branch with your current local branch.

## TODOS
* Add ability to login with MIT Certificates. This should use the same middleware pipeline and work in
tandem with the regular username/password login.
Expand Down

0 comments on commit 7529ac5

Please sign in to comment.