A modern deployment platform for Minecraft plugins, built with Next.js 14, Firebase, and GitHub integration. This application allows developers to authenticate with GitHub, import their repositories, and manage deployments with a beautiful, Vercel-inspired UI.
- GitHub Authentication: Secure authentication using Firebase Auth with GitHub OAuth
- Repository Management: Browse and import your GitHub repositories
- Real-time Search: Filter repositories by name or description
- Project Dashboard: Manage all your imported projects in one place
- Modern UI: Beautiful, responsive design with Tailwind CSS
- Server Actions: Secure API calls using Next.js Server Actions
- Type Safety: Full TypeScript support throughout the application
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Authentication: Firebase Authentication (GitHub Provider)
- Database: Cloud Firestore
- Styling: Tailwind CSS v4
- Icons: Lucide React
- Date Formatting: date-fns
- State Management: React Context API
Before you begin, ensure you have:
- Node.js 18+ installed
- A Firebase project with Firestore and Authentication enabled
- A GitHub OAuth App configured in Firebase
- Firebase Admin SDK service account credentials
git clone <your-repo-url>
cd mcp-frontend
npm install- Go to Firebase Console
- Create a new project or select an existing one
- Enable Authentication and add GitHub as a sign-in provider
- Enable Cloud Firestore database
- In Firebase Console, go to Authentication > Sign-in method
- Enable GitHub provider
- Copy the callback URL provided by Firebase
- Go to GitHub Developer Settings
- Create a new OAuth App with:
- Authorization callback URL: Use the Firebase callback URL
- Scopes: Make sure to request
repoandread:userscopes
- Copy the Client ID and Client Secret to Firebase
-
In Firebase Console, go to Project Settings > Service Accounts
-
Click Generate New Private Key
-
Save the JSON file securely
-
Convert to base64 (optional):
cat service-account.json | base64 -w 0
Create a .env.local file in the root directory:
cp env.example.txt .env.localFill in your Firebase credentials:
# Firebase Public Client Config
NEXT_PUBLIC_FIREBASE_API_KEY="your-api-key"
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="your-project.firebaseapp.com"
NEXT_PUBLIC_FIREBASE_PROJECT_ID="your-project-id"
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="your-project.appspot.com"
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="your-sender-id"
NEXT_PUBLIC_FIREBASE_APP_ID="your-app-id"
# Firebase Admin SDK (Choose one method)
# Method 1: Base64-encoded service account JSON (recommended for deployment)
FIREBASE_SERVICE_ACCOUNT_JSON_BASE64="your-base64-encoded-json"
# Method 2: Individual fields (easier for local development)
# FIREBASE_PROJECT_ID="your-project-id"
# FIREBASE_CLIENT_EMAIL="firebase-adminsdk-xxxxx@your-project.iam.gserviceaccount.com"
# FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"Deploy the security rules to your Firebase project:
# Install Firebase CLI if you haven't already
npm install -g firebase-tools
# Login to Firebase
firebase login
# Initialize Firebase in your project (if not already done)
firebase init firestore
# Deploy the rules
firebase deploy --only firestore:rulesnpm run devOpen http://localhost:3001 in your browser.
mcp-frontend/
βββ app/
β βββ actions/
β β βββ github.actions.ts # Server Actions for GitHub API
β βββ dashboard/
β β βββ page.tsx # Protected dashboard page
β βββ layout.tsx # Root layout with providers
β βββ page.tsx # Homepage with login
β βββ globals.css # Global styles
βββ components/
β βββ GitHubConnect.tsx # GitHub connection component
β βββ LoginButton.tsx # Login/logout button
β βββ RepoCard.tsx # Repository card component
βββ contexts/
β βββ AuthContext.tsx # Authentication context provider
βββ lib/
β βββ firebase/
β β βββ admin.ts # Firebase Admin SDK config
β β βββ client.ts # Firebase client config
β βββ api.ts # API utilities
βββ types/
β βββ index.ts # TypeScript type definitions
βββ firestore.rules # Firestore security rules
βββ env.example.txt # Environment variables template
βββ package.json
The application uses comprehensive Firestore security rules to protect user data:
- Public User Profiles: Read access for all, write access only for the owner
- Private Data: GitHub tokens stored in
users/{uid}/private/subcollection, accessible only by the owner - Projects: Users can only read, create, update, and delete their own projects
- Authentication Required: Most operations require authentication
- GitHub OAuth access tokens are securely stored in Firestore
- Tokens are stored in a private subcollection with strict security rules
- Server Actions verify Firebase ID tokens before accessing GitHub tokens
- Tokens are never exposed to the client
- Dark Mode: Modern dark theme with gradient accents
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Loading States: Skeleton loaders and loading indicators
- Error Handling: User-friendly error messages
- Search & Filter: Real-time repository search
- Hover Effects: Smooth transitions and hover states
Fetches all repositories for the authenticated user from GitHub API.
Parameters:
idToken: Firebase ID token for authentication
Returns: Array of GitHubRepo objects
Imports a GitHub repository as a project in Firestore.
Parameters:
idToken: Firebase ID tokenrepoData: Repository information (name, ID, clone URL, etc.)
Returns: Success status and project ID
Retrieves all projects for the authenticated user.
Parameters:
idToken: Firebase ID token
Returns: Array of project objects
- Push your code to GitHub
- Import the project in Vercel
- Add all environment variables from
.env.local - Deploy!
The application can be deployed to any platform that supports Next.js:
- Netlify
- AWS Amplify
- Google Cloud Run
- Railway
- Render
Make sure to set all environment variables in your deployment platform.
users/{uid}
- name: string
- email: string
- image: string
- githubUsername: string
- updatedAt: string
/private/github_token
- accessToken: string
- updatedAt: stringprojects/{projectId}
- userId: string
- repoName: string
- githubRepoId: string
- cloneUrl: string
- description: string
- branch: string
- status: 'Imported' | 'Building' | 'Deployed' | 'Failed'
- createdAt: string
- updatedAt: stringIf you see "GitHub token not found", try:
- Sign out and sign in again
- Check Firestore security rules are deployed
- Verify the GitHub OAuth scopes include
repoandread:user
Ensure your service account credentials are correctly formatted:
- Private key should have
\nfor newlines - Base64 encoding should be done without line wraps
Check:
- GitHub token is stored in Firestore
- Firebase Admin SDK is properly initialized
- Network requests are not blocked by CORS
MIT License - feel free to use this project for your own purposes.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues and questions, please open an issue on GitHub.
Built with β€οΈ using Next.js, Firebase, and TypeScript