A full-stack family website built with React, Cloudflare Workers, and Cloudflare Pages. Features include digital photo sharing, family calendar, and message board.
dudley-family-site/
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React contexts
│ │ └── ...
│ ├── package.json
│ └── vite.config.js
├── worker/ # Cloudflare Worker backend
│ ├── src/
│ │ └── index.js # Main worker file
│ ├── schema.sql # Database schema
│ ├── package.json
│ └── wrangler.toml
├── package.json # Root package.json
└── README.md
npm install -g wrangler# Install root dependencies
npm install
# Install frontend dependencies
cd frontend && npm install
# Install worker dependencies
cd ../worker && npm install
# Login to Cloudflare
wrangler login
# Create D1 database
wrangler d1 create dudley-family-db
# Note the database ID from the output and update wrangler.toml
# Create R2 bucket for photos
wrangler r2 bucket create dudley-family-photos
worker/wrangler.toml with your database ID# Apply database schema
wrangler d1 execute dudley-family-db --file=./worker/schema.sql
# Start both frontend and worker in development
npm run dev
# Or start individually:
npm run dev:frontend # Frontend on http://localhost:3000
npm run dev:worker # Worker on http://localhost:8787
cd worker
wrangler deploy
cd frontend && npm run buildfrontend/distVITE_API_URL: Your worker URL (e.g., https://dudley-family-api.your-subdomain.workers.dev)JWT_SECRET: Secret key for JWT tokensFAMILY_PASSWORD: Password for family loginCORS_ORIGIN: Allowed origin for CORS (production domain)VITE_API_URL: Backend API URLPOST /auth/login - Login with family passwordGET /auth/verify - Verify JWT tokenGET /photos - Get all photosPOST /photos - Upload new photoGET /events - Get all eventsPOST /events - Create new eventPUT /events/:id - Update eventDELETE /events/:id - Delete eventGET /messages - Get all messagesPOST /messages - Create new messagePUT /messages/:id - Update messageDELETE /messages/:id - Delete messagefrontend/src/index.css and frontend/src/App.css for custom stylingThis is a private family project. For questions or issues, contact the family administrator.
Private family use only.