-
Root Monorepo Configuration
- Created
package.jsonwith workspaces for both frontend and backend - Installed
convexandconcurrentlypackages - Configured dev script to run all services with colored output
- Created
-
Convex Backend Setup
- Created
convex/folder at monorepo root - Added
schema.tswith tasks table definition - Added
tasks.tswith a query function to get all tasks - Created
sampleData.jsonlwith sample tasks - Created
.env.localplaceholder (needs configuration)
- Created
-
React Frontend (dillydally-frontend)
- Installed Convex package
- Updated
vite.config.tswith convex alias - Updated
main.tsxto include ConvexProvider - Updated
App.tsxto display tasks using useQuery hook - Configured TypeScript paths in
tsconfig.app.json
-
Express Backend (dillydally-express)
- Created complete Express.js server structure
- Installed all dependencies (express, convex, dotenv, cors, tsx)
- Created
src/index.tswith:- Health check endpoint at
/ - Tasks endpoint at
/api/tasks - ConvexHttpClient integration
- Health check endpoint at
- Configured TypeScript with paths to shared convex folder
-
Documentation
- Created comprehensive README.md
- Created this setup guide
Run this command from the monorepo root:
npx convex devThis will:
- Prompt you to log in with GitHub
- Create a new Convex project
- Update the
.env.localfile with your actualCONVEX_URL - Generate type definitions in
convex/_generated/
Keep this terminal running - it watches for changes to your Convex functions.
Copy the CONVEX_URL from the root .env.local file and create:
dillydally-frontend/.env.local:
VITE_CONVEX_URL=https://your-deployment-url.convex.cloud(Replace with your actual URL from root .env.local)
In a new terminal window, run:
npm installnpm run devThis will start:
- 🔵 Convex - Backend functions (already running from Step 1)
- 🟢 Frontend - http://localhost:5173
- 🟡 Backend - http://localhost:3001
- Frontend: Open http://localhost:5173
- You should see "DillyDally Tasks" with a list of tasks
- Backend Health Check: Open http://localhost:3001
- Should return JSON with status "ok"
- Backend API: Open http://localhost:3001/api/tasks
- Should return the list of tasks from Convex
DillyDally/
├── package.json # Root workspace config
├── README.md # Full documentation
├── SETUP_GUIDE.md # This file
├── sampleData.jsonl # Sample data
├── .env.local # Convex URL (generated by convex dev)
├── .gitignore # Ignore node_modules, .env, etc.
├── convex/ # Shared Convex backend
│ ├── schema.ts
│ ├── tasks.ts
│ └── tsconfig.json
├── dillydally-frontend/ # React app
│ ├── src/
│ │ ├── App.tsx # Updated with Convex
│ │ └── main.tsx # Updated with ConvexProvider
│ └── vite.config.ts # Updated with alias
└── dillydally-express/ # Express API (NEW)
├── src/
│ └── index.ts # Express server with Convex
├── package.json
└── tsconfig.json
# Start all services (after convex dev is running)
npm run dev
# Start individual services
npm run dev --workspace=dillydally-frontend
npm run dev --workspace=dillydally-express
# Build for production
npm run build --workspace=dillydally-frontend
npm run build --workspace=dillydally-express
# Deploy Convex to production
npx convex deploy- Add more Convex functions (queries, mutations) in
convex/ - Extend the frontend UI in
dillydally-frontend/src/ - Add more API endpoints in
dillydally-express/src/index.ts - Update the schema in
convex/schema.tsas needed
- Check the main README.md for detailed documentation
- Visit Convex Docs for Convex-specific questions
- All services have hot reload enabled for rapid development
Important: Make sure to run npx convex dev first before starting the other services, as it generates the necessary type definitions that both the frontend and backend depend on.