Setup procedure
It can be easily set up via GUI.
Step 1
Select Front-end Framework
Step 2
Select Back-end Framework
Step 3
Select O/R mapper
Step 4
Select DataBase
Step 5
Setup CI
Step 6
Select Deploy Server
Type-Driven Development
API type definition on server/api/users/index.ts
export type Methods = {get: {resBody: {id: number;name: string;};};};
Backend: fix type error on server/api/users/controller.ts
import { defineController } from './$relay';export default defineController(() => ({get: () => ({status: 200,body: { id: 0, name: 'mario' },}),}));
Frontend: request from pages/index.tsx
import useAspidaSWR from '@aspida/swr';import { apiClient } from '~/utils/apiClient';const Home = () => {const { data: user } = useAspidaSWR(apiClient.users);return <div>{user.name}</div>;};export default Home;
TypeScript checks the entire application statically.
Since API type definition forces the controller type and http request, the test code is not necessary for communication.
Setting up a full-stack development environment is simple, so the product can be completed quickly and safely.