Play with modules

  • Build complete, type-safe applications
  • Deploy simultaneously to multiple platforms
  • Maintain consistent patterns and high performance
Model Definition
import { Field, Model } from "@akanjs/constant";
@Model()
export class Project {
  @Field()
  id: string;
  @Field()
  title: string;
  @Field()
  description: string;
  @Field()
  status: "active" | "completed" | "archived";
  @Field()
  createdAt: Date;
  @Field()
  updatedAt: Date;
}
Service Implementation
import { Project } from "./project.constant";
export const projectService = {
  async getProjects() {
    return Project.find().sort({ updatedAt: -1 });
  },
  async createProject(data: Partial<Project>) {
    return Project.create(data);
  },
};
Signal Definition
import { Signal } from "@akanjs/signal";
import { Project } from "./project.constant";
import { projectService } from "./project.service";
export class ProjectSignal {
  @Signal()
  async projectList() {
    return projectService.getProjects();
  }
  @Signal()
  async createProject(data: Partial<Project>) {
    return projectService.createProject(data);
  }
}
UI Component
import { usePage } from "@akanjs/client";
import { projectSignal } from "./project.signal";
export const ProjectView = () => {
  const { data } = projectSignal.useProjectList();
  const { l } = usePage();
  return (
    <div>
      <h1>{l("project.modelName")}</h1>
      <div className="grid gap-4">
        {data?.map((project) => <ProjectUnit key={project.id} project={project} />)}
      </div>
    </div>
  );
};
Component Architecture

Model.View.tsx

Page-level components that display a full page or section

Model.Unit.tsx

Card or list item components that display a single instance

Model.Template.tsx

Form components for creating or editing models

Model.Zone.tsx

Layout containers that organize multiple components

Development Tools and Commands
CommandDescription
akan start my-appStart frontend and backend
akan generate:module customerGenerate a new module
akan build my-appBuild for production
akan deploy my-appDeploy to Akan Cloud
akan test my-appRun unit tests
Further Resources
Released under the MIT License
Official Akan.js Consulting onAkansoft
Copyright © 2025 Akan.js. All rights reserved.
System managed bybassman