Skip to content

Commit 52104e1

Browse files
committed
fix(deployment): fixed deployment errors
1 parent 818973f commit 52104e1

File tree

6 files changed

+148
-59
lines changed

6 files changed

+148
-59
lines changed

app/_worker.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
async fetch() {
3+
return new Response(null, {
4+
headers: {
5+
'Compatibility-Flags': 'nodejs_compat'
6+
}
7+
});
8+
}
9+
}

app/layout.tsx

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,34 @@ const montserrat = Montserrat({
2424
});
2525

2626
export const metadata: Metadata = {
27-
metadataBase: new URL('https://coc-landing.vercel.app'),
27+
metadataBase: new URL('https://communityofcoders.in'),
2828
title: {
29-
default: "Community of Coders VJTI | COC Landing",
29+
default: "Community of Coders VJTI | COC",
3030
template: "%s | Community of Coders VJTI"
3131
},
32-
description: "Access curated educational resources, join tech communities, and explore learning paths for Web Development, AI/ML, Competitive Programming at VJTI.",
33-
keywords: ["VJTI", "COC", "tech communities", "educational resources", "web development", "AI/ML", "competitive programming", "student clubs"],
34-
authors: [{ name: "Community of Coders" }],
32+
description: "Community of Coders (COC) is a student-driven community at VJTI, Mumbai, fostering coding culture through workshops, hackathons, and collaborative learning.",
33+
keywords: [
34+
"COC VJTI",
35+
"Community of Coders",
36+
"VJTI coding club",
37+
"Mumbai tech community",
38+
"student developers",
39+
"coding workshops",
40+
"hackathons",
41+
"programming community",
42+
"tech education",
43+
"web development",
44+
"AI/ML",
45+
"blockchain",
46+
"competitive programming"
47+
],
48+
authors: [{ name: "Community of Coders VJTI" }],
3549
creator: "Community of Coders VJTI",
3650
publisher: "VJTI",
3751
robots: {
3852
index: true,
3953
follow: true,
54+
nocache: true,
4055
googleBot: {
4156
index: true,
4257
follow: true,
@@ -47,17 +62,18 @@ export const metadata: Metadata = {
4762
},
4863
openGraph: {
4964
type: 'website',
50-
locale: 'en_US',
51-
url: 'https://coc-landing.vercel.app',
52-
title: 'Community of Coders VJTI',
53-
description: 'Access curated educational resources and join tech communities at VJTI.',
65+
locale: 'en_IN',
66+
url: 'https://communityofcoders.in',
67+
title: 'Community of Coders VJTI | COC',
68+
description: 'Community of Coders (COC) is a student-driven community at VJTI, Mumbai, fostering coding culture through workshops, hackathons, and collaborative learning.',
5469
siteName: 'Community of Coders VJTI',
5570
images: [
5671
{
5772
url: '/coc_vjti.jpeg',
5873
width: 1200,
5974
height: 630,
60-
alt: 'Community of Coders VJTI'
75+
alt: 'Community of Coders VJTI Logo',
76+
type: 'image/jpeg',
6177
}
6278
],
6379
countryName: 'India',
@@ -67,21 +83,23 @@ export const metadata: Metadata = {
6783
twitter: {
6884
card: 'summary_large_image',
6985
title: 'Community of Coders VJTI',
70-
description: 'Access curated educational resources and join tech communities at VJTI.',
86+
description: 'Join VJTI\'s premier coding community. Learn, build, and grow with workshops, hackathons, and collaborative projects.',
7187
creator: '@COC_VJTI',
7288
images: ['/coc_vjti.jpeg'],
89+
site: '@COC_VJTI',
7390
},
7491
alternates: {
75-
canonical: 'https://coc-landing.vercel.app',
76-
languages: {
77-
'en-US': 'https://coc-landing.vercel.app/en-US',
78-
}
92+
canonical: 'https://communityofcoders.in',
7993
},
8094
verification: {
81-
google: 'your-google-verification-code',
95+
google: 'add-your-google-site-verification-here',
8296
},
8397
category: 'technology',
84-
classification: 'Education & Technology'
98+
classification: 'Education & Technology',
99+
other: {
100+
'google-site-verification': 'add-your-google-site-verification-here',
101+
'msvalidate.01': 'add-your-bing-site-verification-here',
102+
}
85103
};
86104

87105
export default function RootLayout({

app/robots.ts

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
import { MetadataRoute } from 'next'
22

33
export default function robots(): MetadataRoute.Robots {
4+
const baseUrl = 'https://communityofcoders.in'
5+
46
return {
5-
rules: {
6-
userAgent: '*',
7-
allow: '/',
8-
disallow: ['/private/', '/api/'],
9-
},
10-
sitemap: 'https://coc-landing.vercel.app/sitemap.xml',
7+
rules: [
8+
{
9+
userAgent: '*',
10+
allow: ['/'],
11+
disallow: [
12+
'/api/*',
13+
'/auth/*',
14+
'/_next/*',
15+
'/*.json',
16+
'/*.xml',
17+
],
18+
},
19+
{
20+
userAgent: 'Googlebot',
21+
allow: ['/'],
22+
disallow: ['/api/*', '/auth/*'],
23+
},
24+
],
25+
sitemap: `${baseUrl}/sitemap.xml`,
26+
host: baseUrl,
1127
}
12-
}
28+
}

app/sitemap.ts

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,57 @@ import { MetadataRoute } from 'next'
22
import { domains } from '@/config/navigation'
33

44
export default function sitemap(): MetadataRoute.Sitemap {
5-
const baseUrl = 'https://coc-landing.vercel.app'
6-
7-
// Main routes with external resources
8-
const routes = [
9-
{
10-
route: '',
11-
externalResources: ['https://vjti.ac.in', 'https://github.com/communityofcoders']
12-
},
13-
{
14-
route: '/about',
15-
externalResources: ['https://www.linkedin.com/company/community-of-coders-vjti/posts/?feedView=all']
16-
},
17-
{
18-
route: '/teams',
19-
externalResources: ['https://github.com/communityofcoders']
20-
},
21-
{
22-
route: '/dashboard',
23-
externalResources: ['https://docs.github.com/en']
24-
},
5+
const baseUrl = 'https://communityofcoders.in'
6+
7+
// Main routes
8+
const mainRoutes = [
259
{
26-
route: '/dev-club',
27-
externalResources: ['https://developer.mozilla.org', 'https://reactjs.org']
10+
url: baseUrl,
11+
lastModified: new Date(),
12+
changeFrequency: 'daily' as const,
13+
priority: 1,
2814
},
2915
{
30-
route: '/cp-club',
31-
externalResources: ['https://codeforces.com', 'https://leetcode.com']
16+
url: `${baseUrl}/about`,
17+
lastModified: new Date(),
18+
changeFrequency: 'weekly' as const,
19+
priority: 0.8,
3220
},
3321
{
34-
route: '/ai-group',
35-
externalResources: ['https://pytorch.org', 'https://tensorflow.org']
22+
url: `${baseUrl}/teams`,
23+
lastModified: new Date(),
24+
changeFrequency: 'weekly' as const,
25+
priority: 0.8,
3626
},
3727
{
38-
route: '/eth-club',
39-
externalResources: ['https://ethereum.org', 'https://web3.foundation']
28+
url: `${baseUrl}/dashboard`,
29+
lastModified: new Date(),
30+
changeFrequency: 'daily' as const,
31+
priority: 0.9,
4032
},
41-
].map(({ route }) => ({
42-
url: `${baseUrl}${route}`,
33+
]
34+
35+
// Club routes
36+
const clubRoutes = [
37+
'ai-group',
38+
'cp-club',
39+
'dev-club',
40+
'eth-club',
41+
'proj-x',
42+
].map((club) => ({
43+
url: `${baseUrl}/${club}`,
4344
lastModified: new Date(),
4445
changeFrequency: 'weekly' as const,
45-
priority: route === '' ? 1 : 0.8,
46+
priority: 0.7,
4647
}))
4748

49+
// Resource routes from domains
4850
const resourceRoutes = domains.map((domain) => ({
4951
url: `${baseUrl}/dashboard/${domain.resources}`,
5052
lastModified: new Date(),
5153
changeFrequency: 'weekly' as const,
52-
priority: 0.7,
54+
priority: 0.6,
5355
}))
5456

55-
return [...routes, ...resourceRoutes]
56-
}
57+
return [...mainRoutes, ...clubRoutes, ...resourceRoutes]
58+
}

app/sitemap.xml/route.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { NextResponse } from 'next/server'
2+
3+
function generateSitemapXML() {
4+
const baseUrl = 'https://communityofcoders.in'
5+
const lastMod = new Date().toISOString()
6+
7+
const routes = [
8+
{ url: '', priority: 1.0, freq: 'daily' },
9+
{ url: 'about', priority: 0.8, freq: 'weekly' },
10+
{ url: 'teams', priority: 0.8, freq: 'weekly' },
11+
{ url: 'dashboard', priority: 0.9, freq: 'daily' },
12+
{ url: 'ai-group', priority: 0.7, freq: 'weekly' },
13+
{ url: 'cp-club', priority: 0.7, freq: 'weekly' },
14+
{ url: 'dev-club', priority: 0.7, freq: 'weekly' },
15+
{ url: 'eth-club', priority: 0.7, freq: 'weekly' },
16+
{ url: 'proj-x', priority: 0.7, freq: 'weekly' },
17+
]
18+
19+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
20+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
21+
${routes.map(route => `
22+
<url>
23+
<loc>${baseUrl}${route.url ? `/${route.url}` : ''}</loc>
24+
<lastmod>${lastMod}</lastmod>
25+
<changefreq>${route.freq}</changefreq>
26+
<priority>${route.priority}</priority>
27+
</url>`).join('')}
28+
</urlset>`
29+
30+
return xml.trim()
31+
}
32+
33+
export async function GET() {
34+
const xml = generateSitemapXML()
35+
36+
return new NextResponse(xml, {
37+
headers: {
38+
'Content-Type': 'application/xml',
39+
'Cache-Control': 'public, max-age=3600',
40+
},
41+
})
42+
}

wrangler.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
NODE_VERSION = "18.18.0"
1+
NODE_VERSION = "18.18.0"
2+
compatibility_flags = ["nodejs_compat"]
3+
compatibility_date = "2024-01-05"

0 commit comments

Comments
 (0)