Skip to content

Generate a cover letter based on the url of the application text and your applicant profile consisting of CV, motivation and previous cover letters etc.

License

Notifications You must be signed in to change notification settings

5pirit5eal/coverletter.ai

Repository files navigation

coverletter.ai

Generate a cover letter based on the url of the application text and your applicant profile consisting of CV, motivation and previous cover letters etc.

Prerequisites

  1. Docker
  2. GCloud account with project set up
  3. pipx installed with hatch

How do i run it?

This tool uses the gcloud api. Therefore certain steps need to be taken before being able to use googles API. This installation expects you to already have a Google Cloud account and project set up.

  1. gcloud init
  2. gcloud auth application-default login
  3. Setup a Service Account
  4. Enable VertexAI API on your project
  5. Use gcloud config set project PROJECT_ID
  6. Install the packages using hatch hatch shell
  7. Run the flask app using flask run or use the docker container docker run coverletter

How do i develop it for my usecase?

Install the development environment using hatch: hatch -e dev shell Afterwards you can think about other things.

How do i migrate the database from one version of the schema to the next?

This app relies on the database migration tool flask_migrate. It uses alembic to generate migration scripts.

  • To init your database use flask db init.
  • To create a migration commit use flask db migrate -m your_message
  • To upgrade your database to a commit use flask db upgrade. This will use the newest commit state by default.
  • To downgrade your database use flask db downgrade. This will undo the last migration step.

How do i deploy it without docker?

  1. Get yourself a VM in the google cloud. It needs to have HTTP and HTTPS enabled.
  2. Access the VM using ssh in the gcp console.
  3. sudo apt-get install git python3-pip python3 python3-venv python3-dev postfix nginx
  4. Go to https://dev.mysql.com/downloads/repo/apt/ and look for the version
  5. sudo wget https://dev.mysql.com/get/<version>.deb e.g. mysql-apt-config_0.8.15-1_all.deb
  6. sudo dpkg -i <version>.deb and make sure to accept the default configuration
  7. sudo apt-get install mysql-server (this may fail don't worry just do the next two steps)
  8. sudo apt update
  9. sudo apt-get install mysql-server mysql-client libmysqlclient-dev accepting
  10. sudo service mysql status to look at the status, use sudo service mysql start to restart if necessary
  11. Clone the repo
  12. cd coverletter.ai && python3 -m venv venv && source venv/bin/activate && pip install .
  13. Create a .env file where you specify the FLASK_SQLALCHEMY_DATABASE_URI=mysql+pymysql://coverletter:<db-password>@localhost:3306/coverletter, FLASK_APP=src/coverletter and the SECRET_KEY
  14. Setup mysql
    1. sudo mysql -u root
    2. create database coverletter character set utf8 collate utf8_bin;
    3. create user 'coverletter'@'localhost' identified by '<db-password>';
    4. grant all privileges on coverletter.* to 'coverletter'@'localhost';
    5. flush privileges;
    6. quit;
  15. flask init-db
  16. Setup nginx by copying the config in ./nginx/default.conf

Notes

The structure of this app was inspired by https://flask.palletsprojects.com/en/3.0.x/tutorial/layout/ and https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world.

About

Generate a cover letter based on the url of the application text and your applicant profile consisting of CV, motivation and previous cover letters etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages