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.
- Docker
- GCloud account with project set up
- pipx installed with hatch
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.
gcloud init
gcloud auth application-default login
- Setup a Service Account
- Enable VertexAI API on your project
- Use
gcloud config set project PROJECT_ID
- Install the packages using hatch
hatch shell
- Run the flask app using
flask run
or use the docker containerdocker run coverletter
Install the development environment using hatch: hatch -e dev shell
Afterwards you can think about other things.
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.
- Get yourself a VM in the google cloud. It needs to have HTTP and HTTPS enabled.
- Access the VM using ssh in the gcp console.
sudo apt-get install git python3-pip python3 python3-venv python3-dev postfix nginx
- Go to
https://dev.mysql.com/downloads/repo/apt/
and look for the version sudo wget https://dev.mysql.com/get/<version>.deb
e.g. mysql-apt-config_0.8.15-1_all.debsudo dpkg -i <version>.deb
and make sure to accept the default configurationsudo apt-get install mysql-server
(this may fail don't worry just do the next two steps)sudo apt update
sudo apt-get install mysql-server mysql-client libmysqlclient-dev
acceptingsudo service mysql status
to look at the status, usesudo service mysql start
to restart if necessary- Clone the repo
cd coverletter.ai && python3 -m venv venv && source venv/bin/activate && pip install .
- 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 - Setup mysql
sudo mysql -u root
create database coverletter character set utf8 collate utf8_bin;
create user 'coverletter'@'localhost' identified by '<db-password>';
grant all privileges on coverletter.* to 'coverletter'@'localhost';
flush privileges;
quit;
flask init-db
- Setup nginx by copying the config in
./nginx/default.conf
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.