parse-server README

The project's README from github.com/parse-community/parse-server. As one markdown file: README.md.

parse-repository-header-server


Build Status Build Status Snyk Badge Coverage auto-release

Node Version MongoDB Version Postgres Version

npm latest version npm alpha version

[Backers on Open Collective][open-collective-link] [Sponsors on Open Collective][open-collective-link] Forum Twitter Chat


Parse Server is an open source backend that can be deployed to any infrastructure that can run Node.js. Parse Server works with the Express web application framework. It can be added to existing web applications, or run by itself.

The full documentation for Parse Server is available in the wiki. The Parse Server guide is a good place to get started. An API reference and Cloud Code guide are also available. If you're interested in developing for Parse Server, the Development guide will help you get set up.


A big thank you 🙏 to our sponsors and backers who support the development of Parse Platform!

Bronze Sponsors

Bronze Sponsors


Flavors & Branches

Parse Server is available in different flavors on different branches:

Long Term Support

Long-Term-Support (LTS) is provided for the previous Parse Server major version. For example, Parse Server 5.x will receive security updates until Parse Server 6.x is superseded by Parse Server 7.x and becomes the new LTS version. While the current major version is published on branch release, a LTS version is published on branch release-#.x.x, for example release-5.x.x for the Parse Server 5.x LTS branch.

⚠️ LTS versions are provided to help you transition as soon as possible to the current major version. While we aim to fix security vulnerabilities in the LTS version, our main focus is on developing the current major version and preparing the next major release. Therefore we may leave certain vulnerabilities up to the community to fix. Search for pull requests with the specific LTS base branch to see the current open vulnerabilities for that LTS branch.

Getting Started

The fastest and easiest way to get started is to run MongoDB and Parse Server locally.

Running Parse Server

Before you start make sure you have installed:

Compatibility

Node.js

Parse Server is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the Node.js Long Term Support plan and only test against versions that are officially supported and have not reached their end-of-life date.

Version Minimum Version End-of-Life Parse Server Support
Node.js 18 18.20.4 April 2025 <= 8.x (2025)
Node.js 20 20.19.0 April 2026 <= 9.x (2026)
Node.js 22 22.12.0 April 2027 <= 10.x (2027)
Node.js 24 24.11.0 April 2028 <= 11.x (2028)

MongoDB

Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the MongoDB support schedule and MongoDB lifecycle schedule and only test against versions that are officially supported and have not reached their end-of-life date. MongoDB "rapid releases" are ignored as these are considered pre-releases of the next major version.

Version Minimum Version End-of-Life Parse Server Support
MongoDB 6 6.0.19 July 2025 <= 8.x (2025)
MongoDB 7 7.0.16 August 2026 <= 9.x (2026)
MongoDB 8 8.0.4 TDB <= 10.x (2027)

PostgreSQL

Parse Server is continuously tested with the most recent releases of PostgreSQL and PostGIS to ensure compatibility, using PostGIS docker images. We follow the PostgreSQL support schedule and PostGIS support schedule and only test against versions that are officially supported and have not reached their end-of-life date. Due to the extensive PostgreSQL support duration of 5 years, Parse Server drops support about 2 years before the official end-of-life date.

Version PostGIS Version End-of-Life Parse Server Support
Postgres 13 3.1, 3.2, 3.3, 3.4, 3.5 November 2025 <= 6.x (2023)
Postgres 14 3.5 November 2026 <= 7.x (2024)
Postgres 15 3.3, 3.4, 3.5 November 2027 <= 8.x (2025)
Postgres 16 3.5 November 2028 <= 9.x (2026)
Postgres 17 3.5 November 2029 <= 10.x (2027)
Postgres 18 3.6 November 2030 <= 11.x (2028)

Locally

$ npm install -g parse-server mongodb-runner
$ mongodb-runner start
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test

Note: If installation with -g fails due to permission problems (npm ERR! code 'EACCES'), please refer to this link.

Docker Container

$ git clone https://github.com/parse-community/parse-server
$ cd parse-server
$ docker build --tag parse-server .
$ docker run --name my-mongo -d mongo

Running the Parse Server Image

$ docker run --name my-parse-server -v config-vol:/parse-server/config -p 1337:1337 --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test

Note: If you want to use Cloud Code, add -v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js to the command above. Make sure main.js is in the cloud-code-vol directory before starting Parse Server.

You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.

That's it! You are now running a standalone version of Parse Server on your machine.

Using a remote MongoDB? Pass the --databaseURI DATABASE_URI parameter when starting parse-server. Learn more about configuring Parse Server here. For a full list of available options, run parse-server --help.

Saving and Querying Objects

Now that you're running Parse Server, it is time to save your first object. The easiest way is to use the REST API, but you can easily do the same using any of the Parse SDKs. To learn more check out the documentation.

Connect an SDK

Parse provides SDKs for all the major platforms. Refer to the Parse Server guide to learn how to connect your app to Parse Server.

Running Parse Server elsewhere

Once you have a better understanding of how the project works, please refer to the Parse Server wiki for in-depth guides to deploy Parse Server to major infrastructure providers. Read on to learn more about additional ways of running Parse Server.

Sample Application

We have provided a basic Node.js application that uses the Parse Server module on Express and can be easily deployed to various infrastructure providers:

Parse Server + Express

You can also create an instance of Parse Server, and mount it on a new or existing Express website:

const express = require('express');
const ParseServer = require('parse-server').ParseServer;
const app = express();

const server = new ParseServer({
  databaseURI: 'mongodb://localhost:27017/dev', // Connection string for your MongoDB database
  cloud: './cloud/main.js', // Path to your Cloud Code
  appId: 'myAppId',
  masterKey: 'myMasterKey', // Keep this key secret!
  fileKey: 'optionalFileKey',
  serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed
});

// Start server
await server.start();

// Serve the Parse API on the /parse URL prefix
app.use('/parse', server.app);

app.listen(1337, function () {
  console.log('parse-server-example running on port 1337.');
});

For a full list of available options, run parse-server --help or take a look at [Parse Server Configurations][server-options].

Parse Server Health

Check the Parse Server health by sending a request to the /parse/health endpoint.

The response looks like this:

{
  "status": "ok"
}

Status Values

Value Description
initialized The server has been created but the start method has not been called yet.
starting The server is starting up.
ok The server started and is running.
error There was a startup error, see the logs for details.

Configuration

Parse Server can be configured using the following options. You may pass these as parameters when running a standalone parse-server, or by loading a configuration file in JSON format using parse-server path/to/configuration.json. If you're using Parse Server on Express, you may also pass these to the ParseServer object as options.

For the full list of available options, run parse-server --help or take a look at [Parse Server Configurations][server-options].

Basic Options

Client Key Options

The client keys used with Parse are no longer necessary with Parse Server. If you wish to still require them, perhaps to be able to refuse access to older clients, you can set the keys at initialization time. Setting any of these keys will require all requests to provide one of the configured keys.

Access Scopes

Scope Internal data Read-only data (1) Custom data Restricted by CLP, ACL Key
Internal r/w r/w r/w no maintenanceKey
Master -/- r/- r/w no masterKey
ReadOnlyMaster -/- r/- r/- no readOnlyMasterKey
Session -/- r/- r/w yes sessionToken

(1) Parse.Object.createdAt, Parse.Object.updatedAt.

[!NOTE] In Cloud Code, both masterKey and readOnlyMasterKey set request.master to true. To distinguish between them, check request.isReadOnly. For example, use request.master && !request.isReadOnly to ensure full master key access.

Route Allow List

The routeAllowList option restricts which REST API routes are accessible to external clients. When set, all external REST API requests are denied by default unless the route matches one of the configured regex patterns. This is useful for apps where a

parse-server (parse-community/parse-server)

Searching Database…

这是什么?Parse Server 是一个开源的后端,可以自己部署:你能把它部署到任何能跑 Node.js 的基础设施上,既可以独立运行,也可以嵌入 Express 应用。它为你的应用提供一套现成的 API 层,直接对接数据库,省得你自己搭建这些底层工作。
这是托管服务,还是我自己运行?由你自己运行——它就是服务器本身,不是托管云服务。你可以把它部署到任何支持 Node.js 的基础设施上,既可以作为独立服务,也可以加进现有的 Express Web 应用。
我怎么把它跑起来?安装自带 npm 的 Node.js,再加上 MongoDB 或 PostgreSQL(PostGIS 2.2.0 或更高版本),然后在本地运行 Parse Server——Docker 是可选的。wiki 里的 Parse Server 指南会带你完成第一次运行,完整文档也在那里。
我的 Node.js 要多新才行?只测试仍在积极维护的 Node.js 版本——已停止维护的版本不支持(README 标注 Node 18 的支持已于 2025 年 4 月结束)。这个包目前要求 Node 20.19+、22.13+ 或 24.11+。
一直待在长期支持(LTS)分支上安全吗?不太安全。LTS 的存在是为了帮你过渡到当前的大版本:虽然计划提供安全修复,但团队可能把某些漏洞留在 LTS 里让社区自己打补丁,未修复的漏洞会在 LTS 分支上以 pull request 的形式跟踪。
它能在哪些地方运行?凡是 Node.js 能跑的地方都行——Windows、macOS 和 Linux——还有官方文档化的 Docker 容器方案,wiki 里也介绍了如何在本地机器之外运行 Parse Server。
客户端应用怎么和服务器通信?开箱即用它提供 REST API 和一个 GraphQL API,后者的 schema 会根据你的类自动生成,还可以在代码里自定义。客户端一般通过 Parse SDK 连接,指南会带你创建第一个类,并保存和查询对象。
什么是 Cloud Code?Cloud Code 是 Parse 的服务端 JavaScript 层:你写的自定义逻辑在服务器上运行,而不是在客户端。wiki 里附带了专门的 Cloud Code 指南和 API 参考。
除了存储对象,它开箱还支持什么?支持的东西不少:通过可插拔的文件适配器做文件存储,通过 push 适配器发推送通知,还有邮箱验证和密码重置、用于实时更新的 Live Query、多租户、日志,以及对写入操作的幂等性保证。
它怎么控制谁能读或写数据?访问权限通过类级别权限(CLP)和对象上的 ACL 来限制。请求按密钥区分作用:session token 代表当前登录的用户,masterKey 拥有完全访问权限,readOnlyMasterKey 是只读的,而 routeAllowList 可以拒绝所有不匹配已配置模式的 REST 路由。
Size
158.2 MB
Stars
21.4K
Age
10y
Commits · 90 Days