# Website Backend: Login, Data Tables, Forms, and Payments - Creght

> Creght sites are more than static pages. Func holds backend logic and API handlers, data tables and users are runtime resources, and you get email plus Google and GitHub OAuth login, form storage, protected pages, and Alipay payments.

[![Creght](https://ugc.talizen.com/_assets/site/2061660904709165056/1780797461299__creght_logo.png)](/)

Products

[AI Website BuilderRecommendedBuild websites and web apps through conversation](/ai.md) [Visual Website BuilderBuild precisely with a canvas, components, and effects](/design.md)

[Compare BothChoose the right creation method for your needs→](/ai-vs-visual-builder.md)

Capabilities

[AI generation](/ai.md) [Visual editing](/features/visual-editing.md) [Backend](/features/backend.md) [Publishing & hosting](/features/publishing.md) [SEO, GEO & analytics](/features/analytics.md) [Creght CLI](/features/cli.md) [All capabilities →](/features.md)

Solutions

[Designer Portfolio](/solution/designer-portfolio.md) [Foreign Trade Website](/solution/foreign-trade-website.md)

[Pricing](/price.md) [Help Center](/help.md)

[Resources](/resources.md)

Creght AI·Website Resources

[Website TemplatesStart from a complete website](/templates.md) [Page SectionsHero, pricing, case studies, and more](/blocks.md) [Motion InspirationDiscover reusable interaction effects](/effects.md)

[Browse all resources](/resources.md) [Visual Builder Resources](/design/resources.md)

[Contact Us](/contact.md)

[Get Started](https://creght.com/project)

[Home](/)/Capabilities/Backend

# When the site needs a backend, you don't switch platforms.

Login, bookings, memberships, form storage, payments — normally that means standing up a separate backend project. Here they are runtime resources of the site, and one sentence is enough to wire them together.

[Build your site free](https://creght.com/project?source=features_backend) [See pricing](/price.md)

Direct answer

## Can a Creght site have a backend, and how far does it go?

Yes. Func is the project's backend code entry point, holding backend logic and API handlers; data tables and the user system are runtime resources that Func reads and writes. Four common recipes are built in: create login, save form submissions to a table, generate CRUD handlers for a table, and require login before a page is viewable. Login supports email and password plus Google and GitHub OAuth, Alipay web payments have a full guide, and third-party apps such as Resend can be connected for email.

The limits are stated too: data tables are JSON tables and do not support joins, aggregation, transactions, or fuzzy matching — systems that need those should use a real database called from Func. The user directory is scoped to the whole project, so who-can-query-whom is a gate you write yourself. Func has a daily call limit that varies by plan.

The problem

## What static pages cannot carry

A marketing site eventually needs login, bookings, leads, or memberships. The traditional answer is a second project — and two things to maintain from then on.

| Without Creght | With Creght |
| --- | --- |
| Need login? Stand up a service, model users, write sessions. | The user system is a runtime resource; AI generates the code and page changes. |
| Form submissions only send email, and data lives in an inbox. | Func writes submissions into a data table you can query and edit. |
| Members-only pages mean writing your own middleware. | Protecting a page is a built-in recipe: require login to view. |
| Taking payment means a gateway, callbacks, and signature checks. | Alipay web payments have a full guide; other channels follow the same pattern. |

How it works

## What's in the backend panel

01

### Func is code; tables and users are runtime resources

Func holds the project's backend logic and API handlers; data tables store what Func reads and writes; the user system tracks site users and login state; environment variables hold server-side secrets. All four sit in the backend panel, and AI wires them into pages, endpoints, and flows.

/backend/func/booking.ts

```
export function create(input, ctx) {
  const user = ctx.auth.requireUser()
  return ctx.db.insert('appointments', {
    startAt: input.startAt,
    userId: user.id,
  })
}
```

Called from a page

```
await invoke('booking.create', input)
```

Platform capabilities come from ctx: ctx.auth for the current user, ctx.db for tables.

02

### Four common recipes are built in

Create login, save form submissions to a table, generate CRUD handlers, and require login before a page is viewable — each is one entry in the panel that generates the matching code and page changes for your project.

Common recipes

Create loginUse Auth users and generate the Func and page changes login needs.Try it

Save forms to the databaseStore visitor submissions in a table through a backend Func.Try it

Create CRUD endpointsGenerate backend handlers for a database table.Try it

Protect a pageRequire users to sign in before viewing the content.Try it

03

### Login with email or OAuth

Site users can register and sign in with email and password, and Google and GitHub OAuth are supported. Note that the user directory is scoped to the whole project, so any who-can-query-whom rule is a gate you write in Func.

Sign in

you@example.com

••••••••

Sign in

GoogleGitHub

The user directory is project-wide; write the access gate yourself in Func.

04

### Forms, email, payments, and integrations

Form submissions can be stored; email can go through third-party apps such as Resend; Alipay web payments have a full guide and other channels follow the same pattern. Data tables are JSON tables — no joins, aggregation, transactions, or fuzzy matching. Systems that need those should use a real database called from Func.

appointments

3 rows

| name | phone | startAt |
| --- | --- | --- |
| Lin Ke | 138\*\*\*\*2043 | 2026-08-08 10:00 |
| Chen Xu | 159\*\*\*\*7712 | 2026-08-08 14:30 |
| Zhou Wei | 186\*\*\*\*3388 | 2026-08-09 09:00 |

Submissions land in a table through Func. JSON tables have no joins, aggregation, transactions, or fuzzy matching.

Related docs

## Step-by-step guides

[Add login, bookings, and protected pages→](/docs/ai/backend-database-guide.md) [OAuth setup: Google and GitHub→](/docs/ai/backend-auth-guide.md) [Accept payments with Alipay→](/docs/ai/alipay-payment.md)

## Build the site first, then give it a backend.

Describe what you need and let AI build it; add login, form storage, or payments in one more sentence.

[Build your site free](https://creght.com/project?source=features_backend)

![Creght](https://ugc.talizen.com/_assets/site/2061660904709165056/1780797461299__creght_logo.png)

This website is built with [Creght](/)

[Discord](https://discord.gg/Qvq2nmZNnb)

## Links

- [Pricing](/price.md)
- [Solutions](/solution.md)
- [Customers](/customers.md)
- [Help Center](/help.md)
- [Contact Us](/contact.md)
- [Update Logs & Blogs](/blogs.md)
- [Refund Policy](/tuikuan.md)

## Resources

- [All Resources](/resources.md)
- [Templates](/templates.md)
- [Components](https://creghtlib.site.creght.com)
- [Animations](/design/effects.md)
- [Figma to Creght](/figma2creght.md)
- [API for AI](/api.md)

## Terms

- [Terms of Service](/legal/terms.md)
- [Privacy Policy](/legal/privacy.md)
- [Acceptable Use Policy](/legal/acceptable-use.md)

## Social Media

- [Twitter](https://twitter.com)
- [Facebook](https://www.facebook.com)
- [LinkedIn](https://www.linkedin.com)

[蜀ICP备2023038192号-2](https://beian.miit.gov.cn)
