This project implements a spaced repetition learning system using Google Cloud Platform (GCP) services. It automatically selects a daily topic for study from a CSV file, updates the study schedule, and sends an email notification with the day's topic.
- Daily topic selection based on spaced repetition algorithm
- Automatic email notifications with the day's topic
- Cloud-based storage of study materials and progress
- Automated deployment and scheduling using GitHub Actions
- Python 3.9
- Google Cloud Functions
- Google Cloud Storage
- Google Cloud Scheduler
- SendGrid for email notifications
- GitHub Actions for CI/CD
- A Google Cloud Platform account with billing enabled
- A GitHub account
- A SendGrid account for sending emails
- Create a new GCP project or select an existing one
- Enable the following APIs in your GCP project:
- Cloud Functions API
- Cloud Scheduler API
- Cloud Storage API
- Artifact Registry API
- Create a service account with the following roles:
- Cloud Functions Developer
- Service Account User
- Artifact Registry Writer
- Pub/Sub Editor
- Cloud Scheduler Admin
- Generate and download a JSON key for this service account
- Fork or clone this repository to your GitHub account
- Go to your repository's Settings > Secrets and variables > Actions
- Add the following secrets:
GCP_PROJECT_ID
: Your Google Cloud project IDGCP_SA_KEY
: The content of the JSON key file for your service accountSENDGRID_API_KEY
: Your SendGrid API key
- Clone the repository to your local machine
- Install the required Python packages:
pip install -r requirements.txt
- Set up your
ML_Topics - Revisions.csv
file with your study topics
The project is set up to automatically deploy to Google Cloud Functions whenever changes are pushed to the main branch. The deployment process is managed by the GitHub Actions workflow defined in .github/workflows/deploy.yml
.
To trigger a deployment:
- Make your changes to the code
- Commit and push to the main branch
- GitHub Actions will automatically deploy the function and set up the Cloud Scheduler
Once deployed, the system will automatically:
- Select a topic daily based on the spaced repetition algorithm
- Update the CSV file in Google Cloud Storage with the new study schedule
- Send an email to your specified address with the day's topic
You don't need to manually trigger anything - the Cloud Scheduler will run the function daily at the specified time (default is 8:00 AM).
- To change the email scheduling time, modify the cron expression in the
deploy.yml
file - To adjust the spaced repetition algorithm, modify the
select_topic_and_send_email
function inmain.py
If you encounter issues during deployment:
- Check the GitHub Actions logs for detailed error messages
- Ensure all required APIs are enabled in your GCP project
- Verify that the service account has the necessary permissions
- Check that all required secrets are correctly set in your GitHub repository
Contributions to improve the project are welcome. Please follow these steps:
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to your branch
- Create a new Pull Request