Skip to content

Commit 97b4770

Browse files
Merge branch 'CodeChefVIT:staging' into staging
2 parents d1729b9 + e72f019 commit 97b4770

File tree

128 files changed

+6136
-3840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+6136
-3840
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
npm-debug.log
3+
.DS_Store
4+
.git
5+
.gitignore
6+
.env

.env.example

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ NEXT_PUBLIC_CRYPTO_SECRET=""
2424
KV_URL=""
2525
KV_REST_API_URL=""
2626
KV_REST_API_TOKEN=""
27-
KV_REST_API_READ_ONLY_TOKEN=""
27+
KV_REST_API_READ_ONLY_TOKEN=""
28+
SERVER_URL=""
29+
# Google Sheets Integration
30+
GOOGLE_CLIENT_EMAIL=""
31+
GOOGLE_PRIVATE_KEY=""
32+
SHEET_ID=""

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ yarn-error.log*
3434
# local env files
3535
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
3636
.env
37+
.env.lcal
3738
.env*.local
38-
39+
.env.prod
3940
# vercel
4041
.vercel
41-
42+
.env.staging
4243
# typescript
4344
*.tsbuildinfo
45+
46+
# vscode
47+
./vscode

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public-hoist-pattern[]=pdfjs-dist

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

Dockerfile

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,58 @@
1-
# Step 1: Specify the base image
2-
FROM node:22
1+
# Step 1: Build stage
2+
FROM node:23-alpine AS builder
33

4-
# Step 2: Set the working directory inside the container
4+
# Install dependencies required for building native modules
5+
RUN apk add --no-cache \
6+
python3 \
7+
make \
8+
g++ \
9+
pkgconfig \
10+
pixman-dev \
11+
cairo-dev \
12+
pango-dev \
13+
glib-dev \
14+
jpeg-dev \
15+
giflib-dev
16+
17+
# Install pnpm globally
18+
RUN npm install -g pnpm
19+
20+
# Set the working directory
521
WORKDIR /app
622

7-
# Step 3: Copy package.json and package-lock.json files
8-
COPY package*.json ./
23+
# Copy package.json and pnpm-lock.yaml
24+
COPY package.json pnpm-lock.yaml ./
925

10-
# Step 4: Install dependencies
11-
RUN npm install
26+
# Install dependencies using pnpm
27+
RUN pnpm install --frozen-lockfile
1228

13-
# Step 5: Copy the rest of the application code
29+
# Copy the rest of the application code
1430
COPY . .
1531

16-
# Step 6: Expose the port the application runs on
32+
# Build the application
33+
RUN pnpm run build
34+
35+
# Step 2: Production stage
36+
FROM node:23-alpine
37+
38+
# Install pnpm globally
39+
RUN npm install -g pnpm
40+
41+
# Set the working directory
42+
WORKDIR /app
43+
44+
# Set NODE_ENV to production
45+
ENV NODE_ENV=production
46+
47+
# Copy only the built application and necessary files from the builder stage
48+
COPY --from=builder /app/package.json ./
49+
COPY --from=builder /app/pnpm-lock.yaml ./
50+
COPY --from=builder /app/node_modules ./node_modules
51+
COPY --from=builder /app/.next ./.next
52+
COPY --from=builder /app/public ./public
53+
54+
# Expose the port the application runs on
1755
EXPOSE 3000
1856

19-
# Step 7: Define the command to run the application
20-
CMD ["npm","run","dev"]
57+
# Define the command to start the application
58+
CMD ["pnpm", "start"]

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
> <p>Prepare to excel in your CATs and FATs with CodeChef-VIT's dedicated repository of past exam papers. Access key resources to review concepts, tackle challenging questions, and familiarize yourself with exam patterns. Boost your confidence, sharpen your strategy, and get ready to ace your exams!</p>
88
99
## 🌐 Deploy
10-
[https://papers.codechefvit.com/](https://papers.codechefvit.com/)
10+
11+
[https://papers.codechefvit.com](https://papers.codechefvit.com/)
1112

1213
## ⚙️ Tech Stack:
1314

@@ -62,6 +63,28 @@ To start your development server run:
6263
pnpm dev
6364
```
6465

66+
## 🐳 Using Docker
67+
68+
To run the application using Docker, follow these steps:
69+
70+
1. **Build the Docker Image**:
71+
72+
```bash
73+
docker build -t papers-codechef .
74+
```
75+
76+
2. **Run the Docker Container**:
77+
78+
```bash
79+
docker run -p 3000:3000 --env-file .env papers-codechef
80+
```
81+
82+
3. **Using Docker Compose**:
83+
If you prefer `docker-compose`, ensure the `docker-compose.yml` file is configured, then run:
84+
```bash
85+
docker-compose up
86+
```
87+
6588
Before getting started, please ensure that the .env file is properly configured. The .env.example file has been provided for your reference, with examples of environment variables to be listed.
6689

6790
## License

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
services:
2+
app:
3+
build: .
4+
ports:
5+
- "3000:3000"
6+
env_file:
7+
- .env.local

next.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ await import("./src/env.js");
66

77
/** @type {import("next").NextConfig} */
88
const config = {
9+
swcMinify: false,
10+
911
images: {
1012
domains: ["res.cloudinary.com"],
1113
},
12-
webpack: (
13-
config, options
14-
) => {
14+
webpack: (config, options) => {
15+
config.resolve.alias.canvas = false;
1516
config.module.rules.push({
1617
test: /\.node/,
17-
use: 'raw-loader',
18+
use: "raw-loader",
1819
});
1920
return config;
2021
},

ongoing-papers.ts

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,38 @@
1-
import { type IPaper } from "@/interface";
1+
import { type IUpcomingPaper } from "@/interface";
22

3-
const papers: IPaper[] = [
3+
const papers: IUpcomingPaper[] = [
44
{
55
_id: "6708fd8002a75017a4f08759",
6-
finalUrl:
7-
"https://res.cloudinary.com/dtorpaj1c/image/upload/v1728642405/papers/orbppimhujcijj2ywhvm.pdf",
8-
thumbnailUrl:
9-
"https://res.cloudinary.com/dtorpaj1c/image/upload/w_400,h_400,c_fill/v1728642405/papers/orbppimhujcijj2ywhvm.jpg",
106
subject: "Discrete Mathematics and Graph Theory [BMAT205L]",
11-
slot: "A2",
12-
year: "2023",
13-
exam: "CAT-2",
14-
semester: "Fall Semester",
15-
campus: "Vellore",
7+
slots: ["A2", "B2"],
168
},
179
{
1810
_id: "670980523ec3fdad83b2d211",
19-
finalUrl:
20-
"https://res.cloudinary.com/dtorpaj1c/image/upload/v1728675912/papers/lvtypsfdtref5mjskley.pdf",
21-
thumbnailUrl:
22-
"https://res.cloudinary.com/dtorpaj1c/image/upload/w_400,h_400,c_fill/v1728675912/papers/lvtypsfdtref5mjskley.jpg",
2311
subject: "Compiler Design [BCSE307L]",
24-
slot: "A2",
25-
year: "2024",
26-
exam: "CAT-2",
27-
semester: "Fall Semester",
28-
campus: "Vellore",
12+
slots: ["C1", "D1"],
2913
},
3014
{
3115
_id: "670a105e6272bcf9da4e2362",
3216

33-
finalUrl:
17+
final_url:
3418
"https://res.cloudinary.com/dtorpaj1c/image/upload/v1728712773/papers/ifkrnjgwdudtev9rxpki.pdf",
35-
thumbnailUrl:
19+
thumbnail_url:
3620
"https://res.cloudinary.com/dtorpaj1c/image/upload/w_400,h_400,c_fill/v1728712773/papers/ifkrnjgwdudtev9rxpki.jpg",
3721
subject: "Complex Variables and Linear Algebra [BMAT201L]",
38-
slot: "A1",
22+
slots: ["A1", "B1"],
3923
year: "2023",
4024
exam: "CAT-2",
4125
semester: "Fall Semester",
4226
campus: "Vellore",
4327
},
4428
{
4529
_id: "67097e7b3ec3fdad83b2d205",
46-
finalUrl:
30+
final_url:
4731
"https://res.cloudinary.com/dtorpaj1c/image/upload/v1728675439/papers/pyyqotz1mzuh2wmq1k9s.pdf",
48-
thumbnailUrl:
32+
thumbnail_url:
4933
"https://res.cloudinary.com/dtorpaj1c/image/upload/w_400,h_400,c_fill/v1728675439/papers/pyyqotz1mzuh2wmq1k9s.jpg",
5034
subject: "Computer Networks [BCSE308L]",
51-
slot: "C2",
35+
slots: ["C2", "D2"],
5236
year: "2023",
5337
exam: "CAT-2",
5438
semester: "Fall Semester",

0 commit comments

Comments
 (0)