Templating
Unanswered
timogo posted this in #help-forum
timogoOP
Objective:
I am working on a library that dynamically generates CRUD operations for any given entity using NextJS. The intention is to provide a CLI that allows developers to specify an entity and generate a structured set of pages and API routes for that entity. I need advice on how to best use NextJS templates to achieve this.
Relevant Code:
Here's a conceptual structure for the generated files, using "client" as an example:
In the
Inside this file:
N/A. This is a conceptual question at the moment, and I haven't encountered specific errors yet.
Attempts to Resolve:
I've read through the NextJS documentation on templates and tried to structure the directory and files as per the standard practices. However, I'm unsure if I'm fully leveraging the capabilities of NextJS templates and would appreciate insights from experienced developers.
Additional Context:
This "client" structure is just an example. The goal is for the generator to create similar structures for any entity name provided. I would love feedback on the proposed structure and any advice on how best to integrate with NextJS templates.
Thank you for your time and assistance!
PS: I am working on this project on this repo, if you want to check it out : https://github.com/timoogo/wizard-it-cli-v3
PS2: The README is currently in french, because the mains developpers are currently french
I am working on a library that dynamically generates CRUD operations for any given entity using NextJS. The intention is to provide a CLI that allows developers to specify an entity and generate a structured set of pages and API routes for that entity. I need advice on how to best use NextJS templates to achieve this.
Relevant Code:
Here's a conceptual structure for the generated files, using "client" as an example:
client/ folder containing:client/route.ts: Routes for the client entity.In the
src/constants/ directory, appending to:api.routes.constants.ts: Endpoint route for the client entity.Inside this file:
export const CLIENT_API_ROUTE = 'http://localhost:${PORT}/api/client';N/A. This is a conceptual question at the moment, and I haven't encountered specific errors yet.
Attempts to Resolve:
I've read through the NextJS documentation on templates and tried to structure the directory and files as per the standard practices. However, I'm unsure if I'm fully leveraging the capabilities of NextJS templates and would appreciate insights from experienced developers.
Additional Context:
This "client" structure is just an example. The goal is for the generator to create similar structures for any entity name provided. I would love feedback on the proposed structure and any advice on how best to integrate with NextJS templates.
Thank you for your time and assistance!
PS: I am working on this project on this repo, if you want to check it out : https://github.com/timoogo/wizard-it-cli-v3
PS2: The README is currently in french, because the mains developpers are currently french