This web app predicts whether or not a marriage will last.
The project uses the following:
- Python 3
- TypeScript
- FastAPI
- NPM
- React
- Material-UI
- Vite
- Redis
- Nginx
- Certbot
- Docker
- Docker Compose
For additional information on project specifications, see
backend/Pipfile
for the backend server and
frontend/package.json
for the frontend respectively.
In the backend
directory, create a .env
file
that contains the following environment variables:
ALLOWED_HOSTS=localhost 127.0.0.1
CORS_ALLOW_ORIGIN_REGEX=^https?://(localhost|127\.0\.0\.1)$
REDIS_URL=redis://redis:6379
The frontend
directory must also have a .env
file
with the following variables:
VITE_API_URL=http://127.0.0.1
The URL should be the endpoint of the backend server.
The project uses Docker. Ensure Docker and Docker Compose are installed before continuing.
To build, run docker compose build
To run the web app, run docker compose up -d
, then
go to http://localhost using your web browser.
There are configurations already set up via cli.ini
in the certbot
directory.
To receive an SSL certificate using those configurations, run:
docker compose run --no-deps --rm certbot certonly -d [enter domain here]
Fill out the prompt, then configure Nginx to use the SSL certificate and domain.
To renew the SSL certificate and use the newest certificate, run:
docker compose run --no-deps --rm certbot renew && docker exec nginx nginx -s reload
NOTE: Ensure port 443 is exposed in docker-compose.yml
for HTTPS.