A full-stack application that displays a yearly view of your Google Calendar events, built with Python FastAPI backend and React frontend.
- Google OAuth2 authentication
- Select from available Google Calendars
- Yearly calendar view with event indicators
- Color-coded events for different company meetings:
- Townhall (Yellow)
- Monthly Business Planning (Green)
- Leadership AMA (Red)
- Other events (Blue)
- Modern and responsive UI
- Secure backend handling of Google Calendar API
Before running the application, you need to set up your environment variables:
- Set up backend environment:
cp backend/.env.example backend/.envThen edit backend/.env to add:
- Your Google OAuth credentials (client ID and secret)
- A secure random string for the SECRET_KEY
- Other configuration options as needed
- Set up frontend environment:
cp frontend/.env.example frontend/.envThen edit frontend/.env to add your Google OAuth Client ID.
Once you have the Docker containers running, you can run the backend tests using:
docker exec -e PYTHONPATH=/app calendar-backend pytestThis will run all tests and show the test coverage report. The tests are run inside the Docker container, so you don't need a local Python environment.
The easiest way to run the application is using Docker:
- Clone the repository:
git clone https://github.com/padak/cal_yearly_view.git
cd cal_yearly_view-
Set up environment files as described in the Environment Setup section above.
-
Build and run with Docker Compose:
docker-compose up --buildThe application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
- Navigate to the backend directory:
cd backend- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Start the backend server:
uvicorn app.main:app --reload- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run dev- Create a project in Google Cloud Console
- Enable the Google Calendar API
- Configure the OAuth consent screen
- Create OAuth 2.0 credentials (Web application)
- Add authorized JavaScript origins:
http://localhost:5173
- Add authorized redirect URIs:
http://localhost:8000/api/v1/auth/callback
.
├── backend/
│ ├── app/
│ │ ├── api/
│ │ ├── core/
│ │ ├── models/
│ │ └── services/
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/
│ ├── src/
│ ├── public/
│ ├── Dockerfile
│ └── package.json
└── docker-compose.yml
- FastAPI (Python web framework)
- Google OAuth2 and Calendar API
- JWT for token management
- Pydantic for data validation
- Uvicorn for ASGI server
- React
- TypeScript
- Vite
- Styled Components
- date-fns
Once the backend is running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- The application uses environment variables for configuration. Make sure to set up your
.envfile correctly. - For development, you can run the backend and frontend separately.
- For production, use the Docker deployment option for better consistency and ease of deployment.
