A production-ready, Dockerized Parse Server template configured for Back4App deployments. This template enforces strict Infrastructure-as-Code (IaC) principles, strong TypeScript typing, and a domain-driven folder structure to keep cloud code scalable.
📖 Note: This README is a Quick Start guide. For deep-dive explanations on ACLs, validations, and architecture, please read the Parse Server Development Standards Workflow.
- Docker & Docker Compose
- Node.js (v18+)
- PNPM
pnpm install
docker compose up --buildNote: If you add new dependencies via
pnpm add <package>later, rundocker compose up --buildagain to update the container cache.
Once running, access the Parse Dashboard at: http://localhost:1337/dashboard
We strictly organize code by Domain (Parse Class).
.
├── deploy.sh # Back4App deployment script (pre-configured by CLI)
├── docker-compose.yml # Local infrastructure (pre-configured by CLI)
├── package.json
├── src/
│ ├── index.ts # Express & Parse Server initialization
│ ├── config.ts # Parse Server configuration object
│ └── cloud/ # ☁️ ALL PARSE LOGIC LIVES HERE
│ ├── main.ts # Entry point: imports all domain index files
│ │
│ ├── schemas/ # 1. INFRASTRUCTURE AS CODE
│ │ ├── index.ts # Barrel file + schema definitions array
│ │ ├── profile.schema.ts
│ │ └── test.schema.ts # (⚠️ Delete before production)
│ │
│ ├── parseObjects/ # 2. STRONGLY TYPED REPOSITORIES
│ │ ├── index.ts
│ │ ├── profile.object.ts
│ │ └── test.object.ts # (⚠️ Delete before production)
│ │
│ ├── profile/ # 3. DOMAIN: Profile Class
│ │ ├── beforeSave.ts # Triggers inside the class folder
│ │ └── index.ts # Barrel exporting triggers/functions
│ │
│ └── migrations/ # 4. DEPLOYMENT SYNC SCRIPTS
│ ├── createClassFromRestSchema.ts
│ ├── dbMigrate.ts # Script to sync Back4App with schemas/
│ └── index.ts
└── types/ # Custom TypeScript declarations
- Zero Dashboard Modifications: NEVER create classes, add columns, or modify CLPs from the Back4App dashboard. All database architecture must be defined in
src/cloud/schemas/. - One Folder per Class: All Cloud Triggers (
beforeSave,afterDelete) and Cloud Functions related to a specific class must live inside a folder named exactly after that class (e.g.,src/cloud/profile/). - One Function per File: Never group multiple Cloud Functions into a single file. Create a dedicated file for each function (e.g.,
updateAvatar.ts) and export it via the folder'sindex.tsbarrel. - Enforce Server-Side ACLs: Frontend clients should not dictate security. Always set Row-Level Security (
ACL) usingbeforeSavetriggers inside your domain folders.
1. Clean up demo code:
Delete test.schema.ts, test.object.ts, and the src/cloud/test/ directory. Remove their exports from the respective barrel files.
2. Update Version & Changelog:
Bump the "version" in package.json and document your changes in CHANGELOG.md.
3. Run the deployment script:
./deploy.sh4. Run the Database Migration:
Once deployed, go to the Back4App API Console in your browser, check the "Master Key" box, and send a POST request to:
/functions/dbMigrate
This automatically creates and syncs all your classes, columns, and CLPs on the production database.