Skip to content

Latest commit

Β 

History

History
92 lines (64 loc) Β· 2.36 KB

File metadata and controls

92 lines (64 loc) Β· 2.36 KB

πŸ“… Calendar Summary Service

This is a FastAPI-based web service that allows users to securely log in, link multiple Google Calendar accounts, and receive daily HTML summaries of their upcoming events. It's built to run locally with PostgreSQL and supports multiple users.

✨ Features

  • πŸ” User registration and login (with hashed passwords)
  • πŸ”„ Google OAuth2 login to link calendar accounts
  • πŸ—“οΈ Daily calendar summary using the Google Calendar API
  • πŸ“₯ Multi-account support per user
  • πŸ’Œ Email-ready HTML summaries
  • πŸ› οΈ Admin cron job support to email summaries automatically
  • πŸ—ƒοΈ PostgreSQL backend with SQLAlchemy
  • πŸ“¦ Token storage handled securely and excluded from Git

πŸš€ Tech Stack

πŸ› οΈ Local Setup

1. Clone the Repo

git clone https://github.com/AlexanderPW/Calendar-Service.git
cd Calendar-Service

2. Set Up Your Environment

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

3. Configure Environment

Create a .env file (if using) or edit db.py with your PostgreSQL credentials:

dbname="myappdb"
user="youruser"
password="yourpassword"
host="localhost"

Make sure you have a client_secret.json for Google API OAuth in the root folder.

4. Initialize the Database

python
>>> from db import Base, engine
>>> Base.metadata.create_all(bind=engine)
>>> exit()

5. Run the App

uvicorn main:app --reload

Open in browser: http://localhost:8000

πŸ§ͺ Cron Job (Optional)

To email summaries daily:

  • Create a cron job that runs a script which calls the /summary route or directly uses the generate_summary_html() function with user tokens from the database.

πŸ›‘οΈ Security

  • Google tokens are stored as .json files and excluded from Git via .gitignore.
  • Passwords are stored hashed using passlib[bcrypt].
  • No secrets are committed to GitHub.

🀝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

πŸ“„ License

MIT License Β© Alex Waldrop

calendar-service