Skip to content

coloradocollective/HomeWork-5

Repository files navigation

Negotiator

An app that helps you to practice negotiations with ChatGPT.

Exercise

  • Deploy your app to a cloud platform (like GCP's Cloud Run).
  • Use a GitHub actions pipeline to automatically deploy.
  • Also deploy your app to a production environment after it has deployed to your staging environment.

Architecture

Negotiator is a server side rendered app using Flask. It uses Lit to create web components to add dynamic capabilities to each page. Lit web components are developed and tested in the web components directory, and build Javascript and CSS artifacts are copied to the Flask app's static directory. This approach allows for the simplicity of server side rendered app with the dynamic features of a single page app.

Build and run

  1. Install uv and dependencies.

    brew install uv nodejs postgresql@14
    brew services run postgresql@14
    make install
  2. Set up the environment.

    cp .env.example .env
    vi .env
    source .env
  3. Set up the database.

    psql postgres < databases/drop_and_create_databases.sql
    make migrate migrate-test
  4. Build the frontend and watch for changes.

    make web-components/watch
  5. Run the fake oauth server in a separate terminal.

    make fake-auth/run
  6. Run the app in a separate terminal.

    source .env
    make negotiator/run
  7. Run tests.

    make test

Run with Docker

  1. Build container

    make web-components/build
    uv pip compile pyproject.toml -o requirements.txt
    docker build -t negotiator . 
  2. Run with docker

    docker run -p 8081:8081 --env-file .env.docker negotiator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published