Skip to content

Commit 39c6085

Browse files
committed
Merge branch 'prod' into refactor
2 parents a61bbe9 + 29d5f98 commit 39c6085

13 files changed

Lines changed: 13608 additions & 4713 deletions

.env.example

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,21 @@
99
# When adding additional environment variables, the schema in "/src/env.js"
1010
# should be updated accordingly.
1111

12-
EMAIL_HOST=""
13-
EMAIL_PASSWORD=""
14-
EMAIL_PORT=""
15-
EMAIL_SECURE=""
16-
EMAIL_USER=""
17-
JWT_SECRET=""
18-
MONGODB_URI=""
19-
NEXT_PUBLIC_CRYPTO_SECRET=""
20-
KV_URL=""
21-
KV_REST_API_URL=""
22-
KV_REST_API_TOKEN=""
23-
KV_REST_API_READ_ONLY_TOKEN=""
24-
SERVER_URL=""
12+
MONGODB_URI="" # Can be found in MongoDB Atlas dashboard or Compass (https://www.mongodb.com/docs/guides/atlas/cluster/)
13+
SERVER_URL="". # e.g. "http://localhost:3000" or "https://mydomain.com" (domain of the url you use to access the server)
14+
2515
# Google Sheets Integration
26-
GOOGLE_CLIENT_EMAIL=""
27-
GOOGLE_PRIVATE_KEY=""
28-
SHEET_ID=""
16+
GOOGLE_CLIENT_EMAIL="" # Create google client account at https://console.cloud.google.com/iam-admin/serviceaccounts
17+
GOOGLE_PRIVATE_KEY="" # In the client account, create and download a new private key
18+
SHEET_ID="". # Google sheets ID, can be found in the url of the sheet
2919

20+
# Google Cloud Storage # https://console.cloud.google.com/storage/browser
21+
GOOGLE_CLOUD_PROJECT="" # Your Google Cloud Project ID
22+
GOOGLE_CLOUD_BUCKET="" # Your Google Cloud Storage Bucket name
23+
GOOGLE_APPLICATION_CREDENTIALS_JSON="" # The content of the JSON file you download when creating a service account key
3024

31-
# Google Cloud Storage
32-
GOOGLE_CLOUD_PROJECT=""
33-
GOOGLE_CLOUD_BUCKET=""
34-
GOOGLE_APPLICATION_CREDENTIALS_JSON=""
25+
# Vercel KV
26+
KV_URL="" # The URL of your Vercel KV instance
27+
KV_REST_API_URL="" # The REST API URL of your Vercel KV instance
28+
KV_REST_API_TOKEN="" # The REST API token for your Vercel KV instance
29+
KV_REST_API_READ_ONLY_TOKEN="" # The read-only REST API token for your Vercel KV instance

.npmrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
public-hoist-pattern[]=pdfjs-dist
1+
public-hoist-pattern[]=pdfjs-dist
2+
auto-install-peers=true
3+
shamefully-hoist=true

amplify.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: 1
2+
frontend:
3+
phases:
4+
preBuild:
5+
commands:
6+
- corepack enable
7+
- pnpm install --frozen-lockfile
8+
build:
9+
commands:
10+
- pnpm run build
11+
- 'echo "GEMINI_APLKEY=$GEMINI_APLKEY" >>.env.production'
12+
- 'echo "GOOGLE_CLIENT_EMAIL=$GOOGLE_CLIENT_EMAIL" >>.env.production'
13+
- 'echo "GOOGLE_PRIVATE_KEY=$GOOGLE_PRIVATE_KEY" >>.env.production'
14+
- 'echo "KV_REST_APL_READ_ONLY_TOKEN=$KV_REST_APL_READ_ONLY_TOKEN" >>.env.production'
15+
- 'echo "KV_REST_APL_TOKEN=$KV_REST_APL_TOKEN" >>.env.production'
16+
- 'echo "KV_REST_APLURL=$KV_REST_APLURL" >>.env.production'
17+
- 'echo "KV_URL=$KV_URL" >>.env.production'
18+
- 'echo "MONGODB_URI=$MONGODB_URI" >>.env.production'
19+
- 'echo "SERVER_URL=$SERVER_URL" >>.env.production'
20+
- 'echo "SHEET_ID=$SHEET_ID" >>.env.production'
21+
- 'echo "GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT" >>.env.production'
22+
- 'echo "GOOGLE_CLOUD_BUCKET=$GOOGLE_CLOUD_BUCKET" >>.env.production'
23+
- 'echo "GOOGLE_APPLICATION_CREDENTIALS_JSON=$GOOGLE_APPLICATION_CREDENTIALS_JSON" >>.env.production'
24+
25+
artifacts:
26+
baseDirectory: .next
27+
files:
28+
- "**/*"
29+
cache:
30+
paths:
31+
- .next/cache/**/*
32+
- node_modules/**/*
33+
- .pnpm-store/**/*

next.config.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,73 @@ const config = {
1010
images: {
1111
domains: ["storage.googleapis.com"],
1212
},
13+
async headers() {
14+
return [
15+
{
16+
source: "/api/upcoming-papers",
17+
headers: [
18+
{
19+
key: "Cache-Control",
20+
value: "public, s-maxage=60, stale-while-revalidate=120",
21+
},
22+
],
23+
},
24+
{
25+
source: "/api/papers",
26+
headers: [
27+
{
28+
key: "Cache-Control",
29+
value: "public, s-maxage=60, stale-while-revalidate=120",
30+
},
31+
],
32+
},
33+
{
34+
source: "/api/selected-papers",
35+
headers: [
36+
{
37+
key: "Cache-Control",
38+
value: "public, s-maxage=60, stale-while-revalidate=120",
39+
},
40+
],
41+
},
42+
{
43+
source: "/api/related-subject",
44+
headers: [
45+
{
46+
key: "Cache-Control",
47+
value: "public, s-maxage=60, stale-while-revalidate=120",
48+
},
49+
],
50+
},
51+
{
52+
source: "/api/course-list",
53+
headers: [
54+
{
55+
key: "Cache-Control",
56+
value: "public, s-maxage=60, stale-while-revalidate=120",
57+
},
58+
],
59+
},
60+
{
61+
source: "/_next/static/:path*",
62+
headers: [
63+
{
64+
key: "Cache-Control",
65+
value: "public, max-age=31536000, immutable",
66+
},
67+
],
68+
},
69+
{
70+
source: "/:path*\\.(css|js|png|jpg|jpeg|gif|webp|svg|ico|woff|woff2)",
71+
headers: [
72+
{
73+
key: "Cache-Control",
74+
value: "public, max-age=604800, stale-while-revalidate=86400",
75+
},
76+
],
77+
},
78+
];
79+
},
1380
webpack: (config, options) => {
1481
config.resolve.alias.canvas = false;
1582
config.module.rules.push({

0 commit comments

Comments
 (0)