Add sitemap and robots.txt, update home page stats to static values, and fix prayer language detection
- Create sitemap.xml with internationalized routes and proper SEO attributes - Create robots.txt with appropriate crawling rules for public/private content - Update home page stats to show static values (1,416 Bible versions, 17M+ verses) - Remove live stats API calls to eliminate loading delays - Add /api/stats endpoint for potential future use - Fix Romanian prayers incorrectly tagged as English in database - Add missing AZURE_OPENAI_DEPLOYMENT to .env.example - Update translation keys for Bible versions stat - Add sample English prayer requests to populate prayer wall 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
39
app/api/stats/route.ts
Normal file
39
app/api/stats/route.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { prisma } from '@/lib/db';
|
||||
|
||||
export const runtime = 'nodejs';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
// Get bible statistics
|
||||
const [
|
||||
totalBibleVersions,
|
||||
totalVerses,
|
||||
totalBooks
|
||||
] = await Promise.all([
|
||||
// Count total Bible versions
|
||||
prisma.bibleVersion.count(),
|
||||
|
||||
// Count total verses across all versions
|
||||
prisma.bibleVerse.count(),
|
||||
|
||||
// Count unique books (66 biblical books)
|
||||
prisma.bibleBook.groupBy({
|
||||
by: ['bookKey'],
|
||||
}).then(result => result.length)
|
||||
]);
|
||||
|
||||
return NextResponse.json({
|
||||
bibleVersions: totalBibleVersions,
|
||||
verses: totalVerses,
|
||||
books: totalBooks
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.error('Stats API error:', error);
|
||||
return NextResponse.json(
|
||||
{ error: 'Failed to fetch statistics' },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user