A React application for testing PocketBase OAuth2 authentication with Google, Apple, and Spotify.
-
Clone the repository:
git clone git@github.com:luizcieslak/shelf.git cd shelf -
Install dependencies:
pnpm install
-
Set up environment variables:
cp .env.example .env
Edit
.envand set your PocketBase URL (default:http://127.0.0.1:8090) -
Start the development server:
pnpm dev
To test OAuth2 authentication, you'll need to configure your PocketBase instance:
-
Start PocketBase:
./pocketbase serve
-
Configure OAuth2 providers in PocketBase admin:
- Navigate to
http://127.0.0.1:8090/_/ - Go to Settings β Auth providers
- Configure the following providers:
- Navigate to
- Client ID: Your Google OAuth2 client ID
- Client Secret: Your Google OAuth2 client secret
- Redirect URL:
http://127.0.0.1:8090/api/oauth2-redirect
- Client ID: Your Apple OAuth2 client ID
- Client Secret: Your Apple OAuth2 client secret (or private key)
- Redirect URL:
http://127.0.0.1:8090/api/oauth2-redirect
- Client ID: Your Spotify OAuth2 client ID
- Client Secret: Your Spotify OAuth2 client secret
- Redirect URL:
http://127.0.0.1:8090/api/oauth2-redirect
- Modern React 18 with TypeScript
- Tailwind CSS for styling
- PocketBase SDK integration
- OAuth2 authentication for:
- Apple
- Spotify
- Responsive login screen
- User session management
src/
βββ components/
β βββ LoginScreen.tsx # Main login component with OAuth2 buttons
βββ App.tsx # Main app component with auth state
βββ main.tsx # React entry point
βββ index.css # Tailwind CSS imports