diff --git a/app/_worker.js b/app/_worker.js new file mode 100644 index 0000000..84cf1e0 --- /dev/null +++ b/app/_worker.js @@ -0,0 +1,9 @@ +export default { + async fetch() { + return new Response(null, { + headers: { + 'Compatibility-Flags': 'nodejs_compat' + } + }); + } +} diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index ecee680..770b631 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -37,4 +37,4 @@ export async function GET(request: NextRequest) { export async function POST(request: NextRequest) { return await Auth(request, config); -} \ No newline at end of file +} \ No newline at end of file diff --git a/app/layout.tsx b/app/layout.tsx index 5205d41..85b8f9c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -24,19 +24,34 @@ const montserrat = Montserrat({ }); export const metadata: Metadata = { - metadataBase: new URL('https://coc-landing.vercel.app'), + metadataBase: new URL('https://communityofcoders.in'), title: { - default: "Community of Coders VJTI | COC Landing", + default: "Community of Coders VJTI | COC", template: "%s | Community of Coders VJTI" }, - description: "Access curated educational resources, join tech communities, and explore learning paths for Web Development, AI/ML, Competitive Programming at VJTI.", - keywords: ["VJTI", "COC", "tech communities", "educational resources", "web development", "AI/ML", "competitive programming", "student clubs"], - authors: [{ name: "Community of Coders" }], + description: "Community of Coders (COC) is a student-driven community at VJTI, Mumbai, fostering coding culture through workshops, hackathons, and collaborative learning.", + keywords: [ + "COC VJTI", + "Community of Coders", + "VJTI coding club", + "Mumbai tech community", + "student developers", + "coding workshops", + "hackathons", + "programming community", + "tech education", + "web development", + "AI/ML", + "blockchain", + "competitive programming" + ], + authors: [{ name: "Community of Coders VJTI" }], creator: "Community of Coders VJTI", publisher: "VJTI", robots: { index: true, follow: true, + nocache: true, googleBot: { index: true, follow: true, @@ -47,17 +62,18 @@ export const metadata: Metadata = { }, openGraph: { type: 'website', - locale: 'en_US', - url: 'https://coc-landing.vercel.app', - title: 'Community of Coders VJTI', - description: 'Access curated educational resources and join tech communities at VJTI.', + locale: 'en_IN', + url: 'https://communityofcoders.in', + title: 'Community of Coders VJTI | COC', + description: 'Community of Coders (COC) is a student-driven community at VJTI, Mumbai, fostering coding culture through workshops, hackathons, and collaborative learning.', siteName: 'Community of Coders VJTI', images: [ { url: '/coc_vjti.jpeg', width: 1200, height: 630, - alt: 'Community of Coders VJTI' + alt: 'Community of Coders VJTI Logo', + type: 'image/jpeg', } ], countryName: 'India', @@ -67,21 +83,23 @@ export const metadata: Metadata = { twitter: { card: 'summary_large_image', title: 'Community of Coders VJTI', - description: 'Access curated educational resources and join tech communities at VJTI.', + description: 'Join VJTI\'s premier coding community. Learn, build, and grow with workshops, hackathons, and collaborative projects.', creator: '@COC_VJTI', images: ['/coc_vjti.jpeg'], + site: '@COC_VJTI', }, alternates: { - canonical: 'https://coc-landing.vercel.app', - languages: { - 'en-US': 'https://coc-landing.vercel.app/en-US', - } + canonical: 'https://communityofcoders.in', }, verification: { - google: 'your-google-verification-code', + google: 'google4bec5d0570054012.html', }, category: 'technology', - classification: 'Education & Technology' + classification: 'Education & Technology', + other: { + 'google-site-verification': 'google4bec5d0570054012.html', + 'msvalidate.01': 'add-your-bing-site-verification-here', + } }; export default function RootLayout({ diff --git a/app/robots.ts b/app/robots.ts index e74fe21..8f7704f 100644 --- a/app/robots.ts +++ b/app/robots.ts @@ -1,12 +1,28 @@ import { MetadataRoute } from 'next' export default function robots(): MetadataRoute.Robots { + const baseUrl = 'https://communityofcoders.in' + return { - rules: { - userAgent: '*', - allow: '/', - disallow: ['/private/', '/api/'], - }, - sitemap: 'https://coc-landing.vercel.app/sitemap.xml', + rules: [ + { + userAgent: '*', + allow: ['/'], + disallow: [ + '/api/*', + '/auth/*', + '/_next/*', + '/*.json', + '/*.xml', + ], + }, + { + userAgent: 'Googlebot', + allow: ['/'], + disallow: ['/api/*', '/auth/*'], + }, + ], + sitemap: `${baseUrl}/sitemap.xml`, + host: baseUrl, } -} \ No newline at end of file +} \ No newline at end of file diff --git a/app/schema.tsx b/app/schema.tsx index bceec0c..eeffe93 100644 --- a/app/schema.tsx +++ b/app/schema.tsx @@ -2,10 +2,10 @@ export const websiteSchema = { "@context": "https://schema.org", "@type": "WebSite", "name": "Community of Coders VJTI", - "url": "https://coc-landing.vercel.app", + "url": "https://communityofcoders.in", "potentialAction": { "@type": "SearchAction", - "target": "https://coc-landing.vercel.app/search?q={search_term_string}", + "target": "https://communityofcoders.in/search?q={search_term_string}", "query-input": "required name=search_term_string" } }; @@ -14,8 +14,8 @@ export const organizationSchema = { "@context": "https://schema.org", "@type": "Organization", "name": "Community of Coders VJTI", - "url": "https://coc-landing.vercel.app", - "logo": "https://coc-landing.vercel.app/logo.png", + "url": "https://communityofcoders.in", + "logo": "https://communityofcoders.in/logo.png", "sameAs": [ "https://www.linkedin.com/company/community-of-coders-vjti", "https://github.com/Community-Of-Coders" diff --git a/app/sitemap.ts b/app/sitemap.ts index a9469b8..351cc59 100644 --- a/app/sitemap.ts +++ b/app/sitemap.ts @@ -2,55 +2,57 @@ import { MetadataRoute } from 'next' import { domains } from '@/config/navigation' export default function sitemap(): MetadataRoute.Sitemap { - const baseUrl = 'https://coc-landing.vercel.app' - - // Main routes with external resources - const routes = [ - { - route: '', - externalResources: ['https://vjti.ac.in', 'https://github.com/communityofcoders'] - }, - { - route: '/about', - externalResources: ['https://www.linkedin.com/company/community-of-coders-vjti/posts/?feedView=all'] - }, - { - route: '/teams', - externalResources: ['https://github.com/communityofcoders'] - }, - { - route: '/dashboard', - externalResources: ['https://docs.github.com/en'] - }, + const baseUrl = 'https://communityofcoders.in' + + // Main routes + const mainRoutes = [ { - route: '/dev-club', - externalResources: ['https://developer.mozilla.org', 'https://reactjs.org'] + url: baseUrl, + lastModified: new Date(), + changeFrequency: 'daily' as const, + priority: 1, }, { - route: '/cp-club', - externalResources: ['https://codeforces.com', 'https://leetcode.com'] + url: `${baseUrl}/about`, + lastModified: new Date(), + changeFrequency: 'weekly' as const, + priority: 0.8, }, { - route: '/ai-group', - externalResources: ['https://pytorch.org', 'https://tensorflow.org'] + url: `${baseUrl}/teams`, + lastModified: new Date(), + changeFrequency: 'weekly' as const, + priority: 0.8, }, { - route: '/eth-club', - externalResources: ['https://ethereum.org', 'https://web3.foundation'] + url: `${baseUrl}/dashboard`, + lastModified: new Date(), + changeFrequency: 'daily' as const, + priority: 0.9, }, - ].map(({ route }) => ({ - url: `${baseUrl}${route}`, + ] + + // Club routes + const clubRoutes = [ + 'ai-group', + 'cp-club', + 'dev-club', + 'eth-club', + 'proj-x', + ].map((club) => ({ + url: `${baseUrl}/${club}`, lastModified: new Date(), changeFrequency: 'weekly' as const, - priority: route === '' ? 1 : 0.8, + priority: 0.7, })) + // Resource routes from domains const resourceRoutes = domains.map((domain) => ({ url: `${baseUrl}/dashboard/${domain.resources}`, lastModified: new Date(), changeFrequency: 'weekly' as const, - priority: 0.7, + priority: 0.6, })) - return [...routes, ...resourceRoutes] -} \ No newline at end of file + return [...mainRoutes, ...clubRoutes, ...resourceRoutes] +} \ No newline at end of file diff --git a/app/sitemap.xml/route.ts b/app/sitemap.xml/route.ts new file mode 100644 index 0000000..73e588e --- /dev/null +++ b/app/sitemap.xml/route.ts @@ -0,0 +1,42 @@ +import { NextResponse } from 'next/server' + +function generateSitemapXML() { + const baseUrl = 'https://communityofcoders.in' + const lastMod = new Date().toISOString() + + const routes = [ + { url: '', priority: 1.0, freq: 'daily' }, + { url: 'about', priority: 0.8, freq: 'weekly' }, + { url: 'teams', priority: 0.8, freq: 'weekly' }, + { url: 'dashboard', priority: 0.9, freq: 'daily' }, + { url: 'ai-group', priority: 0.7, freq: 'weekly' }, + { url: 'cp-club', priority: 0.7, freq: 'weekly' }, + { url: 'dev-club', priority: 0.7, freq: 'weekly' }, + { url: 'eth-club', priority: 0.7, freq: 'weekly' }, + { url: 'proj-x', priority: 0.7, freq: 'weekly' }, + ] + + const xml = ` + + ${routes.map(route => ` + + ${baseUrl}${route.url ? `/${route.url}` : ''} + ${lastMod} + ${route.freq} + ${route.priority} + `).join('')} +` + + return xml.trim() +} + +export async function GET() { + const xml = generateSitemapXML() + + return new NextResponse(xml, { + headers: { + 'Content-Type': 'application/xml', + 'Cache-Control': 'public, max-age=3600', + }, + }) +} diff --git a/wrangler.toml b/wrangler.toml index 40697a8..4877752 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -1 +1,3 @@ -NODE_VERSION = "18.18.0" \ No newline at end of file +NODE_VERSION = "18.18.0" +compatibility_flags = ["nodejs_compat"] +compatibility_date = "2024-01-05" \ No newline at end of file