Foliox is an AI-powered portfolio generator that automatically creates beautiful developer portfolios from GitHub profiles. It fetches your GitHub data, uses AI to generate professional summaries and highlights, and presents everything in a modern, responsive portfolio website.
yoursite.com/john-doe instead of yoursite.com/github-username)git clone https://github.com/KartikLabhshetwar/foliox
cd foliox
npm install
cp .env.example .env.local
Edit .env.local with your configuration:
# Required
GROQ_API_KEY=your_groq_api_key_here
API_KEYS=key1,key2,key3
DATABASE_URL=postgresql://user:password@host:port/database
# Optional
GITHUB_TOKEN=your_github_token
GITHUB_CLIENT_ID=your_github_oauth_client_id
GITHUB_CLIENT_SECRET=your_github_oauth_client_secret
NEXT_PUBLIC_SITE_URL=http://localhost:3000
CACHE_ENABLED=true
DEFAULT_CACHE_TTL=3600
DEBUG=false
NODE_ENV=development
npx prisma migrate dev
npx prisma generate
npm run dev
http://localhost:3000
Enter a GitHub username on the landing page to generate a portfolio.
foliox/
├── app/
│ ├── (portfolio)/
│ │ └── [username]/
│ │ └── page.tsx # Dynamic portfolio pages
│ ├── api/
│ │ ├── custom-url/ # Custom URL endpoints
│ │ │ ├── check/ # Check URL availability
│ │ │ └── register/ # Register custom URL
│ │ ├── user/
│ │ │ └── [username]/
│ │ │ ├── profile/ # GitHub profile with AI content
│ │ │ ├── projects/ # Featured projects
│ │ │ ├── about/ # About section
│ │ │ └── contributions/ # Contribution graph data
│ │ └── linkedin/
│ │ └── [username]/ # LinkedIn profile data
│ │ └── screenshot/
│ │ └── route.ts # Screenshot API endpoint
│ ├── layout.tsx # Root layout
│ └── page.tsx # Landing page
├── components/
│ ├── portfolio/ # Portfolio-specific components
│ │ ├── hero-section.tsx
│ │ ├── share-button.tsx # Share with custom URL creation
│ │ ├── projects-section.tsx
│ │ ├── project-image.tsx # Project screenshot component with fallback
│ │ └── ...
│ └── ui/ # Reusable UI components (Shadcn)
├── lib/
│ ├── config/
│ │ └── settings.ts # Environment configuration
│ ├── modules/
│ │ ├── github/ # GitHub API integration
│ │ │ ├── fetcher.ts # Profile and data fetching
│ │ │ ├── projects.ts # Project ranking algorithm
│ │ │ └── contributions.ts # Contribution graph
│ │ ├── ai/
│ │ │ └── generator.ts # AI content generation
│ │ └── linkedin/
│ │ └── fetcher.ts # LinkedIn integration
│ └── utils/
│ ├── cache.ts # Database-backed caching
│ ├── custom-url.ts # Custom URL utilities
│ ├── user.ts # Username validation
│ └── api-client.ts # API client wrapper
├── prisma/
│ └── schema.prisma # Database schema
└── types/ # TypeScript type definitions
GET /api/user/[username]/profile - Fetch GitHub profile with AI-generated bio and SEO metadataGET /api/user/[username]/projects - Get featured projects and language statisticsGET /api/user/[username]/about - Get AI-generated about sectionGET /api/user/[username]/contributions - Get contribution graph dataGET /api/user/[username]/prs-by-org - Get pull requests grouped by organizationPOST /api/custom-url/check - Check if a custom URL slug is availablePOST /api/custom-url/register - Register a custom URL for a GitHub usernameGET /api/linkedin/[username] - Fetch LinkedIn profile dataGET /api/screenshot - Capture screenshots of websites for project previewsurl (required): The URL to capturewidth (optional): Viewport width in pixels (default: 1280)height (optional): Viewport height in pixels (default: 800)format (optional): Output format - png, jpeg, or pdf (default: png)quality (optional): Image quality for JPEG, 1-100 (default: 80)fullPage (optional): Capture full page height (default: false)All API endpoints require an X-API-Key header (except when DEBUG=true). The API key must match one of the keys in the API_KEYS environment variable.
Users can create custom URLs for their portfolios instead of using their GitHub username. For example, instead of yoursite.com/github-username, they can use yoursite.com/john-doe.
The application uses PostgreSQL with Prisma ORM. The main models are:
Run migrations to set up the database:
npx prisma migrate dev
GROQ_API_KEY: Your Groq API key for AI generationAPI_KEYS: Comma-separated list of API keys for authenticationDATABASE_URL: PostgreSQL connection stringGITHUB_TOKEN: GitHub personal access token (increases rate limits and enables private repository access)CACHE_ENABLED: Enable/disable caching (default: true)DEFAULT_CACHE_TTL: Cache time-to-live in seconds (default: 3600)DEBUG: Bypass API key authentication (default: false)NODE_ENV: Environment mode (development/production/test)SCREENSHOT_API_URL: URL of the Screenshot API service (e.g., https://your-worker.workers.dev) - Required for live project screenshotsThe application uses a database-backed caching system for most endpoints:
The application can be deployed to any platform that supports Next.js:
npm run build to build the applicationnpx prisma migrate deploy to apply migrationsnpm startnpm run dev
npm run build
npm start
Create a new migration:
npx prisma migrate dev --name migration_name
Apply migrations in production:
npx prisma migrate deploy
npm run lint
Ensure all required environment variables are set in .env.local and that GROQ_API_KEY, API_KEYS, and DATABASE_URL are not empty.
Verify that the X-API-Key header matches one of the keys in the API_KEYS environment variable. Set DEBUG=true to bypass authentication during development.
Check the username spelling and ensure the GitHub user exists and is public. If you're rate-limited, add a GITHUB_TOKEN to increase your rate limit.
To enable users to access their private repositories:
http://localhost:3000 (or your production URL)http://localhost:3000/api/auth/callback/github (or your production callback URL)Copy the Client ID and generate a Client Secret
Set OAuth credentials in your environment:
env
GITHUB_CLIENT_ID=your_client_id_here
GITHUB_CLIENT_SECRET=your_client_secret_here
NEXT_PUBLIC_SITE_URL=http://localhost:3000
How it works:
Other users' portfolios will only show public repositories (as expected)
Server-side token (optional):
GITHUB_TOKEN for server-side operationsVerify your DATABASE_URL is correct and that the database is accessible. Ensure migrations have been run with npx prisma migrate dev.
Contributions are welcome. Please feel free to submit a Pull Request.
GNU General Public License v3.0 - see LICENSE file for details
$ claude mcp add foliox \
-- python -m otcore.mcp_server <graph>