Implementation of a backend for a Walk In Clinic, part of the PROG8420 Programming for Big Data python course @ Conestoga college.
As of this writing, this project is live and deployed in the following URL.
- Frontend: https://wic-frontend.anvil.app/
- Backend: https://wic-backend.herokuapp.com/docs
The project is comprised of two parts, this main repo is the backend server, and the prog8420-wic-frontend
folder contains all the frontend code built with Anvil.
Run the following commands to run the project.
You can use virtualenvwrapper to create the virtual environment, or your desired environment manager.
# (Optional) create a virtual environment
mkvirtualenv walk-in-clinic
workon walk-in-clinic
# Install dependencies
pip install -r requirements.tx
# Runs the actual web server
uvicorn main:app --reload
The above will launch the server in the http://localhost:8000 address, you can access the swagger documentation by going to the /docs path.
Change directories to the prog8420-wic-frontend
folder and run the following commands.
cd prog8420-wic-frontend
# (Optional) Create an env (virtualenvwrapper)
mkvirtualenv walk-in-clinic
workon walk-in-clinic
# (Optional) Install postgres, search docs for your specific operating system
# Install the Anvil app server
pip install anvil-app-server
anvil-app-server
The above will launch the frontend and make it accessible in http://localhost:3030.
The default users are populated once the server is started, and you can see temporary credentials in the logs of the application.
The default logins for the admin, a staff, and a doctor are:
-
admin
-
Username:
[email protected]
-
Password:
admin
-
staff
-
Username:
[email protected]
-
Password:
u^3Xm@opC_
-
doctor
-
Username:
[email protected]
-
Password:
*a)BANYr*2
This may happen in any operating system, below are instructions for the known ones.
Copy the postgres binaries from your installation, to the folders indicated below. This will allow Anvil to run the integrated postgresdb with binaries compiled for your platform.
cp $(which postgres) .anvil-data/db-bin/PG-2c0c4f55a015ab253337e3d05ca5fd21/bin
cp $(which initdb) .anvil-data/db-bin/PG-2c0c4f55a015ab253337e3d05ca5fd21/bin
cp $(which pg_ctl) .anvil-data/db-bin/PG-2c0c4f55a015ab253337e3d05ca5fd21/bin
Postgres can be installed as a service in macOS with brew.
brew install postgresql
# Start it with the systme
brew services start postgresql
A common error could appear when trying to install the anvil-app-server
dependency related to the following message:
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output
Follow the instructions in this article to know how to proceed.