A full-stack application that integrates with Google Calendar API using Next.js frontend and Golang backend.
- Google OAuth authentication
- Access token management
- Google Calendar API integration
- Recent calendar events display
- アプリ一覧ページ
- ngrokを使ってhttpsで起動できるようにする
- Slackのアプリを作成する
- Incoming Webhooksをonにする
- Manage DistributionをPublic Distributionにする
- Redirect URLsも設定とOAuth Tokensをonにする
- Client IDとClient Secretを取得する
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API
- Create OAuth 2.0 credentials:
- APIとサービスの認証情報にアクセス
- Application type: Web application
- Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Note down the Client ID and Client Secret
cd frontend
npm install
Create .env.local
file:
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key-here
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
cd backend
go mod tidy
Terminal 1 (Frontend):
cd frontend
npm run dev
Terminal 2 (Backend):
cd backend
go run main.go
- Open http://localhost:3000
- Click "Sign in with Google"
- Authorize the application
- Click "Fetch Calendar Data" to retrieve recent calendar events
GET /api/calendar
- Fetch calendar events (requires Bearer token)
- Frontend: Next.js, NextAuth.js, TypeScript, Tailwind CSS
- Backend: Go, Gin, Google Calendar API
- Authentication: Google OAuth 2.0