You
I'm building the API for a project manager. I want to start with something simple that can grow.
Code, architecture, and product
I'm building the API for a project manager. I want to start with something simple that can grow.
We can start with projects, members, and tasks. I'd keep a single API and separate its responsibilities. Have you chosen a stack?
Yes, TypeScript and Next.js. I'm worried about mixing logic with the interface.
I'd separate validation, business logic, and data access. That way you can test each part without running the whole application.
type Project = { id: string; name: string };
export async function getProject(id: string) {
const response = await fetch(`/api/projects/${id}`);
if (!response.ok) {
throw new Error("Unable to load project");
}
return response.json() as Promise<Project>;
}That works for me. How would you organize the next steps?
I'd tackle it in three small steps, with a check at the end of each one.