A comprehensive backend system built with Node.js, Express, Parse Server, MongoDB, AWS SQS, and Lambda functions. This architecture provides a scalable foundation for authentication, data management, and event processing.
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Main Baas β β Parse Server β β MongoDB β
β Server βββββΊβ (BaaS Layer) βββββΊβ (Database) β
β (Express) β β (Docker) β β (Cloud) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β AWS SQS β β Lambda β β LocalStack β
β (Queue) βββββΊβ Functions βββββΊβ (Local AWS) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Main Baas Server: Express.js REST API for user authentication (signup/login) running locally
- Parse Server: Backend-as-a-Service for data management running in Docker container
- MongoDB: Cloud database instance managed through Parse Server
- AWS SQS: Message queue for event processing
- Lambda Functions: Serverless event processors
- Bruno: API testing tool integrated within main-baas-server
- LocalStack: Local AWS services emulator for development
- Node.js 20+
- Docker & Docker Compose
- npm or yarn
git clone <repository-url>
cd poc-lemon-insurance
npm run setup# Copy environment files
cp main-baas-server/env.example main-baas-server/.env
# Edit main-baas-server/.env with your configuration
# Most values can be left as defaults for local development# Start Parse Server with Docker Compose
npm run docker:up
# Start all services (Main Baas Server + Lambda + Bruno)
npm run dev- Main Baas Server: http://localhost:3000
- Parse Server: http://localhost:1337/parse
- Bruno (API Testing): http://localhost:3001
- MongoDB: Cloud instance (140.238.225.133:30127)
npm test# Main Baas Server tests
npm run test:main-baas
# Lambda function tests
npm run test:lambdaBruno is integrated within main-baas-server and provides:
- Authentication endpoint testing
- Parse Server endpoint testing
- Environment management (local, staging, production)
- Request/response examples
POST /api/auth/signup
POST /api/auth/login
GET /api/auth/profile
GET /api/auth/users # Admin only
GET /api/auth/events # Admin only
GET /health
GET /health/ready
POST /parse/classes/User
GET /parse/classes/User
POST /parse/classes/AuthEvent
GET /parse/Workflow
- User Action: User signs up or logs in via Main Baas Server
- SQS Message: Main Baas Server publishes event to SQS queue
- Lambda Trigger: SQS triggers Lambda function automatically
- Parse Update: Lambda updates event status and creates workflow records
- Data Persistence: All data stored in MongoDB via Parse Server
# 1. Create user
curl -X POST http://localhost:3000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "password123",
"firstName": "John",
"lastName": "Doe"
}'
# 2. Check Parse Server data
curl -X GET "http://localhost:1337/parse/classes/AuthEvent" \
-H "X-Parse-Application-Id: lemon-insurance-app-id" \
-H "X-Parse-Master-Key: lemon-insurance-master-key"_User: User accounts and authenticationAuthEvent: Authentication events (signup/login)Workflow: Business process workflowsUserOnboarding: User onboarding stepsUserActivity: User activity logsGenericEvent: Other system events
Lambda functions can create their own collections dynamically:
// In Lambda function
await parseClient.createCustomRecord('InsurancePolicy', {
userId: 'user-123',
policyType: 'auto',
status: 'active',
premium: 150.00
});| Service | Port | Description |
|---|---|---|
| Main Baas Server | 3000 | Express.js REST API |
| Parse Server | 1337 | Backend-as-a-Service |
| Bruno | 3001 | API Testing Tool |
| MongoDB | Cloud | Cloud database instance |
# Start Parse Server
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Rebuild services
docker-compose up --build -d# Start everything locally
npm run docker:up
npm run dev- Parse Server: Start first with
npm run docker:up(runs on port 1337) - Main Baas Server: Start with
npm run dev:main-baas(runs on port 3000, connects to Parse Server) - Lambda: Start with
npm run dev:lambda(runs locally for testing) - Bruno: Start with
npm run dev:bruno(runs on port 3001 for API testing)
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment | development |
PORT |
Main Baas Server port | 3000 |
MONGODB_URI |
MongoDB connection | mongodb://140.238.225.133:30127/poc-lemon |
PARSE_APP_ID |
Parse Server app ID | lemon-insurance-app-id |
PARSE_MASTER_KEY |
Parse Server master key | lemon-insurance-master-key |
PARSE_JS_KEY |
Parse Server JS key | lemon-insurance-js-key |
Parse Server is configured with:
- Cloud MongoDB instance
- File storage using Docker volumes
- Security settings with master keys
- LiveQuery support for real-time updates
- Main Baas Server: API endpoints, validation, business logic
- Lambda Functions: Message processing, Parse Server integration
- Parse Service: Data operations, error handling
- End-to-End: Complete user signup β SQS β Lambda β Parse flow
- Database: MongoDB operations via Parse Server
- API Testing: Bruno collections for endpoint testing
# View Parse Server logs
npm run docker:logs
# View specific service logs
docker-compose logs -f parse-serverAccess Parse Server dashboard at: http://localhost:1337/parse
Access Bruno at: http://localhost:3001
- Port conflicts: Ensure ports 3000, 1337, 3001 are available
- MongoDB connection: Check MongoDB cloud instance is accessible
- Parse Server: Check environment variables and Docker container
- File storage: Docker Parse Server handles file storage automatically
# Enable debug logging
export DEBUG=*
npm run dev
# View detailed Docker logs
docker-compose logs -f --tail=100- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details.
Note: This is a proof-of-concept implementation. For production use, ensure proper security measures, environment configuration, and monitoring are in place.
Architecture: Parse Server runs in Docker (port 1337), Main Baas Server runs locally (port 3000), Lambda runs locally, all connecting to MongoDB.
Bruno is located at the root level and provides:
- API Testing: Test all endpoints with Bruno collections
- Documentation: Maintain up-to-date API documentation
- Environment Management: Different environments for local, staging, production
- Request/Response Examples: Provide examples for all endpoints