This is a FastAPI application for managing calendar events with Google Calendar integration, Redis Cloud for data storage, and Ngrok for public access. The application allows users to book appointments, which automatically appear both in the workers' and requestors google calendars.
- FastAPI for the backend
- Google OAuth2 for calendar access
- Redis Cloud for data storage
- Ngrok for secure public URLs
- Dockerized for easy deployment
- Docker
- Ngrok account
- Redis Cloud account
- Google Cloud Platform project for OAuth2 credentials
├── .dockerignore
├── .env
├── Dockerfile
├── credentials.json
├── entrypoint.sh
├── main.py
├── redis_db.py
├── requirements.txt
├── static/
│ └── favicon.ico
├── templates/
│ ├── frontend.html
│ ├── no_pending_requestors.html
│ ├── target_confirmation.html
│ └── waiting_page.html
└── .venv/
git clone https://github.com/your-username/your-repo.git
cd your-repo
Sign up for a Redis Cloud account at Redis Cloud. Create a new Redis database. Note down the Redis host, port, and password.
Sign up for an Ngrok account at Ngrok. Get your authtoken from the Ngrok dashboard. Run the following command to set up Ngrok with your authtoken:
ngrok authtoken YOUR_AUTHTOKEN
Go to the Google Cloud Console. Create a new project. Enable the "Google Calendar API" for the project. Create OAuth 2.0 credentials. Download the credentials.json file and place it in the project root directory.
Create a .env file in the project root directory and add the following environment variables:
env
REDIS_HOST=your-redis-host
REDIS_PORT=your-redis-port
REDIS_PASSWORD=your-redis-password
NGROK_TARGET_URL=https://your-ngrok-subdomain.ngrok-free.app/callback/target
NGROK_REQUESTOR_URL=https://your-ngrok-subdomain.ngrok-free.app/callback/requestor
Build the Docker Image
docker build -t fastapi_app .
Run the Docker Container
docker run -d -p 8000:8000 --name fastapi_app --env-file .env fastapi_app
Open your browser and navigate to:
https://your-ngrok-subdomain.ngrok-free.app
Development
Running Locally
You can also run the application locally using a virtual environment:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload
Contributing
Fork the repository. Create a new branch (git checkout -b feature-branch). Make your changes. Commit your changes (git commit -am 'Add new feature'). Push to the branch (git push origin feature-branch). Create a new Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.