Skip to content

Commit

Permalink
Migrate to app router (#5)
Browse files Browse the repository at this point in the history
* upgrade next.js and related packages

* move components, page and styles into src directory

* move files to app router

* add meta data + add about image

* Remove commented out code

* upgrade cypress

* downgrade to cypress@13.5.1

* change component ubuntu version

* Cypress cli error (#6)

* remove start and wait-on for component tests

* downgrade next to @13.5.6

* remove viewport

* Reset GitHub Actions configuration and add theme color
  • Loading branch information
Rllyyy authored Dec 10, 2023
1 parent 3b5974d commit ebf42de
Show file tree
Hide file tree
Showing 43 changed files with 1,272 additions and 852 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "next/core-web-vitals"
}
"extends": [
"next",
"next/core-web-vitals"
]
}
6 changes: 1 addition & 5 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
COMMIT_INFO_SHA: ${{github.event.pull_request.head.sha}}

component:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: install

strategy:
Expand All @@ -90,10 +90,6 @@ jobs:
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
uses: cypress-io/github-action@v5
with:
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
start: yarn start
wait-on: "http://localhost:3000" # Waits for above
# Records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
record: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./.github/assets/hero-section-dark.png">
<source media="(prefers-color-scheme: light)" srcset="./.github/assets/hero-section.png">
<img alt="Image of hero section for portfolio website. Heading: Developing Solutions. Subheading: Hi, I am an aspiring Web Developer look fo rmy first real job experience (smiling face emoji). On the right side of the hero section there is an isometric home office with a computer desk, lamps and plants, in the style of 2d game art, navy and blue" src="./.github/assets/hero-section.png">
<img alt="Image of hero section for portfolio website. Heading: Developing Solutions. Subheading: Hi, I am an aspiring Web Developer. On the right side of the hero section there is an isometric home office with a computer desk, lamps and plants, in the style of 2d game art, navy and blue" src="./.github/assets/hero-section.png">
</picture>
</p>
</a>
Expand Down
153 changes: 0 additions & 153 deletions components/profile/profile.tsx

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
"@types/react-dom": "18.2.7",
"@vercel/analytics": "^1.0.1",
"cypress-real-events": "^1.9.1",
"eslint": "8.45.0",
"eslint-config-next": "13.4.12",
"eslint": "8.55.0",
"eslint-config-next": "14.0.3",
"framer-motion": "^10.13.1",
"next": "13.4.10",
"next": "13.5.6",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-use-measure": "^2.1.1",
"sharp": "^0.32.4",
"sharp": "^0.33.0",
"tailwind-merge": "^1.14.0",
"typescript": "5.1.6"
"typescript": "5.3.3"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"cypress": "^12.17.2",
"cypress": "13.5.1",
"postcss": "^8.4.27",
"tailwindcss": "^3.3.3"
}
Expand Down
33 changes: 0 additions & 33 deletions pages/_app.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions pages/_document.tsx

This file was deleted.

Binary file added public/images/office.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 20 additions & 3 deletions pages/about/index.tsx → src/app/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
import { type Metadata } from "next";
import Image from "next/image";

export default function About() {
return (
<main className='mt-10 md:mt-40 duration-200 bg-zinc-100 dark:bg-zinc-800 min-h-[90vh] px-4 lg:px-6 py-16'>
<div className='max-w-5xl mx-auto space-y-12'>
<main className='mt-10 md:mt-24 duration-200 bg-zinc-100 dark:bg-zinc-800 min-h-[90vh] py-16'>
<div className='relative w-full h-72'>
<Image
src='/images/office.png'
className='object-cover w-full h-full'
alt='image'
sizes='100vw'
fill
priority
/>
</div>
<div className='max-w-5xl px-4 mx-auto mt-16 space-y-12 lg:px-6'>
<section>
<h1 className='text-5xl'>About</h1>
<h1 className='text-5xl md:text-6xl'>About</h1>
<p className='mt-8 text-lg'>
This website serves as a platform to showcase my personal projects and academic assignments.
</p>
Expand All @@ -26,3 +39,7 @@ export default function About() {
</main>
);
}

export const metadata: Metadata = {
title: "About | Niklas Fischer",
};
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Analytics } from "@vercel/analytics/react";

import { Navbar } from "@/components/navbar";
import { Footer } from "@/components/footer";

import "@/app/globals.css";

import { type Metadata } from "next";
import { Providers } from "@/app/providers";

export const metadata: Metadata = {
title: "Niklas Fischer",
description: "The portfolio of Niklas Fischer",
viewport: "width=device-width, initial-scale=1, minimum-scale=1",
themeColor: "#4f46e5",
};

// Use this for next@14
// export const viewport: Viewport = {
// width: "device-width",
// initialScale: 1,
// minimumScale: 1,
// themeColor: "#4f46e5",
// };

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang='en' suppressHydrationWarning>
<body>
<Providers>
<Navbar />
{children}
<Footer />
</Providers>
<Analytics />
</body>
</html>
);
}
10 changes: 5 additions & 5 deletions pages/index.tsx → src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LandingPage } from "components/landingPage";
import { Projects } from "components/projects";
import { Skills } from "components/skills";
import { Assignments } from "components/assignments";
import { Profile } from "components/profile/profile";
import { LandingPage } from "@/components/landingPage";
import { Projects } from "@/components/projects";
import { Skills } from "@/components/skills";
import { Assignments } from "@/components/assignments";
import { Profile } from "@/components/profile";

export default function Home() {
return (
Expand Down
6 changes: 6 additions & 0 deletions pages/privacy/index.tsx → src/app/privacy/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Metadata } from "next";

export default function Privacy() {
return (
<main className='p-4 mx-auto duration-200 lg:px-6 mt-28 pb-28 md:mt-40 bg-zinc-100 dark:bg-zinc-800'>
Expand Down Expand Up @@ -368,3 +370,7 @@ export default function Privacy() {
</main>
);
}

export const metadata: Metadata = {
title: "Privacy | Niklas Fischer",
};
12 changes: 12 additions & 0 deletions src/app/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use client";

import { MotionConfig } from "framer-motion";
import { ThemeProvider } from "next-themes";

export function Providers({ children }: { children: React.ReactNode }) {
return (
<ThemeProvider enableSystem={true} attribute='class'>
<MotionConfig reducedMotion='user'>{children}</MotionConfig>
</ThemeProvider>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { Assignments } from ".";

import "../../styles/globals.css";
import "@/app/globals.css";

describe("<Assignments />", () => {
it("should render assignments", () => {
Expand Down
File renamed without changes.
Loading

1 comment on commit ebf42de

@vercel
Copy link

@vercel vercel bot commented on ebf42de Dec 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.