Getting Started
-
- ReadmeGenAI is designed to be plug-and-play. Our goal is to remove the friction
- of writing documentation so you can focus on writing code.
+
+
+ Everything you need to know about ReadmeGenAI. From quick start guides to
+ advanced configuration, we've got you covered.
- Enter your public GitHub repository URL into the generator. Ensure the repo
- contains at least a main entry point (like `index.js` or `main.py`).
-
- Our engine uses Octokit to build a virtual file tree. This tree is passed to
- Gemini 2.5 Flash with a specific context window optimized for software architecture.
-
+ Documentation
+
+
+ at your fingertips.
+
+
- 1. Provide your URL
-
-
- npx readmegenai@latest --repo [your-url]
-
- 2. AI Analysis
-
- Explore how ReadmeGenAI adapts to different tech stacks and project scales to create documentation that converts visitors into users. + Explore how ReadmeGenAI adapts to different tech stacks and project + scales.
@@ -87,35 +148,88 @@ export default function ExamplesPage() {
- {example.tags.map(tag => (
-
+ {example.tags.map((tag) => (
+
{tag}
))}
-
-
+ {previewContent}
+
+ Ready to document your project?
- -+ Ready to document your project? +
+
Documentation
-
+
reimagined.
diff --git a/src/app/generate/page.tsx b/src/app/generate/page.tsx
index a8347bf..74462e3 100644
--- a/src/app/generate/page.tsx
+++ b/src/app/generate/page.tsx
@@ -4,6 +4,7 @@ import { Navbar } from '@/components/layout/Navbar';
import { Footer } from '@/components/layout/Footer';
import { SearchInput } from '@/components/Generator/SearchInput';
import { MarkdownPreview } from '@/components/Generator/MarkdownPreview';
+import { navLinks } from '@/constants/navLinks';
export default function GeneratePage() {
const [markdown, setMarkdown] = useState('');
@@ -11,7 +12,7 @@ export default function GeneratePage() {
const handleGenerate = async (githubUrl: string) => {
setIsLoading(true);
- setMarkdown(''); // Clear previous results
+ setMarkdown('');
try {
const response = await fetch('/api/generate', {
method: 'POST',
@@ -19,51 +20,43 @@ export default function GeneratePage() {
body: JSON.stringify({ url: githubUrl }),
});
- const data = await response.json();
- if (data.markdown) {
- setMarkdown(data.markdown);
- } else {
- alert(data.error || "Something went wrong");
+ // Updated Error Handling logic
+ if (!response.ok) {
+ // First, get the raw text to avoid JSON parsing errors on HTML responses
+ const errorText = await response.text();
+ let errorMessage: string;
+
+ try {
+ // Attempt to parse the text as JSON
+ const errorData = JSON.parse(errorText);
+ errorMessage = errorData.error || errorData.message || errorText;
+ } catch {
+ // Fallback to raw text if JSON.parse fails (e.g., 502 Bad Gateway HTML)
+ errorMessage = errorText || response.statusText;
+ }
+
+ // Throw an error that includes the HTTP status for better debugging
+ throw new Error(`[${response.status} ${response.statusText}]: ${errorMessage}`);
}
- } catch (error) {
- console.error("Generation failed:", error);
- alert("Failed to connect to the server.");
+
+ const data = await response.json();
+ setMarkdown(data.markdown);
+ } catch (error: unknown) {
+ console.error("Generation Error:", error);
+ alert(error instanceof Error ? error.message : "Something went wrong");
} finally {
setIsLoading(false);
}
};
- const navLinks = [
- { name: 'Home', href: '/' },
- { name: 'Features', href: '/features' },
- { name: 'Examples', href: '/examples' },
- { name: 'Docs', href: '/docs' },
- ];
-
return (
Generate Documentation
-Enter your repository URL and let the AI do the heavy lifting.
-Waiting for repository URL...
-, title: "Context Awareness", desc: "Detects frameworks and dependencies automatically." },
- { icon: ,
+ title: "Context Awareness",
+ desc: "Detects frameworks and dependencies automatically using advanced AST parsing."
+ },
+ {
+ icon:
- {content}
-
+