Feature and Module Structure Tour
Understanding a feature (tool) in this repo How features are built and how new ones should fit in
JSON Formatter tool uses:
├── app/components/developmentToolsComponent/
│ └── jsonPrittifierComponent.tsx (The actual tool component)
├── app/libs/
│ ├── developmentToolsConstant.tsx (Tool metadata & registration)
│ ├── helpers.tsx (Shared formatting utilities)
│ └── constants.tsx (Route definitions)
└── app/components/ui/ (Reusable UI: buttons, inputs, copy)"use client";
import { Editor } from "@monaco-editor/react"; // Monaco editor for code
import { useState } from "react";
export default function JsonPrettifier() {
const [input, setInput] = useState("");
const [output, setOutput] = useState("");
const [error, setError] = useState("");
const handlePrettify = () => {
try {
const parsed = JSON.parse(input);
setOutput(JSON.stringify(parsed, null, 2));
setError("");
} catch (err) {
setError("Invalid JSON");
}
};
return (
<div>
<Editor value={input} onChange={setInput} />
<button onClick={handlePrettify}>Prettify</button>
<div>{output}</div>
</div>
);
}Real Example: Adding a New Tool
Organization
Benefit
What
Where
Example
Last updated