-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
2,112 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export RESEND_API_KEY=test | ||
export [email protected] | ||
export [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
node_modules | ||
lib | ||
tsconfig.tsbuildinfo | ||
.envrc | ||
/node_modules | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '2' | ||
services: | ||
homepage: | ||
build: . | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
PORT: 3000 | ||
RESEND_API_KEY: test | ||
RESEND_TO_EMAIL: [email protected] | ||
RESEND_FROM_EMAIL: [email protected] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,44 @@ | ||
{ | ||
"name": "ekulno-homepage", | ||
"version": "0.0.1", | ||
"private": true, | ||
"scripts": { | ||
"build": "tsc", | ||
"start": "nodemon lib/index.js" | ||
"prod:build": "webpack --config webpack.js --mode=production", | ||
"prod:start": "node build/server.js", | ||
"clean": "rm -rf ./build", | ||
"dev:build:watch": "webpack --config webpack.js --mode=development -w", | ||
"dev:start": "nodemon --exec 'node' ./build/server.js" | ||
}, | ||
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447", | ||
"dependencies": { | ||
"@types/express": "^4.17.21", | ||
"body-parser": "^1.20.2", | ||
"email-validator": "^2.0.4", | ||
"express": "^4.18.2", | ||
"express-async-errors": "^3.1.1", | ||
"@types/express": "^4.17.6", | ||
"@types/node": "^16.18.102", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@types/react-router": "^5.1.20", | ||
"@types/serialize-javascript": "^1.5.0", | ||
"css-loader": "^6.5.1", | ||
"express": "^4.17.1", | ||
"file-loader": "^6.2.0", | ||
"html-webpack-plugin": "^5.5.0", | ||
"identity-obj-proxy": "^3.0.0", | ||
"nodemon": "^2.0.4", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-head": "^3.4.2", | ||
"react-hook-form": "^7.52.1", | ||
"react-router": "^6.25.1", | ||
"react-router-dom": "^6.25.1", | ||
"react-schemaorg": "^2.0.0", | ||
"resend": "^3.4.0", | ||
"typescript": "^5.3.3" | ||
}, | ||
"type": "module", | ||
"name": "mailer", | ||
"version": "0.0.1", | ||
"description": "writes an email to a preconfigured address upon receipt of a post request", | ||
"main": "lib/index.js", | ||
"repository": "https://github.com/ekulno/contact-form-mailer", | ||
"author": "ekulno", | ||
"license": "MIT", | ||
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" | ||
"schema-dts": "^1.1.2", | ||
"serialize-javascript": "^3.1.0", | ||
"style-loader": "^3.3.1", | ||
"terser-webpack-plugin": "^5.2.5", | ||
"ts-loader": "^9.5.1", | ||
"typescript": "^5.5.3", | ||
"webpack": "^5.64.4", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-node-externals": "^1.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
</head> | ||
<body style="margin: 0"> | ||
<div id="root" style="height: 100vh"></div> | ||
<script src="/build/hydrate.js"></script> | ||
</body> | ||
</html> |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://www.robotstxt.org/robotstxt.html | ||
User-agent: * | ||
Disallow: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# homepage | ||
|
||
Source of my homepage [ekul.no](https://ekul.no). | ||
Source of my homepage [ekul.no](https://ekul.no). | ||
|
||
## usage | ||
|
||
- dev build: `yarn dev:build:watch` and `yarn dev:start`. | ||
- production build: `yarn prod:build && yarn prod:start` | ||
- dockerized production build: `docker compose build && docker compose up` | ||
|
||
Application will be available at `http://localhost:3000` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es5", | ||
"lib": ["dom"], | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"isolatedModules": true, | ||
"jsx": "react", | ||
"noEmit": false, | ||
"sourceMap": true | ||
}, | ||
"include": ["server"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import serialize from 'serialize-javascript'; | ||
import path from 'path'; | ||
import fs from 'fs'; | ||
import React from 'react'; | ||
import ReactDOMServer from 'react-dom/server'; | ||
|
||
export default <P>( | ||
App: React.ReactElement<P>, | ||
globalState: string | undefined, | ||
): Promise<string> => new Promise((resolve, reject) => { | ||
const app = ReactDOMServer.renderToString(App); | ||
|
||
const indexFile = path.resolve('./server/index.html'); | ||
fs.readFile(indexFile, 'utf8', (err, data) => { | ||
if (err) { | ||
reject(err); | ||
} | ||
const clientString = data | ||
.replace( | ||
'<div id="root"></div>', | ||
`<div id="root">${app}</div>`, | ||
) | ||
.replace( | ||
'<head>', | ||
`<head><script>window.__INITIAL__DATA__ = ${serialize(globalState)}</script>`, | ||
); | ||
resolve(clientString); | ||
}); | ||
}) |
Oops, something went wrong.