This repo contains an office hour queue.
- Python 3.11 (
pyenv
is recommended) pipenv
docker
anddocker-compose
- Node (>)10 (
nvm
is recommended) - Yarn
Navigate to /backend
. Then,
- (Initial setup)
- a.
pipenv install --dev
NOTE:
1. You might have to install openssl with Homebrew (brew install openssl
) and set the following environment variable for the linker.
export LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib"
.
If you run intoERROR: Couldn't install package: psycopg2
, see this post. If your problem is on M1, try the top 2 solutions here.
2. You might have to install postgresql viabrew install postgresql
. If you run into the errorpsql: FATAL: role "postgres" does not exist
, you also need to run:
createuser -s postgres
brew services restart postgresql
3. If you run into the error where you cannot installpsycopg2
due to postgres errors, you can try running:pip3 install psycopg2-binary --force-reinstall --no-cache-dir
- b.
pipenv shell
docker-compose up
(run this before doing any of the manage.py commands)- Migration commands to ensure your installation works:
If you are getting FATAL: role "postgres" does not exist
see this. See the comments of the answer for your specific case.
- a.
python manage.py migrate
- b.
python manage.py createsuperuser
- c.
python manage.py populate
to populate the database with dummy data - d. Ensure
python manage.py test
passes all tests.- Note: to run a specific test, you can run
python manage.py test tests.ohq.test_file.TestCase
. Note that you might have to run migrations or reinstall dependencies if the Pipfile or models have been changed upstream.
- Note: to run a specific test, you can run
python manage.py runserver 8000
- Documentation: localhost:8000/api/documentation
Navigate to /frontend
. Then,
- (Initial setup)
- a.
yarn install
yarn dev
Finally, you should be able to authenticate at localhost:8000/admin and use the application at localhost:3000! 🎉
Users from the populate script all have password pennlabs
.
- Run manually
- a. Navigate to
/frontend
- b.
yarn cypress open
- c. Click on
question.spec.ts