A modern, aesthetic web application built with React, Vite, TypeScript, and Tailwind CSS that displays a countdown timer to your next upcoming Google Calendar event.
- Real-Time Countdown: Displays days, hours, minutes, and seconds to your next meeting.
- Event Details: Shows the summary and time of the upcoming event.
- Google Integration: seamless sign-in with your Google account.
- Responsive Design: Beautifully crafted UI that works on all devices.
- Dark Mode Support: Automatically adapts to system preferences (configurable).
- Node.js (v18 or higher)
- npm or pnpm
-
Clone the repository:
git clone https://github.com/yourusername/nextcal.git cd nextcal -
Install dependencies:
npm install # or pnpm install -
Configure Environment Variables (See section below).
-
Start the development server:
npm run dev
To make this app work with your real calendar, you need to obtain credentials from the Google Cloud Console.
- Go to the Google Cloud Console.
- Click the project dropdown at the top and select "New Project".
- Name your project (e.g., "NextCal Countdown") and click Create.
- In your new project, go to "APIs & Services" > "Library".
- Search for "Google Calendar API".
- Click on it and select Enable.
- Go to "APIs & Services" > "OAuth consent screen".
- Select External (unless you have a Google Workspace organization, then Internal is fine) and click Create.
- Fill in the required fields:
- App name: NextCal
- User support email: Your email
- Developer contact information: Your email
- Click Save and Continue.
- Scopes: Click Add or Remove Scopes.
- Search for
calendar.events.readonly. - Select existing
.../auth/calendar.events.readonlyscope. - Click Update and then Save and Continue.
- Search for
- Test Users (Important for "External" apps):
- Click Add Users.
- Add your own Google email address (and any others you want to test with).
- Note: Without this, you will get a 403 error during sign-in.
-
Go to "APIs & Services" > "Credentials".
-
Click Create Credentials and select OAuth client ID.
-
Application type: Web application.
-
Name: NextCal Web Client.
-
Authorized JavaScript origins:
- Add
http://localhost:5173(or your production URL).
- Add
-
Authorized redirect URIs:
- Add
http://localhost:5173(andhttp://localhost:5173/just to be safe).
- Add
-
Click Create.
-
Copy the Client ID (e.g.,
123456...apps.googleusercontent.com). -
(Optional but recommended for some flows) Create an API Key:
- Click Create Credentials > API Key.
- (Optional) Restrict the key to "Google Calendar API" and "HTTP referrers" (localhost:5173) for security.
- Copy the API Key.
- Copy the example environment file:
cp .env.example .env
- Open
.envand paste your credentials:(Note: If you didn't create an API Key, you can often leave it blank if using OAuth token primarily, but the current implementation expects it for initialization).VITE_GOOGLE_CLIENT_ID=your_pasted_client_id VITE_GOOGLE_API_KEY=your_pasted_api_key