This folder contains working integration examples.
go run ./examples/nethttp-basicNote: No token endpoint; minimal example showing middleware flow.
go run ./examples/gin-modularShows how to wire tenant and permission modules with storage/memory adapters.
go run ./examples/custom-db-adapterExample of mapping a custom DB schema to storage interfaces.
go run ./examples/social-loginShows social callback flow: provider exchange, account linking, access token issuance.
GOOGLE_CLIENT_ID=... GOOGLE_CLIENT_SECRET=... GOOGLE_REDIRECT_URL=... GOOGLE_AUTH_CODE=... go run ./examples/social-googleReal Google OIDC provider callback flow.
go run ./examples/refresh-rotationRefresh token rotation and reuse security flows.
go run ./examples/loggingFor production JSON format:
PAREVO_ENV=production go run ./examples/logginggo run ./examples/apikeyAPI key authentication. Tokens with pk_ or sk_ prefix are validated as API keys.
go run ./examples/tenant-ratelimitTenant-based rate limiting. Use X-Tenant-Id header.
go run ./examples/permission-cacheCached permission store with TTL and invalidation on role changes.
go run ./examples/totp-mfaTOTP 2FA setup and verification with pquerna/otp.
go run ./examples/admin-panelAdmin panel at http://localhost:8086/admin. Login required: visit /login, use admin / admin123 (demo). Only users with admin:* permission can access. Manage tenants, permissions, sessions.
go run ./examples/notificationUnified notification: email, SMS, WebSocket via notification.Sender interface. Uses notification/memory for dev/test.
go run ./examples/blobObject storage: Put, Get, List, Delete. Uses blob/memory for dev/test. Swap to blob/s3 or blob/r2 for production.
# Apply schema first: mysql -u root -p parevo < storage/mysql/schema.sql
MYSQL_DSN="user:pass@tcp(localhost:3306)/parevo?parseTime=true" go run ./examples/mysql-storageMySQL storage adapter: TenantStore, PermissionStore, SessionStore, RefreshStore, SocialAccountStore. Runs on :8083.
MONGODB_URI="mongodb://localhost:27017" go run ./examples/mongodb-storageMongoDB storage adapter: same stores as MySQL. Collections auto-created. Runs on :8084.
go run ./examples/blacklist-logoutLogout with JWT blacklist. Login -> /me works -> logout -> /me returns 401. Runs on :8085.