Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Atlanta Tech Network - Environment Variables
# Copy to .env.local for local development

# =============================================================================
# REQUIRED
# =============================================================================

# Admin password for /admin routes (HTTP Basic Auth)
# Generate a strong password: openssl rand -base64 32
ADMIN_PASSWORD=your-strong-password-here

# =============================================================================
# OPTIONAL
# =============================================================================

# Admin email for receiving submission notifications
[email protected]

# Email service (if implementing notifications)
# RESEND_API_KEY=re_xxxxxxxxxxxx

# =============================================================================
# CLOUDFLARE (auto-injected in production)
# =============================================================================
# DB binding is configured in wrangler.toml and injected automatically
# Do not set DB connection strings here - D1 handles this

# =============================================================================
# LOCAL DEVELOPMENT
# =============================================================================
# For local dev with wrangler, D1 creates a local SQLite file automatically
# No additional config needed
62 changes: 62 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy to Cloudflare Pages

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Build for Cloudflare Pages
run: bunx @cloudflare/next-on-pages

# Run D1 migrations on push to main only
- name: Run D1 Migrations
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
bunx wrangler d1 execute DB --remote --file=./db/schema.sql --yes
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

# Deploy to Cloudflare Pages
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy .vercel/output/static --project-name=atl-tech-network

# Comment on PR with preview URL
- name: Comment Preview URL on PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🔥 **Preview Deployed!**\n\nYour changes are live at: https://${{ github.head_ref }}.atl-tech-network.pages.dev\n\n_Deployed by Calcifer_`
})
31 changes: 29 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# dependencies
/node_modules
/.pnp
.pnp.js

# next.js
/.next/
Expand All @@ -16,12 +18,37 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files
.env*
# env files (keep .env.example)
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Cloudflare / Wrangler
.wrangler/
.dev.vars

# Generated files
db/seed.sql

# IDE
.idea/
.vscode/
*.swp
*.swo
.DS_Store

# Bun
bun.lockb

# Testing
coverage/
.nyc_output/
Loading