Examples
This directory contains working examples demonstrating how to use the common package components.
Available Examples
Running Examples
Each example directory contains:
main.go - The example code
README.md - Specific instructions and setup
.env.example - Required environment variables
Quick Start
- Copy environment file:
cd examples/[example-name]
cp .env.example .env
# Edit .env with your configuration
- Run the example:
go run main.go
General Environment Variables
Most examples require these basic variables:
# Google Cloud (if using GCP features)
PROJECT_ID=your-project-id
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
# Authentication (if using auth features)
GOOGLE_OAUTH_CLIENT_ID=xxxxx.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=your-secret
ADMIN_EMAILS=admin@example.com
# Email (if using email features)
EMAIL_PROVIDER=local
SENDGRID_API_KEY=your-key
FROM_EMAIL=noreply@example.com
FROM_NAME=Example App
# Environment
ENVIRONMENT=development
DEBUG=true
Contributing Examples
When adding new examples:
- Create a new directory with a descriptive name
- Include
main.go, README.md, and .env.example
- Use only example.com domains and dummy data
- Document all required environment variables
- Test in both development and production modes
- Keep examples focused and simple
Security Notice
⚠️ IMPORTANT: This is a PUBLIC repository. Examples must:
- Use only example.com email addresses
- Never include real API keys or credentials
- Use dummy/placeholder data only
- Include .env in .gitignore
- Document security considerations
All examples are designed to work with mock data and can be safely shared publicly.