Top Related Projects
👨🏻💻👩🏻💻 Use Ant Design like a Pro!
A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
A Form and Data Management Platform for Progressive Web Applications.
🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.
The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.
Quick Overview
Amis is a low-code front-end framework developed by Baidu. It allows developers to create complex web applications using JSON configurations instead of writing traditional code. Amis aims to simplify the process of building data-driven interfaces and admin panels.
Pros
- Rapid development: Build complex UIs quickly using JSON configurations
- Extensive component library: Offers a wide range of pre-built components
- Flexibility: Supports custom components and extensions
- Low learning curve: Easier for non-developers to create interfaces
Cons
- Limited customization: Some advanced UI requirements may be challenging to implement
- Performance concerns: Large applications may experience slower load times
- Dependency on Baidu's ecosystem: May not integrate as smoothly with other frameworks
- Documentation primarily in Chinese: Can be a barrier for non-Chinese speakers
Code Examples
- Creating a simple form:
{
"type": "form",
"api": "/api/form/save",
"body": [
{
"type": "input-text",
"name": "name",
"label": "Name"
},
{
"type": "input-email",
"name": "email",
"label": "Email"
}
]
}
- Displaying a data table:
{
"type": "table",
"api": "/api/users",
"columns": [
{
"name": "id",
"label": "ID"
},
{
"name": "name",
"label": "Name"
},
{
"name": "email",
"label": "Email"
}
]
}
- Creating a chart:
{
"type": "chart",
"api": "/api/chart/data",
"chartType": "line",
"x": "date",
"y": "value"
}
Getting Started
- Install Amis:
npm install amis
- Create an HTML file with the following content:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Amis Demo</title>
<link rel="stylesheet" href="https://unpkg.com/amis/lib/themes/default.css">
<script src="https://unpkg.com/amis/lib/index.js"></script>
</head>
<body>
<div id="root"></div>
<script>
let amis = amisRequire('amis/embed');
let amisJSON = {
type: 'page',
title: 'Hello World',
body: 'Welcome to Amis!'
};
amis.embed('#root', amisJSON);
</script>
</body>
</html>
- Open the HTML file in a web browser to see your first Amis application.
Competitor Comparisons
👨🏻💻👩🏻💻 Use Ant Design like a Pro!
Pros of Ant Design Pro
- More comprehensive ecosystem with extensive documentation and community support
- Built on top of the popular Ant Design component library, offering a wide range of pre-built UI components
- Provides a complete out-of-the-box solution for enterprise-level applications
Cons of Ant Design Pro
- Steeper learning curve due to its complexity and extensive feature set
- Less flexibility for customization compared to Amis' low-code approach
- Heavier bundle size, which may impact initial load times
Code Comparison
Ant Design Pro (TypeScript):
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Alert, Typography } from 'antd';
const Welcome: React.FC = () => (
<PageContainer>
<Card>
<Alert message="Welcome to Ant Design Pro" type="success" showIcon />
</Card>
</PageContainer>
);
Amis (JSON):
{
"type": "page",
"title": "Welcome",
"body": {
"type": "alert",
"level": "success",
"body": "Welcome to Amis"
}
}
Both repositories offer powerful tools for building web applications, but they cater to different needs. Ant Design Pro provides a more traditional development experience with a rich set of components and features, while Amis focuses on a low-code approach for rapid development.
A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
Pros of react-admin
- More mature and widely adopted in the React ecosystem
- Extensive documentation and community support
- Highly customizable with a modular architecture
Cons of react-admin
- Steeper learning curve for beginners
- Requires more setup and configuration compared to amis
- Less out-of-the-box UI components
Code Comparison
react-admin:
import { Admin, Resource } from 'react-admin';
import { PostList, PostEdit, PostCreate } from './posts';
const App = () => (
<Admin dataProvider={...}>
<Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} />
</Admin>
);
amis:
{
"type": "page",
"body": {
"type": "crud",
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample",
"columns": [
{ "name": "id", "label": "ID" },
{ "name": "engine", "label": "Rendering engine" }
]
}
}
The code snippets demonstrate the different approaches: react-admin uses a more programmatic setup with React components, while amis utilizes a declarative JSON-like configuration for defining the UI and data interactions.
A Form and Data Management Platform for Progressive Web Applications.
Pros of Formio
- More extensive documentation and community support
- Offers a wider range of form components and field types
- Provides a robust API for backend integration and data management
Cons of Formio
- Steeper learning curve due to its more complex architecture
- Requires more setup and configuration compared to Amis
- May be overkill for simpler form-building needs
Code Comparison
Formio form definition:
{
"components": [
{
"type": "textfield",
"key": "firstName",
"label": "First Name"
},
{
"type": "textfield",
"key": "lastName",
"label": "Last Name"
}
]
}
Amis form definition:
{
"type": "form",
"body": [
{
"type": "input-text",
"name": "firstName",
"label": "First Name"
},
{
"type": "input-text",
"name": "lastName",
"label": "Last Name"
}
]
}
Both Formio and Amis use JSON configurations to define forms, but Formio's structure is more detailed and offers more customization options. Amis, on the other hand, provides a simpler and more straightforward approach to form definition, which can be easier for beginners to grasp and implement quickly.
🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.
Pros of Strapi
- Open-source headless CMS with a user-friendly admin panel
- Highly customizable and extensible through plugins
- Built-in API generation and GraphQL support
Cons of Strapi
- Steeper learning curve for developers new to headless CMS
- Requires more setup and configuration compared to low-code platforms
- Limited built-in UI components for front-end development
Code Comparison
Strapi (Content-Type definition):
module.exports = {
attributes: {
title: {
type: 'string',
required: true,
},
content: {
type: 'richtext',
},
},
};
Amis (JSON-based UI definition):
{
"type": "page",
"body": {
"type": "form",
"api": "/api/form",
"controls": [
{ "type": "text", "name": "title", "label": "Title" },
{ "type": "textarea", "name": "content", "label": "Content" }
]
}
}
Strapi focuses on backend content management and API generation, while Amis is a low-code UI builder. Strapi offers more flexibility for custom backend logic, but requires separate front-end development. Amis provides a quicker way to build user interfaces with less code, but may be less suitable for complex, custom backend requirements.
The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.
Pros of Directus
- More flexible and customizable backend system
- Better support for complex data relationships and structures
- Larger and more active community, with frequent updates and contributions
Cons of Directus
- Steeper learning curve for beginners
- Requires more setup and configuration compared to Amis
- May be overkill for simple projects or prototypes
Code Comparison
Directus (API endpoint definition):
module.exports = {
id: 'custom',
handler: (router, { services, exceptions }) => {
router.get('/', (req, res) => {
res.send('Hello World!');
});
},
};
Amis (Page configuration):
{
"type": "page",
"body": {
"type": "tpl",
"tpl": "Hello World!"
}
}
Both repositories offer different approaches to building web applications. Directus focuses on providing a flexible headless CMS and API, while Amis emphasizes rapid UI development with a low-code approach. The choice between them depends on project requirements, team expertise, and desired level of customization.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
å端ä½ä»£ç æ¡æ¶ï¼éè¿ JSON é 置就è½çæåç§åå°é¡µé¢ï¼æ大åå°å¼åææ¬ï¼çè³å¯ä»¥ä¸éè¦äºè§£å端ã
å¼åæå
以ä¸æ¯åä¸å¼å amis æéè¦ççï¼ä½¿ç¨è¯·çåé¢çææ¡£ã
å¦æ github ä¸è½½æ ¢å¯ä»¥ä½¿ç¨ gitee ä¸çéåã
æ¨èä½¿ç¨ node 12/14/16ãnpm 7+ï¼ å 为ç¨å°äº workspaces åè½ã
# å®è£
é¡¹ç® npm ä¾èµï¼å¨ node 12 ä¸ä¼ææ¥éä½ä¸å½±åæ£å¸¸ä½¿ç¨ã
npm i --legacy-peer-deps
# å¯å¨é¡¹ç®ï¼çç¼è¯ç»æåéè¿ http://127.0.0.1:8888/examples/pages/simple 访é®ã
npm start
å¦ææ¯å¼åç¼è¾å¨ï¼éè¦è®¿é® http://127.0.0.1:8888/packages/amis-editor/
æµè¯
注æï¼æ¬å°ä¿®æ¹ä»£ç åï¼æ§è¡æµè¯ç¨ä¾ï¼
npm test --workspaces
ï¼ä¹åéè¦å æ§è¡npm run build
å®æç¼è¯ï¼å 为 jest 并ä¸æ¯æ TypeScript
# å®è£
ä¾èµ
npm i --legacy-peer-deps
# æ§è¡æ建
npm run build
# æ§è¡æµè¯ç¨ä¾
npm test --workspaces
# æµè¯æ个ç¨ä¾
# <spec-name>为ç¨ä¾å称ï¼æ¯å¦inputImage
npm test --workspace amis -- -t <spec-name>
# è¿è¡æ个åæµæ件
./node_modules/.bin/jest packages/amis/__tests__/renderers/Form/buttonToolBar.test.tsx
# è¿è¡æ个åæµæ件éçæ个ä¾å
./node_modules/.bin/jest packages/amis/__tests__/renderers/Form/buttonToolBar.test.tsx -t 'Renderer:button-toolbar'
# æ¥çæµè¯ç¨ä¾è¦çç
npm run coverage
# æ´æ° snapshot
npm run update-snapshot
# æ´æ°å个 snapshot
# <spec-name>为ç¨ä¾å称ï¼æ¯å¦inputImage
npm run update-snapshot --workspace amis -- -t <spec-name>
åå¸çæ¬
# åå¸å
é¨ registry
npm run publish
# åå¸å¤ç½ç¯å¢
# å
éè¿ä¸ä¸å½ä»¤è®¾ç½®çæ¬å·
npm run version
npm run release
å¦ä½è´¡ç®
请使ç¨åæ¯å¼åï¼é¦å å建åæ¯
git checkout -b feat-xxx
å¼åæ交åä½¿ç¨ git push --set-upstream origin feat-xxx
å建è¿ç¨åæ¯ã
ç¶åéè¿ç³»ç»æ示ç https://github.com/xxx/amis/pull/new/feat-xxx é¾æ¥æ¥æ交 PRã
请éç¨ typescript ç¼åï¼ææåççæ¹å¨ãæ°çå ¬ç¨æ¸²æå¨ãç¨ä¾æè ææ¡£çæ交é½ä¼è¢«æ¥æ¶ã
è´¡ç®è
ä½ä»£ç å¹³å°
amis åªè½å®ç°å端ä½ä»£ç ï¼å¦æéè¦å®æ´çä½ä»£ç å¹³å°æ¨è使ç¨ç±éæã
Top Related Projects
👨🏻💻👩🏻💻 Use Ant Design like a Pro!
A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
A Form and Data Management Platform for Progressive Web Applications.
🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.
The flexible backend for all your projects 🐰 Turn your DB into a headless CMS, admin panels, or apps with a custom UI, instant APIs, auth & more.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot