Quick Setup Guide¶
Get the CyferWall Engage Backend running locally in just a few steps.
Prerequisites¶
Make sure you have the following installed:
- Node.js 18+ or Bun (recommended)
- PostgreSQL (local or remote)
- Git
- Python 3.8+ (for documentation)
๐โโ๏ธ Quick Start¶
1. Clone and Setup¶
# Clone the repository
git clone <repository-url>
cd cws_engage/backend
# Install dependencies (using bun for speed)
bun install
# Or with npm
npm install
2. Environment Configuration¶
Create your .env file:
Update the key variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/engage_db"
# Notification Services (optional for development)
NOVU_API_KEY="your_novu_key"
RESEND_API_KEY="your_resend_key"
# Authentication
JWT_SECRET="your_jwt_secret"
Database URL Quoting
Make sure to quote your DATABASE_URL if it contains special characters:
3. Database Setup¶
# Generate Prisma client
bun run postinstall
# Run database migrations
npx prisma migrate dev
# (Optional) Seed with sample data
npx prisma db seed
4. Start Development Server¶
The server will start on http://localhost:3000 ๐
๐งช Test the Notification System¶
Once running, test the notification system:
# Test template rendering
node src/util/notifications/test-comprehensive.js
# Test notification sending
node src/util/notifications/test-multiple-templates.js
๐ Documentation Setup¶
To run this documentation locally:
# Install Python dependencies
pip install -r docs/requirements.txt
# Serve documentation
mkdocs serve
# Open http://127.0.0.1:8000
๐ Verify Setup¶
Health Check¶
Expected response:
Notification Service Check¶
curl -X POST http://localhost:3000/api/support/case \
-H "Content-Type: application/json" \
-d '{
"name": "Test User",
"email": "test@example.com",
"customerType": "FREE",
"issueType": "TECHNICAL",
"urgency": "MEDIUM",
"subject": "Test Case",
"message": "This is a test case"
}'
Check the logs for notification outputs.
๐ Next Steps¶
- Explore the Notification System - Learn how to send notifications
- Check Support APIs - Understand the customer and internal APIs
- Review Templates - See available notification templates
- Read Integration Guide - Integrate notifications in your code
๐ง Development Scripts¶
| Command | Description |
|---|---|
bun run dev | Start development server with auto-reload |
bun run build | Build for production |
bun run test | Run test suite |
bun run test:watch | Run tests in watch mode |
npx prisma studio | Open database admin UI |
mkdocs serve | Serve documentation locally |
๐ Common Issues¶
Database Connection Failed¶
# Check if PostgreSQL is running
brew services start postgresql
# Verify connection string
psql "postgresql://user:password@localhost:5432/engage_db"
Notification Templates Not Found¶
# Check template structure
node src/util/notifications/test-structure.js
# Verify paths
ls -la templates/notifications/
Build Errors¶
# Clear node_modules and reinstall
rm -rf node_modules bun.lockb
bun install
# Regenerate Prisma client
bun run postinstall
๐ Getting Help¶
- Check the logs: Most issues show clear error messages
- Test templates: Use the built-in testing scripts
- Review configuration: Double-check your
.envfile - Ask for help: Reach out on Slack #engage-backend-support
Next: Development Environment Setup โ