Skip to content

Commit 20c1ee3

Browse files
Merge pull request #56 from CodeChefVIT/staging
Staging
2 parents 6e2c71b + 38d9e90 commit 20c1ee3

17 files changed

+299
-205
lines changed

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,25 @@
2828

2929
## 🏁 Get Started
3030

31-
To get started, fork your own copy and clone the master branch. To clone a branch you can run the following:
31+
The repository has two branches, 'prod' and 'staging'.
32+
33+
prod (Production Branch) represents the live, user-facing version of the project where bug-free, well-tested code resides.
34+
35+
staging (Staging Branch) serves as a pre-production environment, where features and fixes are tested before they go live.
36+
37+
To get started, fork your own copy and clone your chosen branch. To clone a branch you can run the following:
38+
39+
Clone the 'prod' branch (production)
3240

3341
```bash
34-
git clone -b master https://github.com/<Your username>/papers-codechef.git
42+
git clone -b prod https://github.com/<Your username>/papers-codechef.git
43+
```
44+
OR
45+
46+
Clone the 'staging' branch (staging)
47+
48+
```bash
49+
git clone -b staging https://github.com/<Your username>/papers-codechef.git
3550
```
3651

3752
Run these commands on your bash/terminal and open it in a code editor of your choice.
@@ -47,7 +62,8 @@ To start your development server run:
4762
```bash
4863
pnpm dev
4964
```
50-
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.
65+
66+
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.
5167

5268
## License
5369

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@react-pdf-viewer/core": "3.12.0",
2222
"@react-pdf-viewer/default-layout": "^3.12.0",
2323
"@react-pdf-viewer/full-screen": "^3.12.0",
24+
"@react-pdf-viewer/get-file": "^3.12.0",
2425
"@react-pdf-viewer/zoom": "^3.12.0",
2526
"@t3-oss/env-nextjs": "^0.10.1",
2627
"@types/mongoose": "^5.11.97",

pnpm-lock.yaml

Lines changed: 12 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/actions/get-papers-by-id.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// "use server";
2+
import { ErrorResponse, PaperResponse } from "@/interface";
3+
import axios, { AxiosResponse } from "axios";
4+
5+
export const fetchPaperID = async (
6+
id: string,
7+
) => {
8+
try {
9+
const response: AxiosResponse<PaperResponse> = await axios.get(
10+
`http://localhost:3000/api/paper-by-id/${id}`,
11+
);
12+
return response.data;
13+
} catch (err: unknown) {
14+
throw err;
15+
16+
}
17+
};

src/app/api/upload/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77

88
CloudinaryUploadResult,
99
} from "@/interface";
10-
import Paper from "@/db/papers";
10+
import {PaperAdmin} from "@/db/papers";
1111
// TODO: REMOVE THUMBNAIL FROM admin-buffer DB
1212
cloudinary.v2.config({
1313
cloud_name: process.env.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME,
@@ -65,7 +65,7 @@ export async function POST(req: Request) {
6565
.replace("pdf", "jpg")
6666
.replace("upload", "upload/w_400,h_400,c_fill")
6767
.replace(/<img src='|'\s*\/>/g, "");
68-
const paper = new Paper({
68+
const paper = new PaperAdmin({
6969

7070
public_id_cloudinary,
7171
finalUrl,

src/app/page.tsx

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,46 @@ const HomePage = () => {
1010
<div>
1111
<Navbar />
1212
</div>
13-
<div className="mt-2 flex flex-grow flex-col items-center justify-center gap-y-6">
14-
<div className="w-full max-w-2xl space-y-6 text-center">
15-
<h1 className="phonk text-2xl font-bold tracking-wider md:text-3xl">
16-
Built by students for students
13+
<div className="mt-2 flex flex-grow flex-col items-center justify-center gap-y-10">
14+
15+
<div className="w-full max-w-2xl space-y-10 text-center">
16+
17+
<h1 className="phonk text-2xl md:text-3xl mx-auto">
18+
Built by Students for Students
1719
</h1>
18-
<p className="text-base font-semibold">
20+
21+
<p className="text-md font-semibold font-sans w-[90%] mx-auto md:w-full">
1922
Prepare to excel in your CATs and FATs with CodeChef-VIT&apos;s dedicated
2023
repository of past exam papers. Access key resources to review
2124
concepts, tackle challenging questions, and familiarize yourself
2225
with exam patterns. Boost your confidence, sharpen your strategy,
2326
and get ready to ace your exams!
2427
</p>
25-
<div className="flex flex-wrap justify-center gap-4">
26-
<Button
27-
variant="outline"
28-
className="rounded-full px-6 py-6 text-xs font-semibold"
29-
>
30-
NO SIGN UP REQUIRED
31-
</Button>
32-
<Button
33-
variant="outline"
34-
className="rounded-full px-6 py-6 text-xs font-semibold"
35-
>
36-
FILTERED SEARCH
37-
</Button>
38-
<Button
39-
variant="outline"
40-
className="rounded-full px-6 py-6 text-xs font-semibold"
41-
>
42-
FLEXIBLE DOWNLOAD
43-
</Button>
28+
29+
<div className="flex flex-wrap justify-center gap-4 text-sm font-bold">
30+
{["NO SIGN UP REQUIRED", "FILTERED SEARCH", "FLEXIBLE DOWNLOAD"].map((text) => (
31+
<div key={text} className="p-[2px] bg-gradient-to-r from-[#562EE7] to-[#bd21b4] rounded-full">
32+
<div className="rounded-full bg-white dark:bg-black px-6 py-3 tracking-wider text-black dark:text-white font-sans">
33+
{text}
34+
</div>
35+
</div>
36+
))}
4437
</div>
38+
4539
</div>
40+
4641
<div className="z-20 w-full max-w-xl">
4742
<SearchBar />
4843
</div>
44+
4945
<div className="max-3xl w-full">
5046
<StoredPapers />
5147
</div>
48+
5249
</div>
50+
5351
<Footer />
52+
5453
</div>
5554
);
5655
};

0 commit comments

Comments
 (0)