A browser-based insurance policy management application where users can sign up, sign in, view their insurance policies, download policy PDFs, and renew policies via a payment gateway.
- User registration and login (email + password)
- Dashboard showing all policies linked to the logged-in user
- Download policy PDFs (served via secure Azure Blob Storage URLs)
- Renew policy button redirecting to a payment gateway
- No CAPTCHA or OTP — fully compatible with Playwright automation
| Layer | Technology |
|---|---|
| Frontend | React, HTML, CSS |
| Backend | Node.js, Express.js |
| Database | MongoDB / Azure Cosmos DB (MongoDB API) |
| File Storage | Azure Blob Storage |
| Authentication | Email + Password (bcrypt hashing) |
| Testing | Playwright |
| Deployment | Azure App Service |
| CI/CD | Azure DevOps Pipelines |
User → React UI → Express API → MongoDB / Cosmos DB
↓
Azure Blob Storage (PDFs)
- User signs up or logs in via the React frontend.
- Express backend validates credentials against the database.
- On success, policies linked to the user's email are fetched.
- UI renders the policy list with download and renew actions.
- PDF downloads are served as time-limited SAS URLs from Azure Blob Storage.
- Renew button redirects the user to the configured payment gateway.
| Field | Type | Notes |
|---|---|---|
email |
String | Primary key |
passwordHash |
String | bcrypt hashed |
createdDate |
Date |
| Field | Type | Notes |
|---|---|---|
policyId |
String | |
email |
String | Foreign key → users |
policyType |
String | |
policyName |
String | |
pdfBlobUrl |
String | Azure Blob Storage URL |
expiryDate |
Date | |
renewalStatus |
String |
PDFs are not stored in the database. The strategy is:
- Upload PDFs to Azure Blob Storage.
- Store the Blob URL in the
policiescollection. - Generate a SAS (Shared Access Signature) URL at download time.
- SAS links expire after a configured duration for security.
- Passwords hashed with bcrypt — never stored in plain text.
- HTTPS enforced across all endpoints.
- Secrets (DB connection strings, storage keys) stored in Azure Key Vault — never hardcoded.
- Role-based access control (Admin / User).
- Azure Blob Storage is private; files are only accessible via signed URLs.
- Node.js 18+
- MongoDB (local) or an Azure Cosmos DB connection string
- Azure Storage account
- Azure Key Vault (for production secrets)
# Clone the repository
git clone https://github.com/your-org/anti-gravity-ide.git
cd anti-gravity-ide
# Install backend dependencies
cd server
npm install
# Install frontend dependencies
cd ../client
npm installCreate a .env file in the server/ directory:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
AZURE_STORAGE_ACCOUNT=your_storage_account_name
AZURE_STORAGE_KEY=your_storage_key
AZURE_BLOB_CONTAINER=policy-pdfs
PAYMENT_GATEWAY_URL=https://your-payment-gateway.com
PORT=5009In production, load these from Azure Key Vault instead of a
.envfile.
# Start backend
cd server
npm start
# Start frontend (separate terminal)
cd client
npm run devThe API will be available at http://localhost:5009 and the Vite frontend at http://localhost:5173.
- Copy
server/.env.exampletoserver/.env - Set
MONGO_URIto your local MongoDB instance or MongoDB Atlas connection string - Set a real
JWT_SECRET - Start the API from
server/ - Optionally seed sample users and policies with
node seed.js
- Build the Node.js / Express API skeleton
- Connect MongoDB and define schemas
- Create the React UI (login, signup, dashboard)
- Implement login and signup with bcrypt + JWT
- Upload sample PDFs to Azure Blob Storage
- Wire up policy-fetch endpoints
- Display downloadable PDF links with SAS URLs
- Add Playwright automation tests
- Deploy to Azure App Service
- Configure custom domain and CI/CD pipeline
Developer pushes code to Azure Repo
↓
Stage 1 – Build
• npm install
• React production build
Stage 2 – Test
• Run Playwright test suite
Stage 3 – Package
• Build Docker image (optional)
Stage 4 – Deploy
• Deploy to Azure App Service
• Secrets injected from Azure Key Vault
Tests can be run locally against any deployed URL, or automatically within the Azure DevOps pipeline.
Recommended test coverage:
- Sign-up flow
- Login flow
- Policy list display
- PDF download
- Renew button navigation
# Run tests
cd tests
npx playwright testDeploy the Node.js backend and React frontend together as a single Azure App Service. Connect to Azure Cosmos DB and Azure Blob Storage as external services.
Split into separate containers for the API and frontend, deployed via Azure Container Apps or AKS.
- Purchase a domain from GoDaddy (or any registrar).
- Add a CNAME record pointing to your Azure App Service URL.
- Map the custom domain inside Azure App Service settings.
app.yourdomain.com → yourapp.azurewebsites.net
MIT