Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IrvineHacks 2025 Preview Page and Initial Setup #383

Merged
merged 6 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 56 additions & 56 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
name: Deploy Preview

on:
pull_request:
pull_request:

permissions:
contents: read
pull-requests: write
contents: read
pull-requests: write

jobs:
Site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-version: 32.6.1
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>IrvineHacks 2024 Site</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_SITE}}
Studio:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'sanity')
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-version: 32.6.1
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>Sanity Studio</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_STUDIO}}
Site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-version: 32.6.1
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>IrvineHacks Site</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_SITE}}
Studio:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'sanity')
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-version: 32.6.1
github-comment: |
<table>
<tr>
<td><strong>Name</strong></td>
<td>Sanity Studio</td>
</tr>
<tr>
<td><strong>Preview</strong></td>
<td><a href='{{deploymentUrl}}'>Visit Preview</a></td>
</tr>
<tr>
<td><strong>Commit</strong></td>
<td>{{deploymentCommit}}</td>
</tr>
</table>
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ vars.VERCEL_ORG_ID}}
vercel-project-id: ${{ vars.VERCEL_PROJECT_ID_STUDIO}}
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# irvinehacks-site-2024
# irvinehacks-site

## Overview

This monorepo uses [turborepo](https://turbo.build/repo) with [pnpm](https://pnpm.io/) as a package manager. It contains the following:

### `apps/site`

A [Next.js](https://nextjs.org/) 13 project that uses the new app router.

This app contains the IrvineHacks site.

The development server runs at `http://localhost:3000`. If this port is taken, the next available port will be used.

### `apps/api`

A [FastAPI](https://fastapi.tiangolo.com/) project.

This app contains the api for the IrvineHacks site.
Expand Down Expand Up @@ -52,6 +55,7 @@ When running commands, use `pnpm` rather than `npm`.
### Python API

1. Ensure you are in `apps/api` with

```shell
cd apps/api
```
Expand All @@ -70,6 +74,7 @@ When running commands, use `pnpm` rather than `npm`.
```shell
source .venv/bin/activate
```

and for Windows, run

```shell
Expand All @@ -91,13 +96,13 @@ This project uses Docker for testing API methods locally.

A local MongoDB application will start running at `http://localhost:8081` after running `pnpm dev`.

*Note*: Because the Python files have been copied over to the Docker container, hot reload is no longer possible. Stopping the container and rerunning `pnpm dev` is the best option.
_Note_: Because the Python files have been copied over to the Docker container, hot reload is no longer possible. Stopping the container and rerunning `pnpm dev` is the best option.

### Build

To build all apps and packages, run the following command in the project root.

*Note*: You would run this BEFORE opening a PR as a sanity check for errors.
_Note_: You would run this BEFORE opening a PR as a sanity check for errors.

```bash
pnpm build
Expand All @@ -114,6 +119,7 @@ pnpm dev
```

## Helpful VSCode Extensions

- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for Python linting, intellisense, etc.
- [Mypy](https://marketplace.visualstudio.com/items?itemName=ms-python.mypy-type-checker) for Python type checking
- [Black](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter) for Python code formatting
Expand All @@ -132,9 +138,8 @@ This Turborepo includes the following packages/apps:
- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
- `tsconfig`: `tsconfig.json`s used throughout the monorepo


### Utilities

- [TypeScript](https://www.typescriptlang.org/) for static type checking
- [ESLint](https://eslint.org/) for code linting
- [Prettier](https://prettier.io) for code formatting
- [Prettier](https://prettier.io) for code formatting
2 changes: 1 addition & 1 deletion apps/api/src/routers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

router = APIRouter()

DEADLINE = datetime(2024, 1, 15, 8, 1, tzinfo=timezone.utc)
DEADLINE = datetime(2025, 1, 11, 8, 1, tzinfo=timezone.utc)


class IdentityResponse(BaseModel):
Expand Down
60 changes: 30 additions & 30 deletions apps/site/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,36 @@ const nextConfig = {
},
async redirects() {
return [
{
source: "/mentor",
destination: "https://forms.gle/yCmXvG89ygvxUSCd7",
permanent: true,
},
{
source: "/volunteer",
destination: "https://forms.gle/erpJjErKLJkEZMw48",
permanent: true,
},
{
source: "/waiver",
destination: DOCUSIGN_FORM_URL,
permanent: true,
},
{
source: "/incident",
destination: "https://forms.gle/A6BdsSzYSiyeTP8Y6",
permanent: true,
},
{
source: "/devpost",
destination: "https://irvinehacks-2024.devpost.com",
permanent: true,
},
{
source: "/feedback",
destination: "https://forms.gle/c154z45wRx7ARnrE9",
permanent: true,
},
// {
// source: "/mentor",
// destination: "https://forms.gle/yCmXvG89ygvxUSCd7",
// permanent: true,
// },
// {
// source: "/volunteer",
// destination: "https://forms.gle/erpJjErKLJkEZMw48",
// permanent: true,
// },
// {
// source: "/waiver",
// destination: DOCUSIGN_FORM_URL,
// permanent: true,
// },
// {
// source: "/incident",
// destination: "https://forms.gle/A6BdsSzYSiyeTP8Y6",
// permanent: true,
// },
// {
// source: "/devpost",
// destination: "https://irvinehacks-2024.devpost.com",
// permanent: true,
// },
// {
// source: "/feedback",
// destination: "https://forms.gle/c154z45wRx7ARnrE9",
// permanent: true,
// },
];
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
.landingBackground {
background-image: url("~@/assets/backgrounds/landing-background.jpg");
background-image: url("~@/assets/backgrounds/landing-background.png");
background-position: center bottom;
background-repeat: no-repeat;
background-size: cover;
mask-image: url("~@/assets/backgrounds/landing-background-mask.png");
mask-position: center bottom;
mask-repeat: no-repeat;
mask-size: cover;
}

.fogLeft,
.fogRight {
animation-delay: 2s;
animation-duration: 4s;
animation-fill-mode: forwards;
animation-timing-function: ease;
z-index: 1000;
}

.fogLeft {
animation-name: slideOutLeft;
}

.fogRight {
animation-name: slideOutRight;
}

@keyframes slideOutLeft {
Expand Down
20 changes: 8 additions & 12 deletions apps/site/src/app/(main)/(home)/sections/Landing/Landing.tsx
waalbert marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,41 +1,37 @@
"use client";

import { Suspense } from "react";
import Image from "next/image";
import { PerspectiveCamera } from "@react-three/drei";

import hasDeadlinePassed from "@/lib/utils/hasDeadlinePassed";
import haveApplicationsOpened from "@/lib/utils/haveApplicationsOpened";
import View from "@/components/canvas/View";
import Button from "@/lib/components/Button/Button";
import Fireflies from "../../components/Fireflies";

import fogLeft from "@/assets/images/fog-left.png";
import fogRight from "@/assets/images/fog-right.png";

import styles from "./Landing.module.css";

const Landing = () => {
const deadlinePassed = hasDeadlinePassed();
const applicationsOpened = haveApplicationsOpened();

return (
<section className={styles.landingBackground}>
<View className="absolute w-full h-full">
<Suspense fallback={null}>
<Fireflies />
<PerspectiveCamera makeDefault position={[0, -0.1, 1]} />
</Suspense>
</View>
<div className="flex flex-col justify-center items-center min-h-screen text-center overflow-x-hidden relative">
<Image src={fogLeft} alt="Fog" className={styles.fogLeft} fill />
<Image src={fogRight} alt="Fog" className={styles.fogRight} fill />
<h1 className="font-display text-4xl md:text-5xl font-bold mb-2">
IrvineHacks 2024
<p className="font-display text-2xl md:text-3xl">January 24&ndash;26</p>
<h1 className="font-display text-4xl md:text-5xl font-bold mb-5">
IrvineHacks 2025
</h1>
<p className="font-display text-2xl md:text-3xl">January 26&ndash;28</p>
{deadlinePassed ? (
<Button className="z-10" text="Applications have closed!" disabled />
) : (
) : applicationsOpened ? (
<Button className="z-10" text="Apply" href="/apply" />
) : (
<Button className="z-10" text="Coming Soon..." disabled />
waalbert marked this conversation as resolved.
Show resolved Hide resolved
)}
</div>
</section>
Expand Down
8 changes: 7 additions & 1 deletion apps/site/src/app/(main)/apply/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Image from "next/image";
import { redirect } from "next/navigation";

import hasDeadlinePassed from "@/lib/utils/hasDeadlinePassed";
import haveApplicationsOpened from "@/lib/utils/haveApplicationsOpened";

import ApplyConfirm from "./sections/ApplyConfirmation/ApplyConfirm";
import Form from "./sections/Form/Form";
Expand Down Expand Up @@ -36,6 +37,7 @@ export default async function Apply({
}

const deadlinePassed = hasDeadlinePassed();
const applicationsOpened = haveApplicationsOpened();

const applyBody = hasAcceptedQueryParam ? (
<>
Expand Down Expand Up @@ -73,7 +75,11 @@ export default async function Apply({
);
return (
<div className="flex flex-col items-center gap-10 my-32 min-h-[calc(100vh-8rem)]">
{deadlinePassed ? <ApplicationsClosed /> : applyBody}
{!applicationsOpened || deadlinePassed ? (
<ApplicationsClosed />
) : (
applyBody
)}
</div>
);
}
Loading
Loading