Skip to content

Commit bc6edd6

Browse files
Merge pull request #41 from HoagieClub/preview
App Router Migration, Fix Formatting, Clean Up
2 parents caf6260 + 801c6dc commit bc6edd6

Some content is hidden

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

74 files changed

+5877
-3114
lines changed

.env.local.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
1-
ENVIRONMENT="development"
2-
HOAGIE_API_URL="http://localhost:8080"
1+
# === Auth0 Configuration ===
2+
# The secret key used to sign and encrypt the session cookies. Keep this value secure.
3+
AUTH0_SECRET=""
4+
5+
# The base URL of your application where users will be redirected after authentication (e.g., http://localhost:3000/).
6+
AUTH0_BASE_URL=""
7+
8+
# The URL of your Auth0 tenant, which identifies the domain associated with your Auth0 account.
9+
AUTH0_ISSUER_BASE_URL=""
10+
11+
# The Client ID of your Auth0 application, used to identify your app to Auth0.
12+
AUTH0_CLIENT_ID=""
13+
14+
# The Client Secret of your Auth0 application, used to authenticate your app with Auth0. Keep this value secure.
15+
AUTH0_CLIENT_SECRET=""
16+
17+
# The audience for the issued tokens, typically your API identifier or the intended recipient of the token.
18+
AUTH0_AUDIENCE=""
19+
20+
# The scope of the authentication request, defining what information (e.g., profile, email) is requested.
21+
AUTH0_SCOPE=""
22+
23+
# === Hoagie API Configuration ===
24+
# The base URL for the Hoagie API server, where your app will make API requests.
25+
HOAGIE_API_URL=""
26+
27+
# === Environment Configuration ===
28+
# Set to 'false' for development mode, 'true' for production.
29+
PROD="false"

.eslintrc

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**References**
2+
3+
- Linear:
4+
5+
**Proposed Changes**
6+
7+
- _Add your proposed changes here_

.github/workflows/lint.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
name: Hoagie Lint
1+
name: Lint
22
on: pull_request
33
jobs:
4-
build:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v2
8-
- name: Install modules
9-
run: yarn
10-
- name: Run ESLint
11-
run: yarn lint
4+
run-linters:
5+
name: Run linters
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Check out Git repository
10+
uses: actions/checkout@v5
11+
12+
- name: Set up Node.js
13+
uses: actions/setup-node@v5
14+
with:
15+
node-version: 22
16+
17+
# ESLint and Prettier must be in `package.json`
18+
- name: Install Node.js dependencies
19+
run: yarn install --frozen-lockfile
20+
21+
- name: Run linters
22+
uses: wearerequired/lint-action@v2.3.0
23+
with:
24+
eslint: true
25+
prettier: true

.prettierrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"quoteProps": "as-needed",
7+
"jsxSingleQuote": true,
8+
"singleQuote": true,
9+
10+
"trailingComma": "es5",
11+
"bracketSpacing": true,
12+
"bracketSameLine": false,
13+
"arrowParens": "always",
14+
"requirePragma": false,
15+
"insertPragma": false,
16+
"proseWrap": "preserve",
17+
"htmlWhitespaceSensitivity": "css",
18+
"endOfLine": "lf",
19+
"embeddedLanguageFormatting": "auto"
20+
}

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# MIT License
2+
3+
Copyright 2025 Hoagie Club
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the software.
8+
9+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
11
# HoagieStuff
2+
23
![Showcase of Hoagie Stuff](https://stuff.hoagie.io/showcase.gif)
34

4-
Everything on campus, from bulletin to sales, in one place.
5+
Everything on campus, from bulletin to sales, in one place.
56

67
## Setup
8+
79
NOTE: You will need to rename `.env.local.txt` to `.env.local` to run it locally. Place it in your main directory. You will also need Node.js, NPM, and Yarn, there are plenty of tutorials online on how to install these.
810
Assuming you have those tools and files, do the following to install dependencies:
11+
912
```
1013
yarn
1114
```
15+
1216
and finally, run the server with:
17+
1318
```
1419
yarn dev
1520
```
21+
1622
As simple as that! We use `yarn` for everything related to dependencies so **do NOT use `npm install`** when you are trying to add new packages. Instead use `yarn add`.
1723

1824
## VSCode
25+
1926
We use VSCode for development. Please install the following packages:
2027

2128
1. [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
2229
1. [Live Share](https://marketplace.visualstudio.com/items?itemName=MS-vsliveshare.vsliveshare)
2330

2431
ESLint is particularly important, if everything is installed correctly, it will allow you to see style errors inside the editor which we use to make sure our code is tidy and consistent throughout the codebase (same as output from `yarn lint`).
32+
2533
## Contribution
34+
2635
**Always create new branches when adding new features.** For example, let's say I am adding a delete button. I would do:
36+
2737
```
2838
# Switch to new branch called delete-button
2939
git checkout -b delete-button
3040
```
3141

3242
When the main branch get updated, you want to run the following:
43+
3344
```
3445
# If there were any new commits, rebase your development branch, for example delete-button
3546
git checkout delete-button
3647
git pull --rebase main
3748
```
49+
3850
You may have to deal with merge conflicts; this will be visible and easier to deal with in VSCode. Here's a [short video about how to do it](https://www.youtube.com/watch?v=QmKdodJU-js).

_redirects

Whitespace-only changes.

app/Content.tsx

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
'use client';
2+
3+
import React, { ReactNode } from 'react';
4+
5+
import { useUser } from '@auth0/nextjs-auth0/client';
6+
import { Pane, Text, Paragraph } from 'evergreen-ui';
7+
import { Metadata } from 'next';
8+
9+
import Layout from '@/lib/hoagie-ui/Layout';
10+
import Nav from '@/lib/hoagie-ui/Nav';
11+
import Theme from '@/lib/hoagie-ui/Theme';
12+
13+
import '@/lib/hoagie-ui/theme.css';
14+
import '@/app/stuff.css';
15+
16+
export const metadata: Metadata = {
17+
title: 'Stuff by Hoagie',
18+
};
19+
20+
const RainbowLogo = () => (
21+
<Pane whiteSpace='nowrap'>
22+
<Text
23+
is='h2'
24+
display='inline-block'
25+
className='hoagie logo'
26+
color='grey900'
27+
>
28+
hoagie
29+
</Text>
30+
<Paragraph
31+
is='h2'
32+
display='inline-block'
33+
color='blue500'
34+
className='hoagie logo rainbow-text'
35+
>
36+
stuff
37+
</Paragraph>
38+
</Pane>
39+
);
40+
41+
const RainbowHeader = () => (
42+
<Pane
43+
width='100%'
44+
height={20}
45+
display='flex'
46+
flexDirection='row'
47+
style={{
48+
backgroundImage: `linear-gradient(
49+
90deg,
50+
hsl(0deg 73% 75%) 0%,
51+
hsl(12deg 94% 76%) 19%,
52+
hsl(22deg 100% 75%) 27%,
53+
hsl(33deg 100% 74%) 34%,
54+
hsl(44deg 82% 72%) 41%,
55+
hsl(69deg 51% 70%) 47%,
56+
hsl(107deg 44% 75%) 53%,
57+
hsl(149deg 45% 73%) 59%,
58+
hsl(175deg 52% 64%) 66%,
59+
hsl(190deg 77% 57%) 73%,
60+
hsl(201deg 97% 62%) 81%,
61+
hsl(225deg 100% 76%) 100%
62+
)`,
63+
}}
64+
>
65+
{/* <Pane width="20%" height={20} background="red500" />
66+
<Pane width="20%" height={20} background="yellow300" />
67+
<Pane width="20%" height={20} background="green300" />
68+
<Pane width="20%" height={20} background="teal300" />
69+
<Pane width="20%" height={20} background="rblue300" /> */}
70+
</Pane>
71+
);
72+
73+
export default function Content({
74+
children,
75+
}: {
76+
children: ReactNode;
77+
}): JSX.Element {
78+
const tabs = [
79+
{ href: '/all', title: 'All' },
80+
{ href: '/marketplace', title: 'Marketplace' },
81+
{ href: '/lost', title: 'Lost & Found' },
82+
{ href: '/bulletins', title: 'Bulletins' },
83+
];
84+
const user = useUser();
85+
86+
return (
87+
<Theme palette='gray'>
88+
<Layout>
89+
<Nav
90+
name='stuff'
91+
tabs={tabs}
92+
user={user?.user}
93+
LogoComponent={RainbowLogo}
94+
HeaderComponent={RainbowHeader}
95+
/>
96+
{children}
97+
</Layout>
98+
</Theme>
99+
);
100+
}

app/all/[pid]/page.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use client';
2+
3+
import { withPageAuthRequired } from '@auth0/nextjs-auth0/client';
4+
5+
import PostPage from '@/components/PostPage';
6+
7+
type Params = {
8+
params: { pid: string };
9+
};
10+
11+
export default withPageAuthRequired(({ params }: Params) => {
12+
const { pid } = params;
13+
const pageNumber = pid ? parseInt(pid, 10) : 1;
14+
return <PostPage pageNumber={pageNumber} />;
15+
});

0 commit comments

Comments
 (0)