Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Cell is a Serverless First, componentized, platform-independent progressive application framework based on TypeScript. Cell 是基于 TypeScript 的 Serverless First、组件化、平台无关的渐进式应用框架。

License

NotificationsYou must be signed in to change notification settings

cellbang/cell

Repository files navigation

English |简体中文

Cell Logo

GitHub Licensenpm Versionnpm DownloadsBuild StatusStars

Cell is aServerless First,Component-based, andPlatform-independent progressive application framework based on TypeScript.

Features

  • Zero Configuration: Out of the box, reduces configuration complexity.
  • Based on TypeScript: Provides strong type support, enhancing development efficiency.
  • AI Support: Provides AI basic abstraction and multi-vendor model service interface adaptation.
  • Serverless First: Optimizes Serverless application development.
  • Cross-Platform: Platform agnostic, flexible deployment.
  • Full-Stack Support: Front and back-end integration, compatible with various front-end frameworks.
  • Microservices Architecture: Supports building and managing microservices.
  • Component-based: Modular design, easy to extend and maintain.
  • Plugin-based Tools: Command line tools support plugins, enhancing functionality.
  • Dependency Injection: Simplifies dependency management between components.
  • Aspect-Oriented Programming (AOP): Implements modularization of cross-cutting concerns.
  • Integrated ORM: Uses decorators for transaction management, simplifying database operations.
  • Authentication and Authorization: Supports OIDC authentication and OAuth2 authorization.
  • State Management: Uses rxjs for managing application state.
  • Multiple Interface Styles: Supports both REST and RPC interfaces.

Quick Start

# Install command line toolnpm install -g @celljs/cli# Initialize projectcell init -o project-namecd project-name# Enter project root directory# Run projectcell serve# Deploy projectcell deploy -m scf# Deploy to Tencent Cloud Functions (SCF)cell deploy -mfc# Deploy to Alibaba Cloud Function Compute (FC)cell deploy -m lambda# Deploy to AWS Lambda

Quick Start

Samples

Documentation

Dependency injection

// Class object injection@Component()exportclassA{}@Component()exportclassB{    @Autowired()protecteda:A;}// Configuration property injection@Component()exportclassC{    @Value('foo')// Support EL expression syntax, such as @Value('obj.xxx'), @Value('arr[1]') etc.protectedfoo:string;}

Database operations

import{Controller,Get,Param,Delete,Put,Post,Body}from'@celljs/mvc/lib/node';import{Transactional,OrmContext}from'@celljs/typeorm/lib/node';import{User}from'./entity';@Controller('users')exportclassUserController{        @Get()    @Transactional({readOnly:true})list():Promise<User[]>{constrepo=OrmContext.getRepository(User);returnrepo.find();}    @Get(':id')    @Transactional({readOnly:true})get(@Param('id')id:number):Promise<User|undefined>{constrepo=OrmContext.getRepository(User);returnrepo.findOne(id);}    @Delete(':id')    @Transactional()asyncremove(@Param('id')id:number):Promise<void>{constrepo=OrmContext.getRepository(User);awaitrepo.delete(id);}    @Put()    @Transactional()asyncmodify(@Body()user:User):Promise<void>{constrepo=OrmContext.getRepository(User);awaitrepo.update(user.id,user);}    @Post()    @Transactional()create(@Body()user:User):Promise<User>{constrepo=OrmContext.getRepository(User);returnrepo.save(user);}}

Discuss group

群二维码.png

Status

Alt


[8]ページ先頭

©2009-2025 Movatter.jp