First commit

This commit is contained in:
Ryan Freeman 2021-11-16 21:32:21 +00:00
commit 5696b2fe40
17 changed files with 10064 additions and 0 deletions

37
.gitignore vendored Normal file
View File

@ -0,0 +1,37 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.idea/
out/
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
# vercel
.vercel

0
README.md Normal file
View File

View File

@ -0,0 +1,9 @@
export default function ExternalLink() {
return (
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="24"
stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2"
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
</svg>
)
};

11
components/GitHub.js Normal file
View File

@ -0,0 +1,11 @@
export default function GitHub() {
return (
<svg aria-hidden="true" height="24" viewBox="0 0 16 16" version="1.1" width="24"
data-view-component="true">
<path
fill="currentColor"
fillRule="evenodd"
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
</svg>
)
};

22
components/Projects.js Normal file
View File

@ -0,0 +1,22 @@
import styles from '../styles/Home.module.css';
import ExternalLink from './ExternalLink';
export default function Projects({projectData}) {
return (
<>
<p className={styles.description}>
Projects
</p>
<div className={styles.grid}>
{projectData.map((project, idx) => (
<a href={project.href}
className={styles.card}
key={idx}>
<h2>{project.name}<ExternalLink/></h2>
<p>{project.description}</p>
</a>
))}
</div>
</>
)
};

12
data/projects.json Normal file
View File

@ -0,0 +1,12 @@
[
{
"name": "Intellagent",
"description": "Help desk application powered by AI and machine learning.",
"href": "https://github.com/r-freeman/intellagent-server"
},
{
"name": "Resume",
"description": "A fully customisable online resume created with Next.js.",
"href": "https://github.com/r-freeman/resume"
}
]

7
lib/custom.js Normal file
View File

@ -0,0 +1,7 @@
import fs from 'fs';
export function getCustomData(file) {
const path = `${process.env.dataDirectory}/${file}`;
return JSON.parse(fs.readFileSync(path));
}

7
next.config.js Normal file
View File

@ -0,0 +1,7 @@
const path = require("path");
const dataDirectory = path.join(process.cwd(), "data");
module.exports = {
env: {dataDirectory},
reactStrictMode: true,
}

9746
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "portfolio",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "12.0.4",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"eslint": "7.32.0",
"eslint-config-next": "12.0.4"
}
}

7
pages/_app.js Normal file
View File

@ -0,0 +1,7 @@
import '../styles/globals.css';
function App({Component, pageProps}) {
return <Component {...pageProps} />
}
export default App;

17
pages/_document.js Normal file
View File

@ -0,0 +1,17 @@
import Document, {Html, Head, Main, NextScript} from 'next/document';
class Doc extends Document {
render() {
return (
<Html lang="en">
<Head/>
<body>
<Main/>
<NextScript/>
</body>
</Html>
)
}
}
export default Doc;

43
pages/index.js Normal file
View File

@ -0,0 +1,43 @@
import Head from 'next/head';
import styles from '../styles/Home.module.css';
import GitHub from '../components/GitHub';
import {getCustomData} from '../lib/custom';
import Projects from '../components/Projects';
export default function Home({projectData}) {
return (
<div className={styles.container}>
<Head>
<title>Ryan Freeman | Full Stack Developer in Dublin, Ireland</title>
<meta name="author" content="Ryan Freeman"/>
<meta name="description" content="Full Stack Developer in Dublin"/>
<link rel="icon"
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>👋</text></svg>"/>
</Head>
<main className={styles.main}>
<h1 className={styles.title}>
Ryan Freeman
<span>Full Stack Developer</span>
</h1>
<div className={styles.links}>
<a href="https://github.com/r-freeman">
<GitHub/>
<span className={styles.srOnly}>GitHub profile</span>
</a>
</div>
<Projects
projectData={projectData}/>
</main>
</div>
)
}
export async function getStaticProps() {
const projectData = await getCustomData('projects.json');
return {
props: {
projectData
}
}
}

2
public/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-agent: *
Allow: /*

14
public/sitemap.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->
<url>
<loc>https://ryanfreeman.dev/</loc>
<lastmod>2021-10-18T19:53:53+00:00</lastmod>
</url>
</urlset>

95
styles/Home.module.css Normal file
View File

@ -0,0 +1,95 @@
.container {
padding: 0 2rem;
}
.main {
min-height: 100vh;
padding: 4rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.links {
margin-top: 1rem;
}
.title span {
display: block;
margin-top: 0.5rem;
font-size: 24px;
font-weight: normal;
color: grey;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 3rem;
}
.title {
text-align: center;
}
.description {
margin: 2rem 0 1rem 0;
font-size: 1.5rem;
line-height: 1.5;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 64rem;
}
.card {
margin: 1rem;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
max-width: 24rem;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h2 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.srOnly {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}

16
styles/globals.css Normal file
View File

@ -0,0 +1,16 @@
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}