Complete guide for setting up your Atomic Guide development environment with all tools, extensions, and configurations.
| Software | Minimum Version | Check Command | Installation |
|---|---|---|---|
| Node.js | v18.0.0 | node --version |
nodejs.org |
| npm | v9.0.0 | npm --version |
Comes with Node.js |
| Git | v2.0.0 | git --version |
git-scm.com |
| Wrangler | Latest | wrangler --version |
npm install -g wrangler |
- VS Code or WebStorm - IDE with TypeScript support
- Postman or Insomnia - API testing
- TablePlus or DB Browser - SQLite database viewer
- Chrome DevTools - Debugging and profiling
# Fork the repository on GitHub first, then:
git clone https://github.com/YOUR_USERNAME/atomic-guide.git
cd atomic-guide
# Add upstream remote
git remote add upstream https://github.com/atomicjolt-com/atomic-guide.git# Install all dependencies
npm install
# Install global tools
npm install -g wrangler
npm install -g typescript# Copy environment template
cp .env.example .env
# Edit with your settings
code .envRequired environment variables:
NODE_ENV=development
LOG_LEVEL=debug
PORT=5990# Login to Cloudflare
wrangler login
# Get your account ID
wrangler whoamiUpdate wrangler.jsonc:
# Create D1 database
npm run db:setup
# Run migrations
npm run db:migrate
# Seed sample data
npm run db:seed
# Verify database
npm run db:list# Create all KV namespaces
npm run kv:setup
# The script will output IDs - update wrangler.jsonc with them# Install via command palette
code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension ms-vscode.vscode-typescript-next
code --install-extension bradlc.vscode-tailwindcss
code --install-extension formulahendry.auto-rename-tag{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": true,
"**/.wrangler": true
},
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
"**/public/assets": true
}
}{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Dev Server",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev"],
"console": "integratedTerminal",
"env": {
"NODE_ENV": "development",
"DEBUG": "*"
}
},
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"runtimeExecutable": "npm",
"runtimeArgs": ["test", "--", "--inspect"],
"console": "integratedTerminal"
}
]
}-
TypeScript:
- Settings → Languages & Frameworks → TypeScript
- TypeScript version: Use project's (
node_modules/typescript) - Enable "Recompile on changes"
-
ESLint:
- Settings → Languages & Frameworks → JavaScript → Code Quality Tools → ESLint
- Enable "Automatic ESLint configuration"
-
Prettier:
- Settings → Languages & Frameworks → JavaScript → Prettier
- Run on save: Enable
-
File Watchers:
- Add watcher for TypeScript files
- Program:
tsc - Arguments:
--noEmit
# Install husky for git hooks
npm install -D husky
npx husky install
# Add pre-commit hook
npx husky add .husky/pre-commit "npm run lint && npm test"
# Add commit message hook
npx husky add .husky/commit-msg "npx commitlint --edit $1"Follow conventional commits:
feat: Add new feature
fix: Fix bug
docs: Update documentation
style: Format code
refactor: Refactor code
test: Add tests
chore: Update dependencies# Terminal 1: Vite dev server
npm run dev
# Terminal 2: TypeScript watch
npx tsc --watch --noEmit
# Terminal 3: Test watch
npm test -- --watch# Open SQL console
npm run db:query
# Watch for changes
npm run db:migrate -- --watchUse the REST Client extension or curl:
# Test health endpoint (no auth required)
curl http://localhost:5990/api/health
# Test with authentication
curl -H "Authorization: Bearer TOKEN" \
http://localhost:5990/api/chat# 1. Register a new user
curl -X POST http://localhost:5990/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "TestPassword123!",
"name": "Test User"
}'
# 2. Login to get JWT token
curl -X POST http://localhost:5990/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "test@example.com",
"password": "TestPassword123!"
}'
# 3. Use token for authenticated requests
curl -H "Authorization: Bearer <jwt-token>" \
-H "Content-Type: application/json" \
http://localhost:5990/api/chat/history-
Email/Password Flow:
- Visit
http://localhost:5990/auth/signup - Create test account with email/password
- Login at
http://localhost:5990/auth/login - Access app at
http://localhost:5990/embed
- Visit
-
OAuth Flow (requires setup):
- Configure OAuth providers (see OAuth Setup Guide)
- Test Google: Click "Continue with Google" button
- Test GitHub: Click "Continue with GitHub" button
- Verify user creation and session handling
-
Session Management:
- Test logout functionality
- Verify session expiration
- Test "remember me" functionality
Recommended extensions for development:
- React Developer Tools - Inspect React components
- Redux DevTools - Debug Redux state
- Wappalyzer - Identify technologies
- JSON Viewer - Format JSON responses
- ModHeader - Modify HTTP headers
- Enable source maps: Settings → Sources → Enable JavaScript source maps
- Enable network throttling: Network tab → Throttling
- Enable device emulation: Toggle device toolbar
Configure in tsconfig.json:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@features/*": ["src/features/*"],
"@shared/*": ["src/shared/*"],
"@tests/*": ["tests/*"]
}
}
}Ensure these are enabled:
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true
}
}# Create test database
wrangler d1 create atomic-guide-test
# Run migrations on test DB
DATABASE_NAME=atomic-guide-test npm run db:migrateCreate test.env:
NODE_ENV=test
DATABASE_NAME=atomic-guide-test
LOG_LEVEL=error
MOCK_AI=true# Install performance tools
npm install -D lighthouse chrome-launcher
# Run performance audit
npx lighthouse http://localhost:5990 --view// Add to development build
if (process.env.NODE_ENV === 'development') {
window.profileMemory = () => {
const memory = performance.memory;
console.table({
'Used JS Heap': `${(memory.usedJSHeapSize / 1048576).toFixed(2)} MB`,
'Total JS Heap': `${(memory.totalJSHeapSize / 1048576).toFixed(2)} MB`,
Limit: `${(memory.jsHeapSizeLimit / 1048576).toFixed(2)} MB`,
});
};
}# Debug with Chrome DevTools
node --inspect npm run dev
# Debug with VS Code
# Use launch configuration above// Add to React components
useEffect(() => {
if (process.env.NODE_ENV === 'development') {
console.log('Component rendered:', { props, state });
}
}, [props, state]);# Enable verbose logging
WRANGLER_LOG=debug npm run dev
# Use wrangler tail for production
npm run tail -- --format pretty# Never commit .env files
echo ".env*" >> .gitignore
# Use secrets for sensitive data
wrangler secret put API_KEY# Generate self-signed certificate
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
# Configure Vite for HTTPS
# vite.config.ts
server: {
https: {
key: fs.readFileSync('./key.pem'),
cert: fs.readFileSync('./cert.pem')
}
}# Find process using port
lsof -i :5990
# Kill process
kill -9 <PID>
# Or use different port
PORT=3000 npm run dev# Clear TypeScript cache
rm -rf node_modules/.cache/typescript
# Rebuild
npm run check# Reset database
npm run db:reset
# Check database status
npm run db:status- Check Debugging Guide
- Search GitHub Issues
- Ask in Discussions
- Testing Guide - Write and run tests
- Commands Reference - All available commands
- API Development - Build API endpoints
{ "account_id": "YOUR_ACCOUNT_ID_HERE", }