This application demonstrates user authentication with Google OAuth and provides two storage options for user data:
- Google Drive Storage - Save data to the user's Google Drive (requires authentication)
- User Local Storage - Save data directly to the user's computer (no authentication required)
- Node.js 18.17 or later
- A Google Cloud project with OAuth credentials
- Python3 with uvicorn & fastapi
- Ollama
-
Clone the repository
-
Install dependencies:
npm install
-
Create a
.env.localfile in the root directory with the following variables:NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=your-nextauth-secret-key-minimum-32-chars # Google OAuth GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret -
Get Google OAuth credentials:
- Go to Google Cloud Console
- Create a new project (or use an existing one)
- Navigate to "APIs & Services" > "Credentials"
- Create OAuth client ID credentials
- Add
http://localhost:3000/api/auth/callback/googleas an authorized redirect URI - Copy the Client ID and Client Secret to your
.env.localfile
Run the development server:
npm run dev- To run the backend llm:
uvicorn app:app --reloadOpen http://localhost:3000 in your browser.
- Google Authentication: Sign in with Google to access Google Drive storage
- Storage Selection: Choose between Google Drive and local browser storage
- Persistent Storage Preference: The app remembers your storage choice
- Simple Demo Interface: Test saving and loading data with different storage methods
- Next.js
- NextAuth.js for authentication
- Tailwind CSS for styling
- TypeScript for type safety
- Google Drive API for cloud storage