Skip to content

Commit 894db93

Browse files
authored
Merge pull request #6 from willwillis/ant
Content Updates - 1.0 Release
2 parents 6bc44ba + 2508090 commit 894db93

8 files changed

Lines changed: 187 additions & 60 deletions

File tree

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@ant-design/icons": "^5.5.1",
67
"@testing-library/jest-dom": "^5.17.0",
78
"@testing-library/react": "^13.4.0",
89
"@testing-library/user-event": "^13.5.0",
57.3 KB
Loading

public/cpanel-setup-node-app.png

41.8 KB
Loading

src/App.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636
transform: rotate(360deg);
3737
}
3838
}
39+

src/App.js

Lines changed: 176 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
import React from 'react';
2-
import { Layout, Typography, Avatar, List, Space, Divider, Row, Col } from 'antd';
3-
import { CheckCircleTwoTone, ClockCircleOutlined } from '@ant-design/icons';
4-
import CodeBlock from './components/CodeBlock';
1+
import React from "react";
2+
import {
3+
Layout,
4+
Typography,
5+
Avatar,
6+
List,
7+
Space,
8+
Divider,
9+
Row,
10+
Col,
11+
Image,
12+
} from "antd";
513

6-
const { Content } = Layout;
14+
import { CheckCircleTwoTone, ClockCircleOutlined } from "@ant-design/icons";
15+
import CodeBlock from "./components/CodeBlock";
16+
import {
17+
GithubOutlined,
18+
AmazonOutlined,
19+
HeartOutlined,
20+
} from "@ant-design/icons";
21+
const { Content, Footer } = Layout;
722
const { Title, Text, Paragraph } = Typography;
823

9-
1024
function App() {
1125
const sideQuests = [
12-
{ title: "Databricks", status: "completed" },
13-
{ title: "Laravel v CakePHP for small projects", status: "completed" },
14-
{ title: "Running Python Flask in a shared hosting environment", status: "completed" },
15-
{ title: "Running React in shared hosting environment", status: "inProgress" },
26+
{
27+
title: "Plug-and-play design systems like Ant Design",
28+
status: "completed",
29+
},
30+
{ title: "Syntax highlighting", status: "completed" },
31+
{
32+
title:
33+
"Literally every web feature you could ever image is availabel in JS/React",
34+
status: "completed",
35+
},
1636
];
1737

1838
// const infraAndComponents = [
@@ -39,112 +59,165 @@ function App() {
3959
console.log(\`Server is running on port \${PORT}\`);
4060
});
4161
`;
62+
63+
const createReactApp = `npx create-react-app my-website`;
64+
4265
return (
43-
<Layout style={{ minHeight: '100vh', backgroundColor: '#f5f5f5' }}>
44-
<Content style={{ maxWidth: '800px', margin: '0 auto', padding: '40px' }}>
66+
<Layout style={{ minHeight: "100vh", backgroundColor: "#f5f5f5" }}>
67+
<Content style={{ maxWidth: "800px", margin: "0 auto", padding: "40px" }}>
4568
{/* Profile Section */}
4669
<Row justify="center">
4770
<Col>
4871
<Avatar
4972
size={120}
5073
src="https://willwillis.com/assets/images/simpsons-me.webp" // Replace with your avatar URL
51-
style={{ marginBottom: '20px' }}
74+
style={{ marginBottom: "20px" }}
5275
/>
5376
</Col>
5477
</Row>
5578
<Row justify="center">
5679
<Col>
57-
<Title level={2}>So you <u>can</u> run ⚛React on Shared Hosting!🫶</Title>
80+
<Title level={1}>React on Shared Hosting</Title>
5881
<Text type="secondary">New web meets nostalgic web.</Text>
5982
</Col>
6083
</Row>
6184

85+
<Row justify="center" align="middle" style={{ margin: "2em" }}>
86+
<Col>
87+
<Image
88+
src="/gtp-server-room.jpg"
89+
preview={false}
90+
alt="illustration of a server room"
91+
/>
92+
</Col>
93+
</Row>
6294
<Divider />
63-
6495
{/* Motivation Section */}
65-
<Title level={3}>My Motivation</Title>
96+
<Title level={2}>My Motivation</Title>
6697
<Paragraph>
67-
I've been nostalgic for the old and "easy" web for a few years now. Don't get me wrong, websites today are impressively useable, responsive and beautiful. But they're also complicated. Some might argue, overly complicated if you're developing a simple/personal web site.
98+
I've been nostalgic for the old and "easy" web for a few years now.
99+
Don't get me wrong, websites today are impressively useable,
100+
responsive and beautiful. But they're also complicated. Some might
101+
argue, overly complicated if you're developing a simple/personal web
102+
site.
68103
</Paragraph>
104+
<Paragraph>placeholder: explain why it's complicated</Paragraph>
69105
<Paragraph>
70-
placeholder, explain why complicated
106+
placeholder: try and explain how I can be nostalgic for old web, yet
107+
I'm using React
71108
</Paragraph>
109+
<Paragraph>placeholder: Make it make sense!</Paragraph>
72110
<Paragraph>
73-
Also, cloud hosting can get expensive quickly. I know, I know, before you call me out...
74-
you can host the latest and greatest JavaScript built websites/frameworks for free with Cloudflare,
75-
Netlify and other providers. Who's really comfortable though, building their site on a "free tier"
76-
that could change at any moment?
111+
Also, cloud hosting can get expensive quickly. I know, I know, before
112+
you call me out... you can host the latest and greatest JavaScript
113+
built websites/frameworks for free with Cloudflare, Netlify and other
114+
providers. Who's really comfortable though, building their site on a
115+
"free tier" that could change at any moment?
77116
</Paragraph>
78117
<Paragraph>
79-
This is the point where I realize my reasons may not be the most rational... Suffice it to say,
80-
I wanted to see if it was possible.
118+
This is the point where I realize my reasons may not be the most
119+
rational... Suffice it to say, I wanted to see if it was possible.
81120
</Paragraph>
82121

83-
84122
<Divider />
85123

86124
{/* About Me Section */}
87-
<Title level={3}>The implementation</Title>
125+
<Title level={2}>The implementation</Title>
88126
<Paragraph>
89-
If you are reading this... <i>it's possible</i>! And it wasn't really that difficult either.
127+
If you are reading this... <i>it's possible</i>! And it wasn't really
128+
that difficult either.
90129
</Paragraph>
91130
<Paragraph>
92-
First, create a React app like you normally would. <pre>npx create-react-app my-website</pre>
131+
First, create a React app like you normally would.{" "}
132+
<CodeBlock code={createReactApp} language="bash" />
93133
</Paragraph>
94134
<Paragraph>
95-
Host your code at Github. If you don't know about <pre>git</pre> or version control, start here (link)
135+
Next, add your code to a repository on Github. If you don't know about{" "}
136+
<code>git</code> or version control, start{" "}
137+
<a href="https://docs.github.com/en/get-started/using-git/about-git">
138+
here
139+
</a>
140+
. <GithubOutlined />
96141
</Paragraph>
97142
<Paragraph>
98-
GitHub not only provides version control, but "Actions". They let you run/build code on their servers... FOR FREE! And yes,
99-
you could even host the site at github <a href="https://pages.github.com/">pages</a> without
100-
having to pay for shared hosting, or lease domain name. I have a very simple
101-
<a href="https://github.com/willwillis/react.willwillis.com/blob/main/.github/workflows/deploy.yml">deploy workflow</a>
102-
that does the following:
103-
104-
<ol>
105-
<li>Watches for code commits on the <pre>main</pre> branch</li>
106-
<li>When triggered, the actions build the React application, resulting in some HTML and JavaScript being generated.</li>
107-
<li>Lastly, the actions transfer those files from the github server to my shared hosting server over FTP.</li>
108-
</ol>
143+
GitHub not only provides version control, but "Actions". They let you
144+
run/build code on their servers... FOR FREE! And yes, you could even
145+
host the site at github <a href="https://pages.github.com/">pages</a>{" "}
146+
without having to pay for shared hosting, or lease domain name.
109147
</Paragraph>
110-
111-
112-
<Divider />
113-
114-
{/* About Me Section */}
115-
<Title level={3}>Thoughts so far</Title>
116148
<Paragraph>
117-
I like the semantic tags like paragraph, Row, Col, etc.. I need to have another look at bootstrap. tailwind was a little too much, even anchors were 'reset', I don't think I should have to style every 'a' on the page. but that's probably my lack of understanding.
149+
My Github actions consist of a simple single{" "}
150+
<a href="https://github.com/willwillis/react.willwillis.com/blob/main/.github/workflows/deploy.yml">
151+
deploy workflow
152+
</a>{" "}
153+
that does the following:
154+
<ol style={{ margin: "1.5em", lineHeight: "2", marginBottom: "2em" }}>
155+
<li>
156+
Watches for code commits on the <code>main</code> branch
157+
</li>
158+
<li>
159+
When triggered, the actions build the React application, resulting
160+
in some HTML and JavaScript being generated.
161+
</li>
162+
<li>
163+
Lastly, the actions transfer those files from the github server to
164+
my shared hosting server over FTP.
165+
</li>
166+
</ol>
118167
</Paragraph>
168+
<Title level={3}>cPanel / Shared Hosting Configration</Title>
119169
<Paragraph>
120-
The default Typography is small. I can override that tho.
170+
With the files on the shared server, we're ready to umm, "serve" the
171+
application. In the <a href="https://cpanel.net">cPanel</a> dashboard,
172+
click on the <code>Setup Node.js App</code> link.
173+
<Row justify="center" align="middle" style={{ margin: "2em" }}>
174+
<Col>
175+
<Image src="/cpanel-setup-node-app.png" />
176+
</Col>
177+
</Row>
178+
You'll then be presented with a simple form where you can specify
179+
where on the file system the application will live (application root).
180+
How you'd like people to find your react app (URL), and the name of
181+
the startup file.
182+
<Row justify="center" align="middle" style={{ margin: "2em" }}>
183+
<Col>
184+
<Image src="/cpanel-create-node-app-form.png" />
185+
</Col>
186+
</Row>
187+
Notice we're setting up a "Node.js" app, not a "React" app. In simple
188+
terms, <code>Node</code> is what's actually serving the{" "}
189+
<code>React</code> app.
190+
<Title level={4} style={{ marginTop: "1em" }}>
191+
server.js
192+
</Title>
193+
<CodeBlock code={serverCode} language="javascript" />
121194
</Paragraph>
122195

123196
<Divider />
124-
197+
125198
{/* About Me Section */}
126-
<Title level={3}>Implementation</Title>
199+
<Title level={2}>Wrapping it up</Title>
127200
<Paragraph>
128-
I like the semantic tags like paragraph, Row, Col, etc.. I need to have another look at bootstrap. tailwind was a little too much, even anchors were 'reset', I don't think I should have to style every 'a' on the page. but that's probably my lack of understanding.
201+
I may be coming around to the idea of using React for simple/personal
202+
websites. I've built dashboard apps for work using Next.js/React,
203+
GraphQL, etc... but that makes sense, cuz COPRORATE, right?
129204
</Paragraph>
205+
130206
<Paragraph>
131-
The default Typography is small. I can override that tho.
207+
I just can't deny any longer how much functionality, features like
208+
responsiveness, and general <b>pizzazz</b> to be had with little to no
209+
effort. Like what, you ask? For starters...
132210
</Paragraph>
133-
<CodeBlock code={serverCode} language="javascript" />
134-
<Divider />
135-
136211

137-
{/* Recent Side Quests Section */}
138-
<Title level={3}>Recent Side Quests</Title>
139212
<List
140213
dataSource={sideQuests}
141214
renderItem={(item) => (
142215
<List.Item>
143216
<Space>
144-
{item.status === 'completed' ? (
217+
{item.status === "completed" ? (
145218
<CheckCircleTwoTone twoToneColor="#52c41a" />
146219
) : (
147-
<ClockCircleOutlined style={{ color: '#faad14' }} />
220+
<ClockCircleOutlined style={{ color: "#faad14" }} />
148221
)}
149222
<Text>{item.title}</Text>
150223
</Space>
@@ -153,8 +226,52 @@ function App() {
153226
/>
154227

155228
<Divider />
229+
<Title level={2}>Disclaimer</Title>
230+
<Paragraph>
231+
If you're asking yourself,{" "}
232+
<em>
233+
"Is his 'nostalgic shared hosting' actually running on some guy's
234+
server in a budget, mid-tier co-lo?"
235+
</em>
236+
</Paragraph>
237+
<Paragraph>
238+
I'm 99% sure it's running on someone's EC2 instance in AWS{" "}
239+
<AmazonOutlined /> ... so there's some irony for ya.
240+
</Paragraph>
241+
<Paragraph>
242+
Thanks for reading! If you enjoyed this, feel free to subscribe to my{" "}
243+
<a href="https://links.willwillis.com/guest/links/feed">links</a> RSS
244+
feed.
245+
</Paragraph>
156246

247+
<Divider />
248+
<Title level={2}>To do</Title>
249+
<Paragraph>
250+
<ul>
251+
<li>
252+
Tinker with some different design systems. I <HeartOutlined />{" "}
253+
<a href="https://framework.willwillis.com/">Bootstrap</a>, I've
254+
dabbled in <a href="https://clarity.design/">Clarity Design</a>,
255+
and have a firm grasp on Material UI, Tailwind CSS, and and I am
256+
in awe of what <a href="https://ui.shadcn.com/">Shadcn/ui</a> is
257+
doing.
258+
</li>
259+
<li>
260+
Break sections or other features wich repeat themselves (I'm
261+
looking at you <code>Image</code>) into proper components
262+
</li>
263+
<li>
264+
build out a Perl/CGI or Python API to pull dynamic data from. YES,
265+
on shared hosting as well!
266+
</li>
267+
</ul>
268+
</Paragraph>
269+
<Divider />
157270
</Content>
271+
272+
<Footer style={{ textAlign: "center" }}>
273+
Obligatory Footer ©{new Date().getFullYear()} Created by Will Willis
274+
</Footer>
158275
</Layout>
159276
);
160277
}

src/index.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ code {
1111
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
1212
monospace;
1313
}
14+
15+
.ant-typography {
16+
font-family: 'Arial', sans-serif;
17+
color: #333;
18+
font-size: 18px;
19+
}
20+

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom/client';
3-
import './index.css';
43
import App from './App';
54
import reportWebVitals from './reportWebVitals';
65
import 'antd/dist/reset.css';
6+
import './index.css';
77
const root = ReactDOM.createRoot(document.getElementById('root'));
88
root.render(
99
<React.StrictMode>

0 commit comments

Comments
 (0)