mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
1.27k stars 282 forks source link

Docs: Add example page for Customers Admin app #1774

Closed prakhargupta1 closed 1 year ago

prakhargupta1 commented 1 year ago

Link to further details.

We'll put the working app in https://github.com/mui/mui-private repo and a showcase version in: https://github.com/mui/mui-public

prakhargupta1 commented 1 year ago

Rate limitation on the Xano API that is being used:

Screenshot 2023-04-25 at 3 45 51 PM
Janpot commented 1 year ago

@prakhargupta1 It's possible to "fake" a backend in-memory. For example:

import { createQuery } from "@mui/toolpad/server";

const customers = [{ name: "John Doe" }];

export async function getCustomers() {
  return customers;
}

export const addCustomer = createQuery(
  async ({ parameters }) => {
    customers.push({ name: parameters.name });
  },
  {
    parameters: {
      name: {
        typeDef: { type: "string" },
      },
    },
  }
);

We may also be able to leverage @faker-js/faker to generate data for demonstration purposes.

prakhargupta1 commented 1 year ago

Thanks, just did this and removed dependence on Xano APIs. Also, used form and file upload component in the Add user flow.