React Native Template

Todo App Backend Template
React Native — Schema, API & AI Guide

A production-ready React Native Todo backend schema and Starter Kit on Back4app: ER diagram, data dictionary, JSON schema, API playground, JavaScript/React Native code examples, offline-first pinning, and a one-click AI Agent prompt to deploy in minutes.

Key Takeaways

On this page you get a production-ready schema, a one-click AI prompt, and step-by-step React Native code — so you can ship a Todo app without building the backend.

  1. Deploy in minutespaste the AI Agent prompt and get a running app with frontend, backend, and database.
  2. Secure by defaultrow-level ACLs ensure each user only sees their own todos.
  3. React Native-native SDKParse React Native SDK with async/await, local pinning, and Live Queries out of the box.
  4. REST + GraphQLboth APIs are auto-generated; no custom endpoints to write.
  5. Two classes_User (built-in auth) and Todo (tasks with title, done, dueDate, priority, owner).

What Is the React Native Todo App Backend Template?

The React Native Todo App Backend Template is a pre-built, production-ready backend schema hosted on Back4app. It gives you two database classes (_User and Todo), ownership-based ACLs, REST and GraphQL APIs, and a one-click AI Agent prompt — so you can connect a React Native app and ship a working Todo app with offline support in minutes instead of days.

Best for:

React Native developersExpo & bare workflowOffline-first mobile appsMVP launchesCross-platform iOS & Android

Overview

A Todo app is one of the most common starting points for learning backend development. Under the hood it needs user registration, task CRUD, ownership-based access control, and optionally real-time sync and offline support.

The schema below defines two classes — _User (built-in) and Todo — connected by a Pointer. With the Parse React Native SDK (Back4app), you can interact with this backend directly from your JavaScript or TypeScript code — querying, creating, updating, and deleting objects, plus pinning for offline — without writing a custom API layer.

Why Build Your React Native Todo Backend with Back4app?

Back4app gives you a ready backend and the Parse React Native SDK so you can focus on UX and performance instead of REST wiring and auth.

  • Offline-first & sync: Pin Todo objects to the local datastore so the list works offline and syncs when the app is back online — ideal for mobile.
  • Components & hooks: Use the SDK with React hooks and context; keep state in sync with Parse queries and Live Queries for real-time updates.
  • Cross-platform, one backend: Same schema and APIs for iOS and Android; ideal for React Native teams using Expo or bare workflow.

Ideal for React Native developers using Expo or the bare workflow — one backend, both platforms.

Core Benefits

A production-ready Todo backend so you can ship faster and focus on your app.

Ship Faster, No Backend Code

REST & GraphQL APIs and a ready-to-use schema — connect your app and go.

Secure by Default

ACLs and class-level permissions so users only access their own data.

Real-Time Updates

Live Queries over WebSockets for instant UI updates.

Built-In Auth

User sign-up, login, and session handling out of the box — no custom auth layer.

Works Offline

Local pinning keeps data available offline and syncs when you reconnect.

Deploy in Minutes

Use the AI Agent to create and deploy your Todo app from this template.

Ready to try it?

Let the Back4app AI Agent create your Todo app backend, connect the React Native frontend, and deploy — all from a single prompt.

Free to start — 50 AI Agent prompts/month, no credit card required

Technical Stack

Everything powering this Todo app template at a glance.

Frontend
React Native
Backend
Back4app
Database
MongoDB
Auth
Auth & Access Control
APIs
REST & GraphQL
Deployment
AI Agent / Dashboard

ER Diagram

Entity-Relationship diagram for the React Native Todo app data model.

View diagram source
Mermaid
erDiagram
    _User {
        String objectId PK
        String username
        String email
        String password
        Date createdAt
        Date updatedAt
    }

    Todo {
        String objectId PK
        String title
        Boolean done
        Date dueDate
        Number priority
        Pointer owner FK
        Date createdAt
        Date updatedAt
    }

    _User ||--o{ Todo : "owns"

Integration Flow

Auth-to-CRUD sequence: how your React Native app talks to Back4app — login, then query and create todos.

View diagram source
Mermaid
sequenceDiagram
  participant User
  participant App as React Native App
  participant Back4app as Back4app Cloud

  User->>App: Login
  App->>Back4app: Parse.User.logIn(username, password)
  Back4app-->>App: Session token
  App-->>User: Logged in

  User->>App: Load todos
  App->>Back4app: new Parse.Query('Todo').find()
  Back4app-->>App: Array of Todo
  App-->>User: Show list

  User->>App: Create todo
  App->>Back4app: todo.save()
  Back4app-->>App: Todo (objectId)
  App-->>User: Updated list

Data Dictionary

Complete field reference for every class in the schema.

FieldTypeDescriptionRequired
objectIdStringAuto-generated unique identifierauto
titleStringShort description of the task
doneBooleanWhether the task is completed
dueDateDateOptional deadline for the task
priorityNumberPriority level (1 = high, 3 = low)
ownerPointer<_User>User who owns this task
createdAtDateAuto-generated creation timestampauto
updatedAtDateAuto-generated last-update timestampauto

8 fields in Todo

Security & Permissions

How ownership, ACLs, and class-level permissions protect data in this schema.

Row-Level ACLs

Each Todo gets an ACL tied to its owner. Only the creator can read, update, or delete their own tasks.

Class-Level Permissions

CLPs restrict which roles or users can create, read, update, or delete objects at the class level — your first line of defense.

Pointer-Based Ownership

The owner Pointer links each Todo to its _User. Cloud Code triggers can auto-set ownership and enforce ACLs on save.

Schema (JSON)

Raw JSON schema definition — copy and use in your Back4app app or import via the API.

JSON
{
  "classes": [
    {
      "className": "Todo",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "title": {
          "type": "String",
          "required": true
        },
        "done": {
          "type": "Boolean",
          "required": false,
          "defaultValue": false
        },
        "dueDate": {
          "type": "Date",
          "required": false
        },
        "priority": {
          "type": "Number",
          "required": false,
          "defaultValue": 3
        },
        "owner": {
          "type": "Pointer",
          "targetClass": "_User",
          "required": false
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    },
    {
      "className": "_User",
      "fields": {
        "objectId": {
          "type": "String",
          "required": false
        },
        "username": {
          "type": "String",
          "required": true
        },
        "email": {
          "type": "String",
          "required": true
        },
        "password": {
          "type": "String",
          "required": true
        },
        "createdAt": {
          "type": "Date",
          "required": false
        },
        "updatedAt": {
          "type": "Date",
          "required": false
        }
      }
    }
  ]
}

Build with AI Agent

Use the Back4App AI Agent to build a real Todo app from this template: it will create the frontend, the backend (this schema, auth, and APIs), and deploy it — no manual setup. The prompt below describes this Todo stack so the Agent can generate a production-ready app in one go.

Back4app AI Agent
Ready to build
Create a Todo app on Back4app with this exact schema and behavior.

Schema:
1. _User (use Back4app built-in): username (String, required), email (String, required), password (String, required); objectId, createdAt, updatedAt (system).
2. Todo: title (String, required), done (Boolean, default: false), dueDate (Date, optional), priority (Number, default: 3; 1=high, 2=medium, 3=low), owner (Pointer to _User; set to current user on create); objectId, createdAt, updatedAt (system).

Security:
- Set ACLs on every Todo so only the owner has read and write. No public read/write.
- On create, set Todo.owner to the current user (e.g. via Cloud Code beforeSave or client-side).
- Use Class-Level Permissions so only authenticated users can create/read/update/delete Todo.

Auth:
- Sign-up (username, email, password) and login; support logout/session.
- After login, the app should only show and allow CRUD for the current user's todos.

Behavior:
- Full CRUD for Todo: create, list (only owner's), get one, update (toggle done, edit title, dueDate, priority), delete.
- List todos with sort (e.g. by priority then dueDate or createdAt). Default priority for new todos: 3 (low).

Deliver:
- Create the Back4app app with the schema above, ACLs, and any Cloud Code needed (e.g. beforeSave on Todo to set owner).
- Generate the frontend and connect it to this backend; deploy so the app is runnable end-to-end.

Press the button below to open the Agent with this template's prompt pre-filled.

Deploy in minutes50 free prompts / monthNo credit card required

API Playground

Try the REST and GraphQL endpoints for the Todo schema. Responses from the example data above — no Back4app account needed.

Loading playground…

Uses the same Todo schema as this template.

Step-by-Step React Native Integration

Connect to your Back4app backend from a React Native app using the Parse React Native SDK.

  1. Step 1: Install Parse React Native SDK

    Add the Parse React Native SDK (or react-native-parse) to your project with npm or yarn.

    JavaScript
    npm install parse --save
    # or: yarn add parse
  2. Step 2: Initialize Parse in your app

    Initialize the Parse SDK in your app entry (e.g. App.js or index.js) with your Application ID, server URL, and JavaScript key.

    JavaScript
    import Parse from 'parse/react-native';
    
    Parse.setAsyncStorage(AsyncStorage);
    Parse.initialize('YOUR_APP_ID', 'YOUR_JS_KEY');
    Parse.serverURL = 'https://parseapi.back4app.com';
    
  3. Step 3: Query all todos

    Create a Parse Query for the Todo class, add ascending order by priority, and call find() (or findWithCount()).

    JavaScript
    async function getTodos() {
      const query = new Parse.Query('Todo').ascending('priority');
      const results = await query.find();
      return results;
    }
  4. Step 4: Create a todo

    Create a new Parse.Object('Todo'), set title, done, and priority, then call save().

    JavaScript
    async function createTodo(title, priority = 3) {
      const Todo = Parse.Object.extend('Todo');
      const todo = new Todo();
      todo.set('title', title);
      todo.set('done', false);
      todo.set('priority', priority);
      await todo.save();
      return todo;
    }
  5. Step 5: Update and delete todos

    Fetch a Todo by objectId, set fields and call save() to update, or call destroy() to delete.

    JavaScript
    async function markDone(objectId) {
      const query = new Parse.Query('Todo');
      const todo = await query.get(objectId);
      todo.set('done', true);
      await todo.save();
    }
    
    async function deleteTodo(objectId) {
      const query = new Parse.Query('Todo');
      const todo = await query.get(objectId);
      await todo.destroy();
    }

State Management

Use React hooks (useState, useReducer, useContext) or a small store to hold Todo list state and call the Parse SDK.

Full JavaScript/TypeScript Data Model

Copy a complete Todo type and helpers for type-safe serialization with the Parse SDK.

JavaScript
/** @typedef {{ objectId?: string, title: string, done: boolean, dueDate?: string, priority: number, owner?: { objectId: string }, createdAt?: string, updatedAt?: string }} Todo */

/**
 * @param {Parse.Object} obj
 * @returns {Todo}
 */
function todoFromParse(obj) {
  return {
    objectId: obj.id,
    title: obj.get('title'),
    done: obj.get('done') ?? false,
    dueDate: obj.get('dueDate')?.toISOString?.() ?? undefined,
    priority: obj.get('priority') ?? 3,
    owner: obj.get('owner') ? { objectId: obj.get('owner').id } : undefined,
    createdAt: obj.get('createdAt')?.toISOString?.() ?? undefined,
    updatedAt: obj.get('updatedAt')?.toISOString?.() ?? undefined,
  };
}

Offline-First & Local Datastore

Use pinAll() and unpin so data is available offline and syncs when back online.

The Parse React Native SDK supports a local datastore. After fetching Todo objects, pin them so the list is available offline; run the same query with fromLocalDatastore() when the device is offline. When the app is back online, save changes and sync.

Below: pin results after fetch, and unpin when you no longer need local copies.

JavaScript
// Pin todos after fetch (offline-first)
async function fetchAndPinTodos() {
  const query = new Parse.Query('Todo').ascending('priority');
  const results = await query.find();
  await Parse.Object.pinAll(results);
  // When offline, read from local datastore:
  // const localQuery = new Parse.Query('Todo').fromLocalDatastore();
  // const localResults = await localQuery.find();
}

async function unpinAllTodos() {
  await Parse.Object.unpinAll('Todo');
}

Frequently Asked Questions

Common questions about the Todo app backend template.

Trusted by developers worldwide

Join the community building the future of apps

G2 Users Love Us Badge

Ready to Build Your Todo App?

Start your React Native project in minutes. No credit card required.

Build with AI Agent