Skip to content

Commit

Permalink
Merge pull request #56 from CodeChefVIT/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
NishantGupt786 authored Nov 13, 2024
2 parents 6e2c71b + 38d9e90 commit 20c1ee3
Show file tree
Hide file tree
Showing 17 changed files with 299 additions and 205 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,25 @@

## 🏁 Get Started

To get started, fork your own copy and clone the master branch. To clone a branch you can run the following:
The repository has two branches, 'prod' and 'staging'.

prod (Production Branch) represents the live, user-facing version of the project where bug-free, well-tested code resides.

staging (Staging Branch) serves as a pre-production environment, where features and fixes are tested before they go live.

To get started, fork your own copy and clone your chosen branch. To clone a branch you can run the following:

Clone the 'prod' branch (production)

```bash
git clone -b master https://github.com/<Your username>/papers-codechef.git
git clone -b prod https://github.com/<Your username>/papers-codechef.git
```
OR

Clone the 'staging' branch (staging)

```bash
git clone -b staging https://github.com/<Your username>/papers-codechef.git
```

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

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.

## License

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@react-pdf-viewer/core": "3.12.0",
"@react-pdf-viewer/default-layout": "^3.12.0",
"@react-pdf-viewer/full-screen": "^3.12.0",
"@react-pdf-viewer/get-file": "^3.12.0",
"@react-pdf-viewer/zoom": "^3.12.0",
"@t3-oss/env-nextjs": "^0.10.1",
"@types/mongoose": "^5.11.97",
Expand Down
21 changes: 12 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/app/actions/get-papers-by-id.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// "use server";
import { ErrorResponse, PaperResponse } from "@/interface";
import axios, { AxiosResponse } from "axios";

export const fetchPaperID = async (
id: string,
) => {
try {
const response: AxiosResponse<PaperResponse> = await axios.get(
`http://localhost:3000/api/paper-by-id/${id}`,
);
return response.data;
} catch (err: unknown) {
throw err;

}
};
4 changes: 2 additions & 2 deletions src/app/api/upload/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {

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

public_id_cloudinary,
finalUrl,
Expand Down
47 changes: 23 additions & 24 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,46 @@ const HomePage = () => {
<div>
<Navbar />
</div>
<div className="mt-2 flex flex-grow flex-col items-center justify-center gap-y-6">
<div className="w-full max-w-2xl space-y-6 text-center">
<h1 className="phonk text-2xl font-bold tracking-wider md:text-3xl">
Built by students for students
<div className="mt-2 flex flex-grow flex-col items-center justify-center gap-y-10">

<div className="w-full max-w-2xl space-y-10 text-center">

<h1 className="phonk text-2xl md:text-3xl mx-auto">
Built by Students for Students
</h1>
<p className="text-base font-semibold">

<p className="text-md font-semibold font-sans w-[90%] mx-auto md:w-full">
Prepare to excel in your CATs and FATs with CodeChef-VIT&apos;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>
<div className="flex flex-wrap justify-center gap-4">
<Button
variant="outline"
className="rounded-full px-6 py-6 text-xs font-semibold"
>
NO SIGN UP REQUIRED
</Button>
<Button
variant="outline"
className="rounded-full px-6 py-6 text-xs font-semibold"
>
FILTERED SEARCH
</Button>
<Button
variant="outline"
className="rounded-full px-6 py-6 text-xs font-semibold"
>
FLEXIBLE DOWNLOAD
</Button>

<div className="flex flex-wrap justify-center gap-4 text-sm font-bold">
{["NO SIGN UP REQUIRED", "FILTERED SEARCH", "FLEXIBLE DOWNLOAD"].map((text) => (
<div key={text} className="p-[2px] bg-gradient-to-r from-[#562EE7] to-[#bd21b4] rounded-full">
<div className="rounded-full bg-white dark:bg-black px-6 py-3 tracking-wider text-black dark:text-white font-sans">
{text}
</div>
</div>
))}
</div>

</div>

<div className="z-20 w-full max-w-xl">
<SearchBar />
</div>

<div className="max-3xl w-full">
<StoredPapers />
</div>

</div>

<Footer />

</div>
);
};
Expand Down
Loading

0 comments on commit 20c1ee3

Please sign in to comment.