bởi Tobias W.

Parse Server is a self-hosted, open-source backend built on Node.js and Express, supporting MongoDB and PostgreSQL, with REST, GraphQL, and Live Query APIs for web and mobile apps.
This block provides the full Parse Server Node.js backend source (user@example.com), an open-source BaaS (Backend-as-a-Service) built on Express. It exposes a REST and GraphQL API, LiveQuery subscriptions, push notifications, file storage, and a pluggable adapter system for auth, cache, storage, and email. Typical buyers are teams self-hosting a Parse-compatible backend and integrating it into an existing Node.js/TypeScript monorepo or standalone service.
Adapters/ - Pluggable adapters for auth, cache, email, files, logging, message queues, pub/sub, push, storage, and WebSocket serversControllers/ - Core server controllers (Database, Files, Hooks, LiveQuery, Logger, Push, Schema, User, GraphQL, etc.)Deprecator/ - Runtime deprecation warning systemGraphQL/ - Apollo-based GraphQL server (ParseGraphQLServer) and schema generationLiveQuery/ - WebSocket-based real-time query subscription engineOptions/ - Full TypeScript/Flow interface for ParseServerOptions and related typesPush/ - Push notification queue (PushQueue) and worker (PushWorker)Routers/ - Express routers for every Parse REST endpointSchemaMigrations/ - Schema migration helpersSecurity/ - Security check groups and audit utilitiescli/ - CLI entry point for parse-server commandcloud-code/ - Cloud Code trigger and function execution environmentParseServer.ts - Main class; bootstraps Express app and all controllersindex.ts - Public package entry; re-exports all public symbolsAuth.js - Auth data validation and provider resolutionConfig.js - Per-request config retrieval via appIdRestWrite.js - Core logic for object creation and updateRestQuery.js - Core logic for object queriesrest.js - High-level REST operation helpers (find, get, create, update, del)triggers.js - Cloud Code trigger registration and executionmiddlewares.js - Express middleware for request parsing, auth, and corsKhởi chạy sandbox cách ly và chạy phía máy chủ — không cần cài đặt cục bộ.
Tetrees AI Review cho phiên bản này
This JavaScript cli / script completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Quy trình avcp-2026-08-04.1 · SHA-256 f2fe40b4ff809c6b…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Đã đánh giá 4 thg 8, 2026
Đưa sản phẩm này thẳng vào AI IDE, trình tạo web hoặc cloud IDE của bạn.
Kết nối Tetrees với AI IDE tương thích để liệt kê sản phẩm bạn sở hữu và nhận ZIP đã xác minh mà không cấp quyền tải lên của người bán.
Chưa có đánh giá.
Sign in to join the discussion
Loading discussion…
defaults.js - Default option valueslogger.ts - Winston-backed logger factory (getLogger)Utils.js - General-purpose utility functionscryptoUtils.js - Crypto helpers (random strings, tokens)cache.js - In-process app config cachebatch.js - Batch request handlingTestUtils.js - Helpers for resetting Parse Server state in testsnpm install express cors express-rate-limit
npm install @parse/fs-files-adapter @parse/push-adapter
npm install @apollo/server @as-integrations/express5
npm install @graphql-tools/merge @graphql-tools/schema @graphql-tools/utils
npm install graphql graphql-list-fields graphql-relay graphql-upload
npm install bcryptjs jsonwebtoken jwks-rsa
npm install ldapjs lru-cache lodash intersect mime
npm install commander follow-redirects
npm install @fastify/busboy
npm install parse mongoose # peer: parse SDK for node
npm install pg pg-promise # if using PostgreSQL adapter
npm install mongodb # if using MongoDB adapter
No native iOS/Android build steps are required. This is a pure Node.js backend block. If deploying with Docker, ensure the Node.js base image is >= 18 (see upstream compatibility matrix).
Drop the source. Place the source/ directory at the root of your project, or copy its contents into src/parse-server/. Update import paths accordingly.
TypeScript config. Ensure tsconfig.json targets at least ES2020 and includes the source directory:
{
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"esModuleInterop": true,
"allowJs": true,
"outDir": "dist",
"rootDir": "src",
"resolveJsonModule": true
},
"include": ["src/**/*"]
}
Babel (if not using tsc directly). Add @babel/preset-typescript and @babel/preset-env with modules: "commonjs".
Environment variables. The server reads options passed programmatically, but conventional env vars used in Cloud Code and adapters include:
PARSE_SERVER_APPLICATION_ID=myAppId
PARSE_SERVER_MASTER_KEY=myMasterKey
PARSE_SERVER_DATABASE_URI=mongodb://localhost:27017/parse
PARSE_SERVER_URL=http://localhost:1337/parse
Entry point. Create src/server.ts (see Working Examples below) and compile with tsc or run directly with ts-node.
Verify. Hit GET /parse/health – a {"status":"ok"} response confirms the server is running.
import ParseServer from './source/ParseServer';
const server = new ParseServer(options: ParseServerOptions);
await server.start();
const app: Express = server.app; // mount on your Express app
The main class. Instantiate with a ParseServerOptions object, call start(), then mount server.app on your Express instance. Use ParseServer.createLiveQueryServer(httpServer, options) to attach a LiveQuery WebSocket server to an existing HTTP server.
import { ParseGraphQLServer } from './source/GraphQL/ParseGraphQLServer';
const graphQLServer = new ParseGraphQLServer(parseServer, {
graphQLPath: '/graphql',
playgroundPath: '/playground',
});
graphQLServer.applyMiddleware({ app }); // app is an Express instance
Wraps the Parse Server instance and attaches Apollo Server middleware to an Express app. Use when you need a GraphQL API in addition to (or instead of) the REST API.
import { PushWorker } from './source/Push/PushWorker';
const worker = new PushWorker(pushAdapter, subscriberConfig);
Processes push notification jobs from the push queue. Instantiate in a separate worker process when running push in a distributed architecture. The queue is backed by PushQueue and uses the configured push adapter (default: @parse/push-adapter).
import { getControllers } from './source/Controllers';
import { ParseServerOptions } from './source/Options';
const controllers = getControllers(options: ParseServerOptions);
// returns: { loggerController, filesController, databaseController, ... }
Factory that constructs all server controllers from a ParseServerOptions object. Useful when you need direct access to individual controllers (e.g., databaseController for low-level queries) without spinning up the full HTTP server.
Stand up a Parse Server on Express with MongoDB and serve REST requests.
import express from 'express';
import ParseServer from './source/ParseServer';
import { ParseServerOptions } from './source/Options';
const options: ParseServerOptions = {
databaseURI: process.env.PARSE_SERVER_DATABASE_URI || 'mongodb://localhost:27017/dev',
appId: process.env.PARSE_SERVER_APPLICATION_ID || 'myAppId',
masterKey: process.env.PARSE_SERVER_MASTER_KEY || 'myMasterKey',
serverURL: process.env.PARSE_SERVER_URL || 'http://localhost:1337/parse',
allowClientClassCreation: false,
};
async function main() {
const app = express();
const parseServer = new ParseServer(options);
await parseServer.start();
app.use('/parse', parseServer.app);
app.listen(1337, () => console.log('Parse Server running on port 1337'));
}
main().catch(console.error);
Attach the GraphQL playground and endpoint alongside the REST API.
import express from 'express';
import { createServer } from 'http';
import ParseServer from './source/ParseServer';
import { ParseGraphQLServer } from './source/GraphQL/ParseGraphQLServer';
import { ParseServerOptions } from './source/Options';
const options: ParseServerOptions = {
databaseURI: 'mongodb://localhost:27017/dev',
appId: 'myAppId',
masterKey: 'myMasterKey',
serverURL: 'http://localhost:1337/parse',
};
async function main() {
const app = express();
const parseServer = new ParseServer(options);
await parseServer.start();
const graphQLServer = new ParseGraphQLServer(parseServer, {
graphQLPath: '/graphql',
playgroundPath: '/playground',
});
app.use('/parse', parseServer.app);
graphQLServer.applyMiddleware({ app });
const httpServer = createServer(app);
ParseServer.createLiveQueryServer(httpServer, { appId: 'myAppId' });
httpServer.listen(1337, () => console.log('Ready'));
}
main().catch(console.error);
Use the Redis cache adapter and access the database controller directly.
import ParseServer from './source/ParseServer';
import RedisCacheAdapter from './source/Adapters/Cache/RedisCacheAdapter';
import { getControllers } from './source/Controllers';
import { ParseServerOptions } from './source/Options';
const options: ParseServerOptions = {
databaseURI: 'mongodb://localhost:27017/dev',
appId: 'myAppId',
masterKey: 'myMasterKey',
serverURL: 'http://localhost:1337/parse',
cacheAdapter: new RedisCacheAdapter({ url: 'redis://localhost:6379' }),
};
// Access controllers without mounting HTTP server
const controllers = getControllers(options);
async function countObjects() {
const db = controllers.databaseController;
const results = await db.find('GameScore', {}, { limit: 1000 });
console.log(`Found ${results.length} GameScore objects`);
}
countObjects().catch(console.error);
Apply declarative schema definitions and lock schemas in production.
import ParseServer from './source/ParseServer';
import { ParseServerOptions } from './source/Options';
const options: ParseServerOptions = {
databaseURI: 'mongodb://localhost:27017/dev',
appId: 'myAppId',
masterKey: 'myMasterKey',
serverURL: 'http://localhost:1337/parse',
schema: {
definitions: [
{
className: 'GameScore',
fields: { score: { type: 'Number' }, playerName: { type: 'String' } },
},
],
strict: true,
lockSchemas: true,
deleteExtraFields: false,
afterMigration: async () => console.log('Schema migration complete'),
},
};
(async () => {
const server = new ParseServer(options);
await server.start();
console.log('Server started with locked schema');
})();
index.ts - Package entry point; re-exports ParseServer, cache adapters, PushWorker, ParseGraphQLServer, AuthAdapter, SchemaMigrations, and TestUtils.ParseServer.ts - Bootstraps the Express application, wires all controllers, registers routers and middleware, exposes start(), createLiveQueryServer(), and startApp().Options/index.js - Defines ParseServerOptions and sub-interfaces (SchemaOptions, adapter types). The authoritative configuration reference.Controllers/index.js - Factory functions (getControllers, getLoggerController, etc.) that construct all runtime controllers from options.Adapters/Auth/index.js - Aggregates all built-in auth providers (apple, facebook, google, gcenter, github, ldap, mfa, oauth2, etc.) and exports the auth data manager.Adapters/Cache/ - In-memory (InMemoryCacheAdapter), null, Redis (RedisCacheAdapter), and LRU (LRUCacheAdapter) cache implementations.Adapters/Files/ - File storage adapters including GridFSBucketAdapter for MongoDB GridFS.Adapters/Storage/ - MongoDB and PostgreSQL storage adapters; Postgres/sql/ holds pre-compiled SQL query files via pg-promise.GraphQL/ParseGraphQLServer.ts - Apollo Server integration; generates Parse schema and attaches GraphQL middleware to Express.Push/PushWorker.js - Dequeues and dispatches push notification jobs; designed for worker-process deployment.LiveQuery/ - Server-side LiveQuery engine over WebSockets; subscribes clients to query result changes.Routers/ - One Express router per REST resource (classes, users, sessions, files, hooks, schema, etc.).triggers.js - Cloud Code trigger registry; registers beforeSave, afterSave, beforeFind, etc. handlers.rest.js - High-level functions (find, get, create, update, del) used internally by routers and testable in isolation.middlewares.js - Express middleware chain: parses Parse headers, resolves auth, enforces client keys, handles CORS.Auth.js - Validates authData payloads against registered providers; returns a resolved auth object.Config.js - Retrieves the per-request server config by appId from the in-process cache.RestWrite.js - Handles all mutation logic: ACL, pointer resolution, triggers, password hashing, session creation.RestQuery.js - Handles all query logic: ACL enforcement, include resolution, $relatedTo, pipeline aggregation.logger.ts - Exports getLogger() returning a Winston logger instance.defaults.js - Default values for all ParseServerOptions fields.cryptoUtils.js - Generates secure random tokens and hashes.cache.js - Simple in-process store mapping appId to server config.TestUtils.js - destroyAllDataWhenTesting() and related helpers for test isolation.Security/ - CheckGroup and security audit utilities for CLP/ACL checks.SchemaMigrations/ - Migrations export for programmatic schema migration.Deprecator/ - Emits structured deprecation warnings for removed or renamed options.cli/ - parse-server CLI binary; parses --appId, --masterKey, etc. and calls ParseServer.startApp.cloud-code/ - Cloud Code sandbox utilities for executing user-defined Cloud Functions.esModuleInterop missing. Mixed CommonJS (require) and ESM (import) in source causes default is not a constructor; set "esModuleInterop": true in tsconfig.json.mongodb peer causes MongoServerSelectionError; run npm install mongodb@6.pg-promise QueryFile errors at startup. The PostgreSQL SQL files in Adapters/Storage/Postgres/sql/ must be present relative to the compiled output; copy the sql/ directory to dist/ as a post-build step or use ts-node with source paths.createLiveQueryServer attaches to the same HTTP server by default; if you pass a separate port in liveQueryServerOptions, ensure the firewall/load-balancer allows that port.strict: true in development. Setting strict: true with lockSchemas: true prevents any new fields; do not enable both in a development environment where the schema is still evolving.graphql-upload multipart conflicts. Express 5 + @as-integrations/express5 + graphql-upload requires careful middleware ordering; mount graphqlUploadExpress() before graphQLServer.applyMiddleware() to avoid "request body already consumed" errors.I have purchased the `parse-community/parse-server` source block (parse-server@9.9.0-alpha.1).
The source is located in the `source/` directory of this project.
The integration guide is in `USAGE.md`.
Please integrate Parse Server into my existing Node.js/TypeScript Express project by doing the following steps:
1. Read `USAGE.md` and `source/index.ts` to understand all public exports.
2. Install all required dependencies listed in the `## Required dependencies` section of `USAGE.md`.
3. Update `tsconfig.json` as described in `## Project setup`.
4. Create `src/server.ts` that imports `ParseServer` from `source/ParseServer`, constructs it with options read from environment variables (`PARSE_SERVER_APPLICATION_ID`, `PARSE_SERVER_MASTER_KEY`, `PARSE_SERVER_DATABASE_URI`, `PARSE_SERVER_URL`), mounts it at `/parse` on my existing Express app, and calls `server.start()`.
5. Optionally attach `ParseGraphQLServer` from `source/GraphQL/ParseGraphQLServer` at `/graphql` if my project has a `USE_GRAPHQL=true` env var.
6. Wire `ParseServer.createLiveQueryServer` to the HTTP server if `USE_LIVE_QUERY=true`.
7. Show me the final `src/server.ts` and any changes to `package.json` and `tsconfig.json`.
Only use symbols and imports that are documented in `USAGE.md` and visible in `source/index.ts`. Do not invent adapter names or option keys.
Parse Server is released under the BSD 3-Clause License. See source/LICENSE if present, or refer to the upstream repository for the full license text.
Upstream package: parse-server on npm
Upstream repository: github.com/parse-community/parse-server
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
Hướng dẫn cài đặt đầy đủ và prompt tích hợp sẽ mở khóa sau khi mua.
Automation, Utilities & Developer Tools
Miễn phí