{"id":16253035,"url":"https://github.com/digitsensitive/birthday-reminder-cs50","last_synced_at":"2026-05-08T15:05:17.193Z","repository":{"id":37586581,"uuid":"499252715","full_name":"digitsensitive/birthday-reminder-cs50","owner":"digitsensitive","description":"Final Project for CS50x 2022","archived":false,"fork":false,"pushed_at":"2022-06-22T16:24:29.000Z","size":6543,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T12:50:33.587Z","etag":null,"topics":["apscheduler","cs50","cs50x","flask","harvard-university","harvardcs50","mysql","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitsensitive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-02T18:48:46.000Z","updated_at":"2023-06-27T21:00:06.000Z","dependencies_parsed_at":"2022-08-25T14:52:09.049Z","dependency_job_id":null,"html_url":"https://github.com/digitsensitive/birthday-reminder-cs50","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/digitsensitive/birthday-reminder-cs50","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitsensitive%2Fbirthday-reminder-cs50","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitsensitive%2Fbirthday-reminder-cs50/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitsensitive%2Fbirthday-reminder-cs50/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitsensitive%2Fbirthday-reminder-cs50/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitsensitive","download_url":"https://codeload.github.com/digitsensitive/birthday-reminder-cs50/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitsensitive%2Fbirthday-reminder-cs50/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271901702,"owners_count":24841121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apscheduler","cs50","cs50x","flask","harvard-university","harvardcs50","mysql","python"],"created_at":"2024-10-10T15:15:45.112Z","updated_at":"2026-05-08T15:05:12.141Z","avatar_url":"https://github.com/digitsensitive.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Birthday reminder\n\n## Video Demo: https://www.youtube.com/watch?v=_YgHf4D31kQ\u0026t=4s\n\n## Description:\n\nBirthday Reminder is a web application written in Python and Flask.\nAdd birthdays of friends and family members easily and get email reminders automatically.\n\nUntil now, the birthdays of my friends and family were recorded in my personal\ncalendar. The problem was that I could not set reminders as I wanted and that my\ncalendar was overfilled by these entries. Therefore, I wanted to write an\napplication that would take care of the birthdays specifically and send me\ncorresponding early reminders.\n\nFrom the technology side, I was interested in trying Python and Flask as an\nalternative to Javascript and Node.js. I also wanted to use Docker for the first\ntime for my own project.\n\nThe original plan was to host the Docker containers on Amazon. During the\ndevelopment I decided to rather install it locally on my Raspberry Pi. This gave\nme the opportunity to get to know Ubuntu Server for the first time.\n\nThe project itself contains the following main files:\n\n- `app.py`: Main project source code\n- `database.py`: Setup of the database using the mysql-connector library\n- `helpers.py`: Helpers functions\n- `scheduler.py`: Setup of the background scheduler using the apscheduler library\n\nIn the templates folder you find all the html templates.\nIn the static folder you find the favicon, the main logo of the applications and\nthe css styles.\n\nImportant: To make the application work, you have to create an `app.env` and\n`database.env` file in the root folder.\n\nThe `app.env` file must define the following configuration values:\n\n```\nBR_FLASK_ENV = 'development'\nBR_SESSION_TYPE = 'filesystem'\nBR_SESSION_PERMANENT = False\nBR_MAIL_SUBJECT = 'Birthday Reminder'\nBR_MAIL_SERVER = 'smtp.gmail.com'\nBR_MAIL_PORT = 465\nBR_MAIL_USE_SSL = True\nBR_MAIL_USERNAME = 'email.from.which.the.reminders.are.sent@gmail.com'\nBR_MAIL_PASSWORD = 'password'\n```\n\nThe `database.env` file must define the following configuration value:\n\n```\nMYSQL_ROOT_PASSWORD = 'password'\n```\n\n# Notes\n\n## Docker\n\nhttps://docs.docker.com\n\n### Build image\n\nThe command `docker build` builds Docker images from a Dockerfile and a \"context\".\n\nThe build command optionally takes a `--tag` flag, which is used to set the name\nof the image. If you also want to set a tag simply use `name:tag`.\n\nExample 1 (Build Docker image only with tag flag):\n\n```\ndocker build --tag \u003cIMAGE_NAME\u003e .\n```\n\nExample 2 (Build Docker image with name and tag):\n\n```\ndocker build --tag \u003cIMAGE_NAME\u003e:\u003cIMAGE_TAG\u003e .\n```\n\nWith `docker images` you can view local images.\n\nCreate a new tag for a local image:\n\n```\ndocker tag \u003cIMAGE_NAME\u003e:latest \u003cIMAGE_NAME\u003e:v1.0.0\n```\n\nThe tag points to the same image and is just another way to reference the image.\n\nRemove tag:\n\n```\ndocker rmi \u003cIMAGE_NAME\u003e:v1.0.0\n```\n\n### Run containers\n\nA container is a normal operating system process except that this process is\nisolated in that it has its own file system, its own networking, and its own\nisolated process tree separate from the host.\n\nRun image inside of a container:\n\n```\ndocker run -p 8000:5000 \u003cIMAGE_NAME\u003e\n```\n\n`-p` for short means `--publish`, which is important to set. We need to publish\na port for our container. The format is: `[host port]:[container port]`.\nSo in the upper example we expose port 5000 inside the container to port 8000\noutside of the container.\n\nNow you can connect to the application via:\n\n```\nlocalhost:8000\n```\n\nIf you start a web server, you don't have to be connected to the container. In this\ncase you can run the container in detached mode (in the backround) as follows:\n\n```\ndocker run -d -p 8000:5000 \u003cIMAGE_NAME\u003e\n```\n\n`-d` for short means `--detach`.\n\nTo name the container simple use the --name flag as follows:\n\n```\ndocker run -d -p 8000:5000 --name \u003cCONTAINER_NAME\u003e \u003cIMAGE_NAME\u003e\n```\n\nWith `docker ps` you can view local running containers.\nWith `docker ps --all` or `docker ps -a` you can view local containers.\nWith `docker stop \u003cCONTAINER_ID\u003e` or `docker stop \u003cCONTAINER_NAME\u003e` you can stop a running container.\nWith `docker rm \u003cCONTAINER_ID\u003e` or `docker rm \u003cCONTAINER_NAME\u003e` you can remove a container.\n\n### Create volumes\n\nSimply use the following command to create a new volume:\n\n```\ndocker volume create \u003cVOLUME_NAME\u003e\n```\n\n### Create network\n\nIf you want that your application and database can talk to each other, you need\nto create a network.\n\nSimply use the following command to create a new network:\n\n```\ndocker network create \u003cNETWORK_NAME\u003e\n```\n\n### Run MySQL in a container and attach to the volumes and network\n\nSince you only have the volume and not the image itself, Docker will pull the image\nfrom Hub and run it locally for you.\n\n```\ndocker run --rm -d \\\n-v mysql:/var/lib/mysql \\\n-v mysql_config:/etc/mysql \\\n-p 3306:3306 \\\n--network mysqlnet \\\n--name mysqldb \\\n-e MYSQL_ROOT_PASSWORD=p@ssw0rd1 \\\n\u003cIMAGE_NAME\u003e\n```\n\n\u003cIMAGE_NAME\u003e = mysql\n\nTo connect to the MySQL interactive terminal use the following command:\n\n```\ndocker exec -ti mysqldb mysql -u root -p\n```\n\nIf successfully connected navigate to database as follows:\n\n```\nUSE datbase_name;\n```\n\n### Add application container to the database network and run it\n\nThis allows us to access the database by its container name.\n\n```\ndocker run \\\n--rm -d \\\n--network mysqlnet \\\n--name rest-server \\\n-p 8000:5000 \\\n\u003cIMAGE_NAME\u003e\n```\n\nIf you do not want to pass all the parameters to the docker run command, you can\nuse a Compose file: For example `docker-compose.dev.yml`.\n\nAfter setting up a Compose file, you can simply run the following command:\n\n```\ndocker-compose -f docker-compose.yml up --build\n```\n\n## Python\n\n### Interactive Python interpreter\n\n\u003e Type `python3` in the terminal to start the prompt of the interactive Python interpreter\n\n### VS Code Setup\n\n- Select a Python interpreter (lower left)\n- Run `*.py` file with start button top right\n- F5 to start debugger\n\n### Virtual environment and package installation\n\n- Create and activate the virtual environment:\n  - Create: `python3 -m venv .venv`\n  - Activate: `source .venv/bin/activate`\n- Select your new environment by using the Python: Select Interpreter command from the Command Palette.\n- Install packages: `python3 -m pip install \u003cPACKAGE_NAME\u003e`\n- Use `pip list` to check which package are installed including information about the version\n- Once you are finished, type `deactivate` in the terminal window to deactivate the virtual environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitsensitive%2Fbirthday-reminder-cs50","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitsensitive%2Fbirthday-reminder-cs50","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitsensitive%2Fbirthday-reminder-cs50/lists"}