简介
MemFire Cloud应用开发服务,采用开源的Supabase,兼容国内开发生态,内置通用服务,简单易学,加速小程序/移动APP/WEB应用的开发,降低开发/运维成本。
立即体验:MemFire Cloud
查阅文档:在线文档
重新定义应用开发流程
借助MemFire Cloud的强大能力,用户只需开发客户端和云函数,简化服务端搭建、开发、维护。
无需搭建后端,无需开发接口,前端即可完成开发应用工作;
“超能力”数据库
采用开源流行的PostgreSQL数据库,随时可迁移;
易于使用的仪表盘
① 简单易用的表编辑器
类似编辑电子表格,简单添加、编辑、更新数据。
② 强大的SQL编辑器
内置强大的SQL编辑,支持数据导入导出、SQL查询保存。
再也不用编写API
拿来即用,自动生成数据表API,用户可专注于开发的产品应用;
创建数据表
create table
countries (id int8 primary key, name text);
插入数据
const { error } = await supabase
.from('countries')
.insert({ id: 1, name: 'Denmark' })
查询数据
const { data, error } = await supabase
.from('countries')
.select()
请查阅文档:https://document.memfiredb.com/docs/guides/database
认证与身份鉴权
1.完整的用户管理系统,支持邮箱、短信、微信小程序等多种方式登录;
① 注册
const { data, error } = await supabase.auth.signUp({
email: 'example@email.com',
password: 'example-password',
})
② 登录
const { data, error } = await supabase.auth.signInWithPassword({
email: 'example@email.com',
password: 'example-password',
})
③ 魔法链接
const { data, error } = await supabase.auth.signInWithOtp({
email: 'example@email.com',
})
请查阅文档:https://document.memfiredb.com/docs/guides/auth/auth-email
2. 使用Postgres的行级安全性保护您的数据。
① 允许读取访问
-- 1. Create table
create table profiles (
id uuid references auth.users,
avatar_url text
);
-- 2. Enable RLS
alter table profiles
enable row level security;
-- 3. Create Policy
create policy "Public profiles are viewable by everyone."
on profiles for select using (
true
);
② 限制更新
-- 1. Create table
create table profiles (
id uuid references auth.users,
avatar_url text
);
-- 2. Enable RLS
alter table profiles
enable row level security;
-- 3. Create Policy
create policy "Users can update their own profiles."
on profiles for update using (
auth.uid() = id
);
文件存储
具有无限扩展的对象存储,适用于任何文件类型。
1.支持拖拽、上传、下载、移动文件,像本地桌面工作一样简单;
2.可自定义访问策略,满足企业数据安全与合规要求。
① 允许所有人访问存储桶
-- 1. Allow public access to any files in the "public" bucket
create policy "Public Access"
on storage.objects for select
using ( bucket_id = 'public' );
② 允许注册用户访问存储桶
-- 1. Allow logged-in access to any files in the "restricted" bucket
create policy "Restricted Access"
on storage.objects for select
using (
bucket_id = 'restricted'
and auth.role() = 'authenticated'
);
③ 允许个人访问文件
-- 1. Allow a user to access their own files
create policy "Individual user Access"
on storage.objects for select
using ( auth.uid() = owner );
请查阅文档:https://document.memfiredb.com/docs/guides/storage
云函数
采用云函数实现复杂业务逻辑、调用第三方服务API,保证业务的安全性。
请查阅文档:https://document.memfiredb.com/docs/guides/functions/overview
实时订阅
轻松构建任何类型的实时应用程序,减少无意义轮询和数据库调用,降低获取数据延迟。
① 侦听
侦听数据库插入、更新、删除以及其他变更操作。
② 存储
在各客户之间一致地存储和同步在线用户状态。
③ 广播
以低延时将任务消息数据发送到订阅同一频道的任何客户端。
请查阅文档:https://document.memfiredb.com/docs/guides/realtime
MemFire Cloud应用能构建什么?
MemFire Cloud应用开发提供完整的BaaS服务,无需搭建服务器,使用平台提供的 API 进行核心业务开发,即可实现快速上线和迭代。
购物平台
电商小程序、团购小程序等,商品信息云存储,用户互动拼团,下单支付、客服聊天等场景支持;
示例链接:“环球商城”开发文档
互动小游戏
基于数据库、实时realtime、自动生成API等能力,实现在线棋牌、角色扮演、益智类等小游戏;
示例链接:https://document.memfiredb.com/docs/guides/example/notClickWhite
社交类应用
聊天、交友、相亲类型的APP/网站/小程序,支持用户互动,存储文字、图片、视频、聊天信息等
示例链接: https://document.memfiredb.com/docs/guides/example/Playground
实用工具
投票工具、网盘、文件共享、团队协作工具、各种创意插件等;
示例链接:https://github.com/TiannV/Valine
全栈网站
结合云数据库、云函数等能力+静态托管托管,实现带有后台服务端的全栈网站;
示例链接: http://ch2vlma5g6h9k9li2hag.app.memfiredb.com/list
管理后台
采用MemFire Cloud应用开发+refine实现管理后台;
示例链接:Supabase | Refine
兼容开源框架
基于Postgres的数据库,兼容多种工具和框架。