Software & Apps

ThReinecke/dutch_vocabulary: Set up the AWS infrastructure to send an automated email every day with three C1 level Dutch words, their translations, and examples.

This project automates the daily delivery of an email with three C1 level Dutch words, their English translations, and example sentences. The email looks like this:

Email screenshot

I did this project because I couldn’t find a suitable app that would help me build a C1 level Dutch vocabulary. I discovered that ChatGPT provides good word suggestions and decided to automate the process. Plus, I find that I check emails more often than apps, which makes this method more effective for learning.

This project also provided an opportunity to refresh my skills in Terraform and Python.

A CloudWatch Event Rule will trigger a Lambda every morning at 7:00. Lambda retrieves all previously sent Dutch words from DynamoDB. It then fetches the three new words from ChatGPT, stores them in DynamoDB, and sends them to SES. SES delivers them to the end user’s email.

Architectural drawing

To deploy this project, make sure the following tools and configurations are in place:

  1. Installed tools:

    • Python (Tested with Python 3.8)
    • pip (Tested with pip 19.2.3)
    • Terraform (Tested with Terraform 1.10.3)
    • AWS CLI (Tested on 2.15.58)
  2. Permissions:
    Your AWS CLI user must have the appropriate permissions to deploy resources. Look at the Terraform files and use the principle of least privilege.

  3. Amazon SES Verified Email:
    You need a verified Amazon SES email address. This email should match the one used in the project.
    Reference: Verifying Amazon SES Email Addresses.

  4. Optional:
    You can zip the Lambda deployment package manually if you prefer:

    • Use what is provided setup.sh script or follow the script steps manually (may need small changes if on Mac/Linux)
    • Alternatively, use the pre-zipped package: deployment_package.zip.
  1. Preparing the Configuration:

    • Copy terraform.tfvars.example on terraform.tfvars.
    • Fill in the required values ​​in the terraform.tfvars.
  2. Run the Terraform Workflow:

    terraform init
    terraform plan
    terraform apply

This project is intended as a weekend projectso there is room for improvement. Potential additions include:

  • Refactoring Python code to be asynchronous for better performance and stability.
  • Division of lambda_function.py file into smaller modules for better organization and maintainability.

However, since the project has served its purpose and is unlikely to evolve further, I have kept the implementation simple.


https://opengraph.githubassets.com/a18b44b98f296c7c90097215f36a828cf694b88a99db6b9d616abba145ef925e/ThReinecke/dutch_vocabulary

2024-12-27 13:05:00

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button