From 65c300344e1d635e74c42264ecc282260e53d113 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:44:36 +0000 Subject: [PATCH 1/6] Initial plan From cc3fe9beca0dc9f6a5f354131b9cc7302f9ca39e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:50:55 +0000 Subject: [PATCH 2/6] Add deployment configuration files for Vercel Co-authored-by: CodrAyush <119109504+CodrAyush@users.noreply.github.com> --- .env.example | 23 ++++++ .gitignore | 2 + .vercelignore | 27 ++++++ DEPLOYMENT.md | 223 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 23 +++++- vercel.json | 5 ++ 6 files changed, 299 insertions(+), 4 deletions(-) create mode 100644 .env.example create mode 100644 .vercelignore create mode 100644 DEPLOYMENT.md create mode 100644 vercel.json diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..4b4a4ef --- /dev/null +++ b/.env.example @@ -0,0 +1,23 @@ +# Database Configuration +# PostgreSQL connection string +# Format: postgresql://username:password@host:port/database +DATABASE_URL="postgresql://username:password@localhost:5432/Bloghub" + +# Clerk Authentication +# Get these from https://dashboard.clerk.com +NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +CLERK_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + +# Clerk URLs (for development) +NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in +NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up +NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/ +NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/ + +# Root Domain Configuration +# For production: your-domain.com +# For development: localhost:3000 +NEXT_PUBLIC_ROOT_DOMAIN=localhost:3000 + +# Node Environment +NODE_ENV=development diff --git a/.gitignore b/.gitignore index e2764f9..8526a77 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ yarn-error.log* # env files (can opt-in for committing if needed) .env* +!.env.example + # vercel .vercel diff --git a/.vercelignore b/.vercelignore new file mode 100644 index 0000000..9bb791f --- /dev/null +++ b/.vercelignore @@ -0,0 +1,27 @@ +# Dependencies +node_modules +.pnp +.pnp.* + +# Testing +coverage + +# Misc +.DS_Store +*.pem + +# Debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# Local env files +.env*.local +.env + +# Vercel +.vercel + +# TypeScript +*.tsbuildinfo diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md new file mode 100644 index 0000000..b40674c --- /dev/null +++ b/DEPLOYMENT.md @@ -0,0 +1,223 @@ +# Deployment Guide for Publixy + +This guide will help you deploy the Publixy multi-tenant blog platform to Vercel. + +## Prerequisites + +Before deploying, ensure you have: + +1. A [Vercel](https://vercel.com) account +2. A [Clerk](https://clerk.com) account for authentication +3. A PostgreSQL database (recommended providers below) +4. Your repository pushed to GitHub + +## Database Setup + +You'll need a PostgreSQL database. Here are recommended providers: + +### Option 1: Vercel Postgres (Recommended) +1. Go to your Vercel dashboard +2. Navigate to Storage +3. Create a new Postgres database +4. Copy the `DATABASE_URL` connection string + +### Option 2: Neon (Serverless Postgres) +1. Sign up at [neon.tech](https://neon.tech) +2. Create a new project +3. Copy the connection string + +### Option 3: Supabase +1. Sign up at [supabase.com](https://supabase.com) +2. Create a new project +3. Get the connection string from Settings → Database + +### Option 4: Railway +1. Sign up at [railway.app](https://railway.app) +2. Create a new PostgreSQL database +3. Copy the connection string + +## Clerk Setup + +1. Go to [clerk.com](https://clerk.com) and sign up/login +2. Create a new application +3. In the dashboard, navigate to "API Keys" +4. Copy: + - `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` + - `CLERK_SECRET_KEY` +5. Configure OAuth providers (optional): + - Google, GitHub, etc. +6. Configure organization settings: + - Enable organizations in Settings → Organization + +## Deployment Steps + +### Step 1: Import Project to Vercel + +1. Go to [vercel.com/new](https://vercel.com/new) +2. Import your GitHub repository +3. Select the project + +### Step 2: Configure Environment Variables + +In the Vercel dashboard, add the following environment variables: + +``` +DATABASE_URL=postgresql://username:password@host:port/database +NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxx +CLERK_SECRET_KEY=sk_live_xxxxx +NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in +NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up +NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/ +NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/ +NEXT_PUBLIC_ROOT_DOMAIN=yourdomain.com +``` + +**Important:** +- Use your actual domain for `NEXT_PUBLIC_ROOT_DOMAIN` (e.g., `bloghub.com`) +- Make sure to use production keys from Clerk (starting with `pk_live_` and `sk_live_`) + +### Step 3: Configure Build Settings + +Vercel should auto-detect Next.js, but verify: +- **Framework Preset:** Next.js +- **Build Command:** `pnpm build` (or `npm run build`) +- **Output Directory:** `.next` +- **Install Command:** `pnpm install` (or `npm install`) + +### Step 4: Deploy + +1. Click "Deploy" +2. Wait for the build to complete (usually 2-3 minutes) + +### Step 5: Set Up Database Schema + +After first deployment: + +1. Install Vercel CLI locally: `npm i -g vercel` +2. Link your project: `vercel link` +3. Pull environment variables: `vercel env pull .env.local` +4. Push database schema: `pnpm db:push` + +Alternatively, you can: +- Use Drizzle Studio in production mode +- Run migration scripts from your local machine pointing to production DB + +### Step 6: Configure Custom Domain & Subdomains + +1. In Vercel dashboard → Settings → Domains +2. Add your custom domain (e.g., `yourdomain.com`) +3. Add wildcard subdomain: `*.yourdomain.com` +4. Configure DNS with your domain provider: + ``` + Type: A + Name: @ + Value: 76.76.21.21 + + Type: CNAME + Name: * + Value: cname.vercel-dns.com + ``` + +### Step 7: Update Clerk Configuration + +1. Go to your Clerk dashboard +2. Navigate to "Paths" or "URLs" +3. Update authorized domains to include: + - `yourdomain.com` + - `*.yourdomain.com` + +### Step 8: Test Your Deployment + +1. Visit your main domain +2. Create an organization in Clerk +3. Create a blog post +4. Test subdomain access: `org-slug.yourdomain.com` + +## Post-Deployment + +### Monitoring + +- Monitor application in Vercel dashboard +- Check logs for any errors +- Set up error tracking (e.g., Sentry) + +### Database Backups + +If using Vercel Postgres: +- Backups are automatic on paid plans +- For hobby plan, consider manual exports + +For other providers, configure automatic backups. + +### Updates + +To deploy updates: +1. Push changes to your GitHub repository +2. Vercel will automatically deploy from the main branch + +## Environment-Specific Settings + +### Production +```env +NODE_ENV=production +NEXT_PUBLIC_ROOT_DOMAIN=yourdomain.com +``` + +### Staging (Optional) +Create a separate Vercel project for staging: +```env +NODE_ENV=staging +NEXT_PUBLIC_ROOT_DOMAIN=staging.yourdomain.com +``` + +## Troubleshooting + +### Build Fails +- Check build logs in Vercel +- Verify all environment variables are set +- Ensure `package.json` has correct dependencies + +### Subdomain Not Working +- Verify wildcard DNS is configured +- Check middleware.ts is processing subdomains +- Ensure `NEXT_PUBLIC_ROOT_DOMAIN` matches your domain + +### Database Connection Issues +- Verify DATABASE_URL is correct +- Check database allows connections from Vercel IPs +- Ensure SSL is enabled if required + +### Authentication Issues +- Verify Clerk keys are production keys +- Check domain is added to Clerk dashboard +- Ensure redirect URLs are correct + +## Cost Estimation + +### Free Tier +- Vercel: Free tier available (100GB bandwidth) +- Clerk: Free up to 5,000 MAU +- Neon: Free tier with 3GB storage + +### Paid Plans +For production with higher traffic: +- Vercel Pro: $20/month +- Clerk Pro: Starts at $25/month +- Database: $10-50/month depending on usage + +## Additional Resources + +- [Vercel Documentation](https://vercel.com/docs) +- [Next.js Deployment](https://nextjs.org/docs/deployment) +- [Clerk Documentation](https://clerk.com/docs) +- [Drizzle ORM Documentation](https://orm.drizzle.team/docs/overview) + +## Support + +For issues specific to this application: +- Open an issue on GitHub +- Check existing documentation in README.md + +For platform-specific issues: +- Vercel Support: [vercel.com/support](https://vercel.com/support) +- Clerk Support: [clerk.com/support](https://clerk.com/support) diff --git a/README.md b/README.md index 85dbdd5..2d8811e 100644 --- a/README.md +++ b/README.md @@ -162,11 +162,24 @@ CREATE TABLE blogs ( ## Deployment -### Vercel (Recommended) +### Quick Deploy to Vercel (Recommended) -1. Connect your repository to Vercel -2. Set up environment variables in Vercel dashboard -3. Deploy automatically on push to main branch +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/CodrAyush/BlogHub) + +For detailed deployment instructions, see **[DEPLOYMENT.md](./DEPLOYMENT.md)** which includes: +- Complete step-by-step deployment guide +- Database setup options (Vercel Postgres, Neon, Supabase, Railway) +- Environment variable configuration +- Custom domain and wildcard subdomain setup +- Troubleshooting tips + +### Quick Start + +1. Click the "Deploy with Vercel" button above +2. Set up required environment variables (see [.env.example](./.env.example)) +3. Configure your database +4. Set up Clerk authentication +5. Add wildcard domain for subdomains ### Other Platforms @@ -176,6 +189,8 @@ The app can be deployed to any platform that supports Next.js: - DigitalOcean App Platform - AWS Amplify +See [DEPLOYMENT.md](./DEPLOYMENT.md) for platform-specific instructions. + ## Contributing 1. Fork the repository diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..f0a5702 --- /dev/null +++ b/vercel.json @@ -0,0 +1,5 @@ +{ + "buildCommand": "pnpm build", + "installCommand": "pnpm install", + "framework": "nextjs" +} From 2825b212258d0351ac16926893aecf0b21392096 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:53:06 +0000 Subject: [PATCH 3/6] Add CI/CD, deployment tools, and contributing guide Co-authored-by: CodrAyush <119109504+CodrAyush@users.noreply.github.com> --- .github/workflows/ci.yml | 52 ++++++++++ CONTRIBUTING.md | 185 ++++++++++++++++++++++++++++++++++++ README.md | 8 ++ package.json | 3 +- scripts/deployment-check.sh | 92 ++++++++++++++++++ 5 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 CONTRIBUTING.md create mode 100755 scripts/deployment-check.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..67652e3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + + - name: Install dependencies + run: pnpm install + + - name: Run linter + run: pnpm lint + + type-check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + + - name: Install dependencies + run: pnpm install + + - name: Run TypeScript type checking + run: npx tsc --noEmit diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..906d8ce --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,185 @@ +# Contributing to Publixy (BlogHub) + +Thank you for your interest in contributing to Publixy! This document provides guidelines and instructions for contributing. + +## Development Setup + +### Prerequisites + +- Node.js 18 or higher +- pnpm (recommended) or npm +- PostgreSQL database +- Clerk account for authentication + +### Local Development + +1. **Clone the repository** + ```bash + git clone https://github.com/CodrAyush/BlogHub.git + cd BlogHub + ``` + +2. **Install dependencies** + ```bash + pnpm install + ``` + +3. **Set up environment variables** + ```bash + cp .env.example .env.local + ``` + + Fill in your actual values in `.env.local` + +4. **Start PostgreSQL** (if using Docker) + ```bash + docker-compose up -d + ``` + +5. **Push database schema** + ```bash + pnpm db:push + ``` + +6. **Run the development server** + ```bash + pnpm dev + ``` + +7. **Open your browser** + Navigate to [http://localhost:3000](http://localhost:3000) + +## Project Structure + +``` +BlogHub/ +├── app/ # Next.js app directory +│ ├── (root)/ # Authenticated routes +│ ├── (subdomain)/ # Public subdomain routes +│ └── api/ # API routes +├── components/ # React components +│ └── ui/ # UI components +├── db/ # Database schema and config +├── lib/ # Utility functions +├── public/ # Static assets +└── scripts/ # Utility scripts +``` + +## Development Workflow + +### Making Changes + +1. Create a new branch + ```bash + git checkout -b feature/your-feature-name + ``` + +2. Make your changes + +3. Test your changes + ```bash + pnpm lint + pnpm build + ``` + +4. Commit your changes + ```bash + git add . + git commit -m "Description of changes" + ``` + +5. Push to your fork + ```bash + git push origin feature/your-feature-name + ``` + +6. Create a Pull Request + +### Code Style + +- Follow the existing code style +- Run `pnpm lint` before committing +- Use TypeScript for type safety +- Write meaningful commit messages + +### Testing Subdomains Locally + +To test subdomain functionality locally: + +1. Edit your `/etc/hosts` file (or `C:\Windows\System32\drivers\etc\hosts` on Windows): + ``` + 127.0.0.1 test-org.localhost + 127.0.0.1 another-org.localhost + ``` + +2. Access subdomains at: + - http://test-org.localhost:3000 + - http://another-org.localhost:3000 + +## Database Changes + +When modifying the database schema: + +1. Update `db/schema.ts` +2. Generate migration (optional): + ```bash + pnpm db:generate + ``` +3. Push changes to database: + ```bash + pnpm db:push + ``` +4. Test your changes thoroughly + +## Available Scripts + +- `pnpm dev` - Start development server +- `pnpm build` - Build for production +- `pnpm start` - Start production server +- `pnpm lint` - Run ESLint +- `pnpm db:push` - Push schema to database +- `pnpm db:studio` - Open Drizzle Studio +- `pnpm db:generate` - Generate migrations +- `pnpm deploy:check` - Check deployment readiness + +## Deployment + +Before deploying: + +1. Run deployment check: + ```bash + pnpm deploy:check + ``` + +2. Review [DEPLOYMENT.md](./DEPLOYMENT.md) for deployment instructions + +## Submitting Issues + +When submitting issues, please: + +- Check if the issue already exists +- Provide a clear title and description +- Include steps to reproduce (for bugs) +- Include screenshots if applicable +- Specify your environment (OS, Node version, etc.) + +## Pull Request Guidelines + +- Keep PRs focused on a single feature/fix +- Update documentation if needed +- Ensure all tests pass +- Follow the existing code style +- Reference related issues in the PR description + +## Questions? + +If you have questions: + +- Check the [README.md](./README.md) +- Review [DEPLOYMENT.md](./DEPLOYMENT.md) +- Open a discussion on GitHub +- Create an issue for bugs + +## License + +By contributing, you agree that your contributions will be licensed under the project's MIT License. diff --git a/README.md b/README.md index 2d8811e..9f53381 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,8 @@ See [DEPLOYMENT.md](./DEPLOYMENT.md) for platform-specific instructions. 4. Add tests if applicable 5. Submit a pull request +For detailed contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTING.md) + ## License MIT License - see LICENSE file for details @@ -206,3 +208,9 @@ MIT License - see LICENSE file for details ## Support For support, please open an issue in the GitHub repository or contact the development team. + +## Quick Links + +- 📖 [Deployment Guide](./DEPLOYMENT.md) +- 🤝 [Contributing Guide](./CONTRIBUTING.md) +- 📋 [Environment Variables](./.env.example) diff --git a/package.json b/package.json index 4cb158e..38af055 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "deploy:check": "bash scripts/deployment-check.sh" }, "dependencies": { "@clerk/nextjs": "^6.27.1", diff --git a/scripts/deployment-check.sh b/scripts/deployment-check.sh new file mode 100755 index 0000000..8d6e47e --- /dev/null +++ b/scripts/deployment-check.sh @@ -0,0 +1,92 @@ +#!/bin/bash + +# Deployment Readiness Checklist Script +# This script helps verify that your environment is ready for deployment + +echo "🚀 BlogHub Deployment Readiness Checklist" +echo "==========================================" +echo "" + +# Color codes +GREEN='\033[0;32m' +RED='\033[0;31m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +# Check if .env.local exists +echo -n "Checking for .env.local file... " +if [ -f .env.local ]; then + echo -e "${GREEN}✓${NC}" +else + echo -e "${RED}✗${NC}" + echo -e "${YELLOW}Warning: .env.local not found. Copy .env.example to .env.local${NC}" +fi + +# Check required environment variables +echo "" +echo "Checking required environment variables..." + +required_vars=( + "DATABASE_URL" + "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY" + "CLERK_SECRET_KEY" + "NEXT_PUBLIC_ROOT_DOMAIN" +) + +if [ -f .env.local ]; then + source .env.local 2>/dev/null + + for var in "${required_vars[@]}"; do + echo -n " $var... " + if [ -z "${!var}" ]; then + echo -e "${RED}✗ Missing${NC}" + else + # Check if it's a placeholder value + if [[ "${!var}" == *"example"* ]] || [[ "${!var}" == *"xxxxx"* ]] || [[ "${!var}" == *"your_"* ]]; then + echo -e "${YELLOW}⚠ Placeholder value detected${NC}" + else + echo -e "${GREEN}✓${NC}" + fi + fi + done +fi + +# Check if node_modules exists +echo "" +echo -n "Checking if dependencies are installed... " +if [ -d node_modules ]; then + echo -e "${GREEN}✓${NC}" +else + echo -e "${RED}✗${NC}" + echo -e "${YELLOW}Run: pnpm install${NC}" +fi + +# Check if pnpm is installed +echo "" +echo -n "Checking if pnpm is installed... " +if command -v pnpm &> /dev/null; then + echo -e "${GREEN}✓ ($(pnpm --version))${NC}" +else + echo -e "${YELLOW}⚠ Not found (npm will be used)${NC}" +fi + +# Check if git is clean +echo "" +echo -n "Checking git status... " +if [ -z "$(git status --porcelain)" ]; then + echo -e "${GREEN}✓ Clean${NC}" +else + echo -e "${YELLOW}⚠ Uncommitted changes${NC}" +fi + +echo "" +echo "==========================================" +echo "" +echo "📋 Next Steps for Deployment:" +echo "" +echo "1. Ensure all environment variables are set correctly" +echo "2. Review DEPLOYMENT.md for detailed instructions" +echo "3. Push your code to GitHub" +echo "4. Connect to Vercel and deploy" +echo "" +echo "For detailed deployment guide, see: DEPLOYMENT.md" From 5ec23b361814374d186b6c6bd9608f62a038159d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:54:38 +0000 Subject: [PATCH 4/6] Enhance README with deploy button and pre-deployment checklist Co-authored-by: CodrAyush <119109504+CodrAyush@users.noreply.github.com> --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f53381..1ab8273 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Publixy - Multi-tenant Blog Platform +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/CodrAyush/BlogHub&env=DATABASE_URL,NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,CLERK_SECRET_KEY,NEXT_PUBLIC_ROOT_DOMAIN&envDescription=Required%20environment%20variables%20for%20BlogHub&envLink=https://github.com/CodrAyush/BlogHub/blob/main/.env.example) + A modern, multi-tenant blog platform built with Next.js 15, Clerk authentication, and Drizzle ORM. Each organization gets its own dedicated blog space with custom subdomains. ## Features @@ -152,6 +154,7 @@ CREATE TABLE blogs ( - `pnpm db:push` - Push schema changes to database - `pnpm db:studio` - Open Drizzle Studio - `pnpm db:generate` - Generate migrations +- `pnpm deploy:check` - Check deployment readiness ### Adding New Features @@ -164,7 +167,7 @@ CREATE TABLE blogs ( ### Quick Deploy to Vercel (Recommended) -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/CodrAyush/BlogHub) +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/CodrAyush/BlogHub&env=DATABASE_URL,NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,CLERK_SECRET_KEY,NEXT_PUBLIC_ROOT_DOMAIN&envDescription=Required%20environment%20variables%20for%20BlogHub&envLink=https://github.com/CodrAyush/BlogHub/blob/main/.env.example) For detailed deployment instructions, see **[DEPLOYMENT.md](./DEPLOYMENT.md)** which includes: - Complete step-by-step deployment guide @@ -173,6 +176,18 @@ For detailed deployment instructions, see **[DEPLOYMENT.md](./DEPLOYMENT.md)** w - Custom domain and wildcard subdomain setup - Troubleshooting tips +### Pre-Deployment Checklist + +Run the deployment readiness check: +```bash +pnpm deploy:check +``` + +This will verify: +- Environment variables are configured +- Dependencies are installed +- Git status is clean + ### Quick Start 1. Click the "Deploy with Vercel" button above From 1e56ca058a863f057bfc1b82e72b83ab020c958d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:57:31 +0000 Subject: [PATCH 5/6] Address code review feedback - security and best practices Co-authored-by: CodrAyush <119109504+CodrAyush@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- DEPLOYMENT.md | 12 ++++++++++-- scripts/deployment-check.sh | 10 ++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67652e3..edb54e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: 8 + version: latest - name: Install dependencies run: pnpm install @@ -43,7 +43,7 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: 8 + version: latest - name: Install dependencies run: pnpm install diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index b40674c..871b7f3 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -108,15 +108,23 @@ Alternatively, you can: 2. Add your custom domain (e.g., `yourdomain.com`) 3. Add wildcard subdomain: `*.yourdomain.com` 4. Configure DNS with your domain provider: + + Follow Vercel's DNS configuration instructions for your domain: + - For CNAME setup (recommended): Point your domain and wildcard to Vercel's CNAME + - For A records: Use the IP addresses provided in your Vercel project settings + + Example configuration: ``` - Type: A + Type: CNAME Name: @ - Value: 76.76.21.21 + Value: cname.vercel-dns.com Type: CNAME Name: * Value: cname.vercel-dns.com ``` + + **Note:** DNS values may vary. Always refer to the DNS configuration shown in your Vercel project settings for the most current values. ### Step 7: Update Clerk Configuration diff --git a/scripts/deployment-check.sh b/scripts/deployment-check.sh index 8d6e47e..da9b13c 100755 --- a/scripts/deployment-check.sh +++ b/scripts/deployment-check.sh @@ -34,15 +34,17 @@ required_vars=( ) if [ -f .env.local ]; then - source .env.local 2>/dev/null - + # Safely check environment variables without sourcing the file for var in "${required_vars[@]}"; do echo -n " $var... " - if [ -z "${!var}" ]; then + # Use grep to extract the value safely + value=$(grep "^${var}=" .env.local 2>/dev/null | cut -d'=' -f2- | tr -d '"' | tr -d "'") + + if [ -z "$value" ]; then echo -e "${RED}✗ Missing${NC}" else # Check if it's a placeholder value - if [[ "${!var}" == *"example"* ]] || [[ "${!var}" == *"xxxxx"* ]] || [[ "${!var}" == *"your_"* ]]; then + if [[ "$value" == *"example"* ]] || [[ "$value" == *"xxxxx"* ]] || [[ "$value" == *"your_"* ]]; then echo -e "${YELLOW}⚠ Placeholder value detected${NC}" else echo -e "${GREEN}✓${NC}" From b9271ac39874738457fcdc49f04ee6191d98cfb9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 11:59:57 +0000 Subject: [PATCH 6/6] Pin pnpm to version 9 and clarify DNS placeholder values Co-authored-by: CodrAyush <119109504+CodrAyush@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- DEPLOYMENT.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edb54e7..0710a0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: latest + version: 9 - name: Install dependencies run: pnpm install @@ -43,7 +43,7 @@ jobs: - name: Setup pnpm uses: pnpm/action-setup@v4 with: - version: latest + version: 9 - name: Install dependencies run: pnpm install diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md index 871b7f3..22b1d42 100644 --- a/DEPLOYMENT.md +++ b/DEPLOYMENT.md @@ -113,18 +113,18 @@ Alternatively, you can: - For CNAME setup (recommended): Point your domain and wildcard to Vercel's CNAME - For A records: Use the IP addresses provided in your Vercel project settings - Example configuration: + Example CNAME configuration: ``` Type: CNAME Name: @ - Value: cname.vercel-dns.com + Value: [your-vercel-project].vercel-dns.com Type: CNAME Name: * - Value: cname.vercel-dns.com + Value: [your-vercel-project].vercel-dns.com ``` - **Note:** DNS values may vary. Always refer to the DNS configuration shown in your Vercel project settings for the most current values. + **Important:** Replace `[your-vercel-project]` with the actual CNAME value shown in your Vercel project settings under Domains. DNS values are unique to each project and should not be guessed. ### Step 7: Update Clerk Configuration