Compare commits
70 Commits
5c8322af85
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 720ed614b1 | |||
| 0ad73e0d3f | |||
| ab9044651c | |||
| 0aa0cc72a7 | |||
| 8c47404d02 | |||
| 3187ff439b | |||
| c0dc4eaca4 | |||
| 0787ece69f | |||
| 7bf6ea44c5 | |||
| 0513ff5585 | |||
| 144a81f8a4 | |||
| 42281ca58e | |||
| df7e0333fe | |||
| 9276918313 | |||
| ebf1435dec | |||
| cddce94945 | |||
| c810952feb | |||
| 544becce29 | |||
| cf0dd009e6 | |||
| 2313b37550 | |||
| 57d4d29e72 | |||
| 66939367b7 | |||
| d365a92ac6 | |||
| 4ce983a7e8 | |||
| 073a270c74 | |||
| 2e1c4da22d | |||
| 92a78a1178 | |||
| 5bcc960704 | |||
| d06e45847e | |||
| 40402267e1 | |||
| a8904c1c46 | |||
| 9a7eb6999a | |||
| 626e5f2130 | |||
| 64a5bac02c | |||
| 3b01218fe9 | |||
| 054c6a8067 | |||
| bf20391e3d | |||
| 605d27d546 | |||
| 7a484672da | |||
| 501c195d79 | |||
| eb07af78b2 | |||
| 2f34411338 | |||
| b255fe9df7 | |||
| c7e86b9f67 | |||
| 90f6509272 | |||
| eccdea5013 | |||
| 98ecd4e984 | |||
| c2ae195cb8 | |||
| fdbc4b1ed8 | |||
| 4be005725a | |||
| 560e3ab225 | |||
|
|
8976f4f9d8 | ||
|
|
cbb6b997e2 | ||
|
|
e61d3525a0 | ||
|
|
2c34229cc0 | ||
| 96834072af | |||
| db845bf6c6 | |||
| e8a8da31ac | |||
| 378e5aea4e | |||
| 07ec5555db | |||
| 1507fdb9eb | |||
| 1a5b5a336f | |||
| 23d206de99 | |||
| 6fe9d8c050 | |||
| 4d4a7c8c30 | |||
| 7feb00e33a | |||
| 3071ae41e6 | |||
| 4664aa983d | |||
| 9fde302756 | |||
| a798641848 |
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
.idea
|
||||
build
|
||||
node_modules
|
||||
.env*
|
||||
31
.github/workflows/build.yaml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
jobs:
|
||||
image_build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker buildx setup
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Gitea OCI repo login
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: gitea.tymur999.com
|
||||
username: tymur999
|
||||
password: ${{ secrets.OCI_TOKEN }}
|
||||
|
||||
- name: Build and push tymur999.com
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
gitea.tymur999.com/tymur999/blog:latest
|
||||
gitea.tymur999.com/tymur999/blog:nightly
|
||||
gitea.tymur999.com/tymur999/blog:${{ github.sha }}
|
||||
17
.idea/dataSources.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||
<data-source source="LOCAL" name="postgres@tymur999srv" uuid="17303c19-0923-4ed6-ae47-bceb69a2958e">
|
||||
<driver-ref>postgresql</driver-ref>
|
||||
<synchronize>true</synchronize>
|
||||
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
||||
<jdbc-url>jdbc:postgresql://tymur999srv:5432/postgres</jdbc-url>
|
||||
<jdbc-additional-properties>
|
||||
<property name="com.intellij.clouds.kubernetes.db.host.port" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
|
||||
<property name="com.intellij.clouds.kubernetes.db.container.port" />
|
||||
</jdbc-additional-properties>
|
||||
<working-dir>$ProjectFileDir$</working-dir>
|
||||
</data-source>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/jsLibraryMappings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<includedPredefinedLibrary name="Node.js Core" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="FLOW" />
|
||||
</component>
|
||||
</project>
|
||||
2
.idea/watcherTasks.xml
generated
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
|
||||
<component name="ProjectTasksOptions" suppressed-tasks="SCSS;Sass" />
|
||||
</project>
|
||||
21
Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
FROM node:latest AS build
|
||||
WORKDIR /blog
|
||||
COPY package.json /blog/
|
||||
RUN npm install
|
||||
COPY . /blog/
|
||||
RUN npm run build
|
||||
|
||||
FROM docker.io/nginx:trixie
|
||||
RUN useradd tymur999 -u 3000
|
||||
RUN chown tymur999:tymur999 -R /etc/logrotate.d/nginx \
|
||||
/etc/nginx \
|
||||
/etc/init.d/nginx \
|
||||
/usr/lib/nginx \
|
||||
/usr/share/nginx \
|
||||
/var/cache/nginx \
|
||||
/var/log/nginx
|
||||
USER tymur999:tymur999
|
||||
|
||||
COPY --from=build --chown=tymur999:tymur999 /blog/build/ /var/www/html/
|
||||
COPY --link nginx.conf /etc/nginx/
|
||||
EXPOSE 8000
|
||||
51
README.md
@@ -1,46 +1,11 @@
|
||||
# Getting Started with Create React App
|
||||
# Welcome to my [personal website](https://tymur999.com)
|
||||
|
||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
||||
## My name is Tymur Arsentiev, and I'm a SEP Intern at JPMorganChase.
|
||||
I was born in Ukraine, but moved to Chicago when I was 4. I'm studying Computer Science at Georgia Tech, which is in Atlanta.
|
||||
|
||||
## Available Scripts
|
||||
I made this personal website to showcase my skills and serve as my own blog.
|
||||
This website is an ejected create-react-app made with React, Typescript, Sass, MDX, and Three.js.
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm start`
|
||||
|
||||
Runs the app in the development mode.\
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
||||
|
||||
The page will reload if you make edits.\
|
||||
You will also see any lint errors in the console.
|
||||
|
||||
### `npm test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.\
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
||||
|
||||
### `npm run build`
|
||||
|
||||
Builds the app for production to the `build` folder.\
|
||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
||||
|
||||
The build is minified and the filenames include the hashes.\
|
||||
Your app is ready to be deployed!
|
||||
|
||||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
||||
|
||||
### `npm run eject`
|
||||
|
||||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
||||
|
||||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||||
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
||||
|
||||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|
||||
|
||||
## Learn More
|
||||
|
||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
|
||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
||||
There is no backend at all, so all the blog articles are served from a Typescript file.
|
||||
All articles are written in MDX to be compatible with React.
|
||||
Yet another site that proves programmers have their midlife crisis and decide to make their own blog.
|
||||
104
config/env.js
@@ -1,104 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const paths = require('./paths');
|
||||
|
||||
// Make sure that including paths.js after env.js will read .env variables.
|
||||
delete require.cache[require.resolve('./paths')];
|
||||
|
||||
const NODE_ENV = process.env.NODE_ENV;
|
||||
if (!NODE_ENV) {
|
||||
throw new Error(
|
||||
'The NODE_ENV environment variable is required but was not specified.'
|
||||
);
|
||||
}
|
||||
|
||||
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
|
||||
const dotenvFiles = [
|
||||
`${paths.dotenv}.${NODE_ENV}.local`,
|
||||
// Don't include `.env.local` for `test` environment
|
||||
// since normally you expect tests to produce the same
|
||||
// results for everyone
|
||||
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
|
||||
`${paths.dotenv}.${NODE_ENV}`,
|
||||
paths.dotenv,
|
||||
].filter(Boolean);
|
||||
|
||||
// Load environment variables from .env* files. Suppress warnings using silent
|
||||
// if this file is missing. dotenv will never modify any environment variables
|
||||
// that have already been set. Variable expansion is supported in .env files.
|
||||
// https://github.com/motdotla/dotenv
|
||||
// https://github.com/motdotla/dotenv-expand
|
||||
dotenvFiles.forEach(dotenvFile => {
|
||||
if (fs.existsSync(dotenvFile)) {
|
||||
require('dotenv-expand')(
|
||||
require('dotenv').config({
|
||||
path: dotenvFile,
|
||||
})
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// We support resolving modules according to `NODE_PATH`.
|
||||
// This lets you use absolute paths in imports inside large monorepos:
|
||||
// https://github.com/facebook/create-react-app/issues/253.
|
||||
// It works similar to `NODE_PATH` in Node itself:
|
||||
// https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
|
||||
// Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
|
||||
// Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
|
||||
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
|
||||
// We also resolve them to make sure all tools using them work consistently.
|
||||
const appDirectory = fs.realpathSync(process.cwd());
|
||||
process.env.NODE_PATH = (process.env.NODE_PATH || '')
|
||||
.split(path.delimiter)
|
||||
.filter(folder => folder && !path.isAbsolute(folder))
|
||||
.map(folder => path.resolve(appDirectory, folder))
|
||||
.join(path.delimiter);
|
||||
|
||||
// Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
|
||||
// injected into the application via DefinePlugin in webpack configuration.
|
||||
const REACT_APP = /^REACT_APP_/i;
|
||||
|
||||
function getClientEnvironment(publicUrl) {
|
||||
const raw = Object.keys(process.env)
|
||||
.filter(key => REACT_APP.test(key))
|
||||
.reduce(
|
||||
(env, key) => {
|
||||
env[key] = process.env[key];
|
||||
return env;
|
||||
},
|
||||
{
|
||||
// Useful for determining whether we’re running in production mode.
|
||||
// Most importantly, it switches React into the correct mode.
|
||||
NODE_ENV: process.env.NODE_ENV || 'development',
|
||||
// Useful for resolving the correct path to static assets in `public`.
|
||||
// For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
|
||||
// This should only be used as an escape hatch. Normally you would put
|
||||
// images into the `src` and `import` them in code to get their paths.
|
||||
PUBLIC_URL: publicUrl,
|
||||
// We support configuring the sockjs pathname during development.
|
||||
// These settings let a developer run multiple simultaneous projects.
|
||||
// They are used as the connection `hostname`, `pathname` and `port`
|
||||
// in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
|
||||
// and `sockPort` options in webpack-dev-server.
|
||||
WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
|
||||
WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
|
||||
WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
|
||||
// Whether or not react-refresh is enabled.
|
||||
// It is defined here so it is available in the webpackHotDevClient.
|
||||
FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
|
||||
}
|
||||
);
|
||||
// Stringify all values so we can feed into webpack DefinePlugin
|
||||
const stringified = {
|
||||
'process.env': Object.keys(raw).reduce((env, key) => {
|
||||
env[key] = JSON.stringify(raw[key]);
|
||||
return env;
|
||||
}, {}),
|
||||
};
|
||||
|
||||
return { raw, stringified };
|
||||
}
|
||||
|
||||
module.exports = getClientEnvironment;
|
||||
@@ -1,66 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const crypto = require('crypto');
|
||||
const chalk = require('react-dev-utils/chalk');
|
||||
const paths = require('./paths');
|
||||
|
||||
// Ensure the certificate and key provided are valid and if not
|
||||
// throw an easy to debug error
|
||||
function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
|
||||
let encrypted;
|
||||
try {
|
||||
// publicEncrypt will throw an error with an invalid cert
|
||||
encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
// privateDecrypt will throw an error with an invalid key
|
||||
crypto.privateDecrypt(key, encrypted);
|
||||
} catch (err) {
|
||||
throw new Error(
|
||||
`The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
|
||||
err.message
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Read file and throw an error if it doesn't exist
|
||||
function readEnvFile(file, type) {
|
||||
if (!fs.existsSync(file)) {
|
||||
throw new Error(
|
||||
`You specified ${chalk.cyan(
|
||||
type
|
||||
)} in your env, but the file "${chalk.yellow(file)}" can't be found.`
|
||||
);
|
||||
}
|
||||
return fs.readFileSync(file);
|
||||
}
|
||||
|
||||
// Get the https config
|
||||
// Return cert files if provided in env, otherwise just true or false
|
||||
function getHttpsConfig() {
|
||||
const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
|
||||
const isHttps = HTTPS === 'true';
|
||||
|
||||
if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
|
||||
const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
|
||||
const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
|
||||
const config = {
|
||||
cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
|
||||
key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
|
||||
};
|
||||
|
||||
validateKeyAndCerts({ ...config, keyFile, crtFile });
|
||||
return config;
|
||||
}
|
||||
return isHttps;
|
||||
}
|
||||
|
||||
module.exports = getHttpsConfig;
|
||||
@@ -1,29 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const babelJest = require('babel-jest').default;
|
||||
|
||||
const hasJsxRuntime = (() => {
|
||||
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
require.resolve('react/jsx-runtime');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
|
||||
module.exports = babelJest.createTransformer({
|
||||
presets: [
|
||||
[
|
||||
require.resolve('babel-preset-react-app'),
|
||||
{
|
||||
runtime: hasJsxRuntime ? 'automatic' : 'classic',
|
||||
},
|
||||
],
|
||||
],
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
});
|
||||
@@ -1,14 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// This is a custom Jest transformer turning style imports into empty objects.
|
||||
// http://facebook.github.io/jest/docs/en/webpack.html
|
||||
|
||||
module.exports = {
|
||||
process() {
|
||||
return 'module.exports = {};';
|
||||
},
|
||||
getCacheKey() {
|
||||
// The output is always the same.
|
||||
return 'cssTransform';
|
||||
},
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const camelcase = require('camelcase');
|
||||
|
||||
// This is a custom Jest transformer turning file imports into filenames.
|
||||
// http://facebook.github.io/jest/docs/en/webpack.html
|
||||
|
||||
module.exports = {
|
||||
process(src, filename) {
|
||||
const assetFilename = JSON.stringify(path.basename(filename));
|
||||
|
||||
if (filename.match(/\.svg$/)) {
|
||||
// Based on how SVGR generates a component name:
|
||||
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
|
||||
const pascalCaseFilename = camelcase(path.parse(filename).name, {
|
||||
pascalCase: true,
|
||||
});
|
||||
const componentName = `Svg${pascalCaseFilename}`;
|
||||
return `const React = require('react');
|
||||
module.exports = {
|
||||
__esModule: true,
|
||||
default: ${assetFilename},
|
||||
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
|
||||
return {
|
||||
$$typeof: Symbol.for('react.element'),
|
||||
type: 'svg',
|
||||
ref: ref,
|
||||
key: null,
|
||||
props: Object.assign({}, props, {
|
||||
children: ${assetFilename}
|
||||
})
|
||||
};
|
||||
}),
|
||||
};`;
|
||||
}
|
||||
|
||||
return `module.exports = ${assetFilename};`;
|
||||
},
|
||||
};
|
||||
@@ -1,134 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const paths = require('./paths');
|
||||
const chalk = require('react-dev-utils/chalk');
|
||||
const resolve = require('resolve');
|
||||
|
||||
/**
|
||||
* Get additional module paths based on the baseUrl of a compilerOptions object.
|
||||
*
|
||||
* @param {Object} options
|
||||
*/
|
||||
function getAdditionalModulePaths(options = {}) {
|
||||
const baseUrl = options.baseUrl;
|
||||
|
||||
if (!baseUrl) {
|
||||
return '';
|
||||
}
|
||||
|
||||
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
|
||||
|
||||
// We don't need to do anything if `baseUrl` is set to `node_modules`. This is
|
||||
// the default behavior.
|
||||
if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Allow the user set the `baseUrl` to `appSrc`.
|
||||
if (path.relative(paths.appSrc, baseUrlResolved) === '') {
|
||||
return [paths.appSrc];
|
||||
}
|
||||
|
||||
// If the path is equal to the root directory we ignore it here.
|
||||
// We don't want to allow importing from the root directly as source files are
|
||||
// not transpiled outside of `src`. We do allow importing them with the
|
||||
// absolute path (e.g. `src/Components/Button.js`) but we set that up with
|
||||
// an alias.
|
||||
if (path.relative(paths.appPath, baseUrlResolved) === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Otherwise, throw an error.
|
||||
throw new Error(
|
||||
chalk.red.bold(
|
||||
"Your project's `baseUrl` can only be set to `src` or `node_modules`." +
|
||||
' Create React App does not support other values at this time.'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get webpack aliases based on the baseUrl of a compilerOptions object.
|
||||
*
|
||||
* @param {*} options
|
||||
*/
|
||||
function getWebpackAliases(options = {}) {
|
||||
const baseUrl = options.baseUrl;
|
||||
|
||||
if (!baseUrl) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
|
||||
|
||||
if (path.relative(paths.appPath, baseUrlResolved) === '') {
|
||||
return {
|
||||
src: paths.appSrc,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get jest aliases based on the baseUrl of a compilerOptions object.
|
||||
*
|
||||
* @param {*} options
|
||||
*/
|
||||
function getJestAliases(options = {}) {
|
||||
const baseUrl = options.baseUrl;
|
||||
|
||||
if (!baseUrl) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
|
||||
|
||||
if (path.relative(paths.appPath, baseUrlResolved) === '') {
|
||||
return {
|
||||
'^src/(.*)$': '<rootDir>/src/$1',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function getModules() {
|
||||
// Check if TypeScript is setup
|
||||
const hasTsConfig = fs.existsSync(paths.appTsConfig);
|
||||
const hasJsConfig = fs.existsSync(paths.appJsConfig);
|
||||
|
||||
if (hasTsConfig && hasJsConfig) {
|
||||
throw new Error(
|
||||
'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
|
||||
);
|
||||
}
|
||||
|
||||
let config;
|
||||
|
||||
// If there's a tsconfig.json we assume it's a
|
||||
// TypeScript project and set up the config
|
||||
// based on tsconfig.json
|
||||
if (hasTsConfig) {
|
||||
const ts = require(resolve.sync('typescript', {
|
||||
basedir: paths.appNodeModules,
|
||||
}));
|
||||
config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
|
||||
// Otherwise we'll check if there is jsconfig.json
|
||||
// for non TS projects.
|
||||
} else if (hasJsConfig) {
|
||||
config = require(paths.appJsConfig);
|
||||
}
|
||||
|
||||
config = config || {};
|
||||
const options = config.compilerOptions || {};
|
||||
|
||||
const additionalModulePaths = getAdditionalModulePaths(options);
|
||||
|
||||
return {
|
||||
additionalModulePaths: additionalModulePaths,
|
||||
webpackAliases: getWebpackAliases(options),
|
||||
jestAliases: getJestAliases(options),
|
||||
hasTsConfig,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = getModules();
|
||||
@@ -1,77 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
|
||||
|
||||
// Make sure any symlinks in the project folder are resolved:
|
||||
// https://github.com/facebook/create-react-app/issues/637
|
||||
const appDirectory = fs.realpathSync(process.cwd());
|
||||
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
|
||||
|
||||
// We use `PUBLIC_URL` environment variable or "homepage" field to infer
|
||||
// "public path" at which the app is served.
|
||||
// webpack needs to know it to put the right <script> hrefs into HTML even in
|
||||
// single-page apps that may serve index.html for nested URLs like /todos/42.
|
||||
// We can't use a relative path in HTML because we don't want to load something
|
||||
// like /todos/42/static/js/bundle.7289d.js. We have to know the root.
|
||||
const publicUrlOrPath = getPublicUrlOrPath(
|
||||
process.env.NODE_ENV === 'development',
|
||||
require(resolveApp('package.json')).homepage,
|
||||
process.env.PUBLIC_URL
|
||||
);
|
||||
|
||||
const buildPath = process.env.BUILD_PATH || 'build';
|
||||
|
||||
const moduleFileExtensions = [
|
||||
'web.mjs',
|
||||
'mjs',
|
||||
'web.js',
|
||||
'js',
|
||||
'web.ts',
|
||||
'ts',
|
||||
'web.tsx',
|
||||
'tsx',
|
||||
'json',
|
||||
'web.jsx',
|
||||
'jsx',
|
||||
];
|
||||
|
||||
// Resolve file paths in the same order as webpack
|
||||
const resolveModule = (resolveFn, filePath) => {
|
||||
const extension = moduleFileExtensions.find(extension =>
|
||||
fs.existsSync(resolveFn(`${filePath}.${extension}`))
|
||||
);
|
||||
|
||||
if (extension) {
|
||||
return resolveFn(`${filePath}.${extension}`);
|
||||
}
|
||||
|
||||
return resolveFn(`${filePath}.js`);
|
||||
};
|
||||
|
||||
// config after eject: we're in ./config/
|
||||
module.exports = {
|
||||
dotenv: resolveApp('.env'),
|
||||
appPath: resolveApp('.'),
|
||||
appBuild: resolveApp(buildPath),
|
||||
appPublic: resolveApp('public'),
|
||||
appHtml: resolveApp('public/index.html'),
|
||||
appIndexJs: resolveModule(resolveApp, 'src/index'),
|
||||
appPackageJson: resolveApp('package.json'),
|
||||
appSrc: resolveApp('src'),
|
||||
appTsConfig: resolveApp('tsconfig.json'),
|
||||
appJsConfig: resolveApp('jsconfig.json'),
|
||||
yarnLockFile: resolveApp('yarn.lock'),
|
||||
testsSetup: resolveModule(resolveApp, 'src/setupTests'),
|
||||
proxySetup: resolveApp('src/setupProxy.js'),
|
||||
appNodeModules: resolveApp('node_modules'),
|
||||
appWebpackCache: resolveApp('node_modules/.cache'),
|
||||
appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
|
||||
swSrc: resolveModule(resolveApp, 'src/service-worker'),
|
||||
publicUrlOrPath,
|
||||
};
|
||||
|
||||
|
||||
|
||||
module.exports.moduleFileExtensions = moduleFileExtensions;
|
||||
@@ -1,755 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const resolve = require('resolve');
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
||||
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin');
|
||||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
|
||||
const { WebpackManifestPlugin } = require('webpack-manifest-plugin');
|
||||
const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
|
||||
const WorkboxWebpackPlugin = require('workbox-webpack-plugin');
|
||||
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
|
||||
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent');
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
const paths = require('./paths');
|
||||
const modules = require('./modules');
|
||||
const getClientEnvironment = require('./env');
|
||||
const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
|
||||
const ForkTsCheckerWebpackPlugin =
|
||||
process.env.TSC_COMPILE_ON_ERROR === 'true'
|
||||
? require('react-dev-utils/ForkTsCheckerWarningWebpackPlugin')
|
||||
: require('react-dev-utils/ForkTsCheckerWebpackPlugin');
|
||||
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
|
||||
|
||||
const createEnvironmentHash = require('./webpack/persistentCache/createEnvironmentHash');
|
||||
|
||||
// Source maps are resource heavy and can cause out of memory issue for large source files.
|
||||
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
|
||||
|
||||
const reactRefreshRuntimeEntry = require.resolve('react-refresh/runtime');
|
||||
const reactRefreshWebpackPluginRuntimeEntry = require.resolve(
|
||||
'@pmmmwh/react-refresh-webpack-plugin'
|
||||
);
|
||||
const babelRuntimeEntry = require.resolve('babel-preset-react-app');
|
||||
const babelRuntimeEntryHelpers = require.resolve(
|
||||
'@babel/runtime/helpers/esm/assertThisInitialized',
|
||||
{ paths: [babelRuntimeEntry] }
|
||||
);
|
||||
const babelRuntimeRegenerator = require.resolve('@babel/runtime/regenerator', {
|
||||
paths: [babelRuntimeEntry],
|
||||
});
|
||||
|
||||
// Some apps do not need the benefits of saving a web request, so not inlining the chunk
|
||||
// makes for a smoother build process.
|
||||
const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false';
|
||||
|
||||
const emitErrorsAsWarnings = process.env.ESLINT_NO_DEV_ERRORS === 'true';
|
||||
const disableESLintPlugin = process.env.DISABLE_ESLINT_PLUGIN === 'true';
|
||||
|
||||
const imageInlineSizeLimit = parseInt(
|
||||
process.env.IMAGE_INLINE_SIZE_LIMIT || '10000'
|
||||
);
|
||||
|
||||
// Check if TypeScript is setup
|
||||
const useTypeScript = fs.existsSync(paths.appTsConfig);
|
||||
|
||||
// Check if Tailwind config exists
|
||||
const useTailwind = fs.existsSync(
|
||||
path.join(paths.appPath, 'tailwind.config.js')
|
||||
);
|
||||
|
||||
// Get the path to the uncompiled service worker (if it exists).
|
||||
const swSrc = paths.swSrc;
|
||||
|
||||
// style files regexes
|
||||
const cssRegex = /\.css$/;
|
||||
const cssModuleRegex = /\.module\.css$/;
|
||||
const sassRegex = /\.(scss|sass)$/;
|
||||
const sassModuleRegex = /\.module\.(scss|sass)$/;
|
||||
|
||||
const hasJsxRuntime = (() => {
|
||||
if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
require.resolve('react/jsx-runtime');
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
|
||||
// This is the production and development configuration.
|
||||
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
|
||||
module.exports = function (webpackEnv) {
|
||||
const isEnvDevelopment = webpackEnv === 'development';
|
||||
const isEnvProduction = webpackEnv === 'production';
|
||||
|
||||
// Variable used for enabling profiling in Production
|
||||
// passed into alias object. Uses a flag if passed into the build command
|
||||
const isEnvProductionProfile =
|
||||
isEnvProduction && process.argv.includes('--profile');
|
||||
|
||||
// We will provide `paths.publicUrlOrPath` to our app
|
||||
// as %PUBLIC_URL% in `index.html` and `process.env.PUBLIC_URL` in JavaScript.
|
||||
// Omit trailing slash as %PUBLIC_URL%/xyz looks better than %PUBLIC_URL%xyz.
|
||||
// Get environment variables to inject into our app.
|
||||
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
|
||||
|
||||
const shouldUseReactRefresh = env.raw.FAST_REFRESH;
|
||||
|
||||
// common function to get style loaders
|
||||
const getStyleLoaders = (cssOptions, preProcessor) => {
|
||||
const loaders = [
|
||||
isEnvDevelopment && require.resolve('style-loader'),
|
||||
isEnvProduction && {
|
||||
loader: MiniCssExtractPlugin.loader,
|
||||
// css is located in `static/css`, use '../../' to locate index.html folder
|
||||
// in production `paths.publicUrlOrPath` can be a relative path
|
||||
options: paths.publicUrlOrPath.startsWith('.')
|
||||
? { publicPath: '../../' }
|
||||
: {},
|
||||
},
|
||||
{
|
||||
loader: require.resolve('css-loader'),
|
||||
options: cssOptions,
|
||||
},
|
||||
{
|
||||
// Options for PostCSS as we reference these options twice
|
||||
// Adds vendor prefixing based on your specified browser support in
|
||||
// package.json
|
||||
loader: require.resolve('postcss-loader'),
|
||||
options: {
|
||||
postcssOptions: {
|
||||
// Necessary for external CSS imports to work
|
||||
// https://github.com/facebook/create-react-app/issues/2677
|
||||
ident: 'postcss',
|
||||
config: false,
|
||||
plugins: !useTailwind
|
||||
? [
|
||||
'postcss-flexbugs-fixes',
|
||||
[
|
||||
'postcss-preset-env',
|
||||
{
|
||||
autoprefixer: {
|
||||
flexbox: 'no-2009',
|
||||
},
|
||||
stage: 3,
|
||||
},
|
||||
],
|
||||
// Adds PostCSS Normalize as the reset css with default options,
|
||||
// so that it honors browserslist config in package.json
|
||||
// which in turn let's users customize the target behavior as per their needs.
|
||||
'postcss-normalize',
|
||||
]
|
||||
: [
|
||||
'tailwindcss',
|
||||
'postcss-flexbugs-fixes',
|
||||
[
|
||||
'postcss-preset-env',
|
||||
{
|
||||
autoprefixer: {
|
||||
flexbox: 'no-2009',
|
||||
},
|
||||
stage: 3,
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
||||
},
|
||||
},
|
||||
].filter(Boolean);
|
||||
if (preProcessor) {
|
||||
loaders.push(
|
||||
{
|
||||
loader: require.resolve('resolve-url-loader'),
|
||||
options: {
|
||||
sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment,
|
||||
root: paths.appSrc,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: require.resolve(preProcessor),
|
||||
options: {
|
||||
sourceMap: true,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
return loaders;
|
||||
};
|
||||
|
||||
return {
|
||||
target: ['browserslist'],
|
||||
// Webpack noise constrained to errors and warnings
|
||||
stats: 'errors-warnings',
|
||||
mode: isEnvProduction ? 'production' : isEnvDevelopment && 'development',
|
||||
// Stop compilation early in production
|
||||
bail: isEnvProduction,
|
||||
devtool: isEnvProduction
|
||||
? shouldUseSourceMap
|
||||
? 'source-map'
|
||||
: false
|
||||
: isEnvDevelopment && 'cheap-module-source-map',
|
||||
// These are the "entry points" to our application.
|
||||
// This means they will be the "root" imports that are included in JS bundle.
|
||||
entry: paths.appIndexJs,
|
||||
output: {
|
||||
// The build folder.
|
||||
path: paths.appBuild,
|
||||
// Add /* filename */ comments to generated require()s in the output.
|
||||
pathinfo: isEnvDevelopment,
|
||||
// There will be one main bundle, and one file per asynchronous chunk.
|
||||
// In development, it does not produce real files.
|
||||
filename: isEnvProduction
|
||||
? 'static/js/[name].[contenthash:8].js'
|
||||
: isEnvDevelopment && 'static/js/bundle.js',
|
||||
// There are also additional JS chunk files if you use code splitting.
|
||||
chunkFilename: isEnvProduction
|
||||
? 'static/js/[name].[contenthash:8].chunk.js'
|
||||
: isEnvDevelopment && 'static/js/[name].chunk.js',
|
||||
assetModuleFilename: 'static/media/[name].[hash][ext]',
|
||||
// webpack uses `publicPath` to determine where the app is being served from.
|
||||
// It requires a trailing slash, or the file assets will get an incorrect path.
|
||||
// We inferred the "public path" (such as / or /my-project) from homepage.
|
||||
publicPath: paths.publicUrlOrPath,
|
||||
// Point sourcemap entries to original disk location (format as URL on Windows)
|
||||
devtoolModuleFilenameTemplate: isEnvProduction
|
||||
? info =>
|
||||
path
|
||||
.relative(paths.appSrc, info.absoluteResourcePath)
|
||||
.replace(/\\/g, '/')
|
||||
: isEnvDevelopment &&
|
||||
(info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')),
|
||||
},
|
||||
cache: {
|
||||
type: 'filesystem',
|
||||
version: createEnvironmentHash(env.raw),
|
||||
cacheDirectory: paths.appWebpackCache,
|
||||
store: 'pack',
|
||||
buildDependencies: {
|
||||
defaultWebpack: ['webpack/lib/'],
|
||||
config: [__filename],
|
||||
tsconfig: [paths.appTsConfig, paths.appJsConfig].filter(f =>
|
||||
fs.existsSync(f)
|
||||
),
|
||||
},
|
||||
},
|
||||
infrastructureLogging: {
|
||||
level: 'none',
|
||||
},
|
||||
optimization: {
|
||||
minimize: isEnvProduction,
|
||||
minimizer: [
|
||||
// This is only used in production mode
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
parse: {
|
||||
// We want terser to parse ecma 8 code. However, we don't want it
|
||||
// to apply any minification steps that turns valid ecma 5 code
|
||||
// into invalid ecma 5 code. This is why the 'compress' and 'output'
|
||||
// sections only apply transformations that are ecma 5 safe
|
||||
// https://github.com/facebook/create-react-app/pull/4234
|
||||
ecma: 8,
|
||||
},
|
||||
compress: {
|
||||
ecma: 5,
|
||||
warnings: false,
|
||||
// Disabled because of an issue with Uglify breaking seemingly valid code:
|
||||
// https://github.com/facebook/create-react-app/issues/2376
|
||||
// Pending further investigation:
|
||||
// https://github.com/mishoo/UglifyJS2/issues/2011
|
||||
comparisons: false,
|
||||
// Disabled because of an issue with Terser breaking valid code:
|
||||
// https://github.com/facebook/create-react-app/issues/5250
|
||||
// Pending further investigation:
|
||||
// https://github.com/terser-js/terser/issues/120
|
||||
inline: 2,
|
||||
},
|
||||
mangle: {
|
||||
safari10: true,
|
||||
},
|
||||
// Added for profiling in devtools
|
||||
keep_classnames: isEnvProductionProfile,
|
||||
keep_fnames: isEnvProductionProfile,
|
||||
output: {
|
||||
ecma: 5,
|
||||
comments: false,
|
||||
// Turned on because emoji and regex is not minified properly using default
|
||||
// https://github.com/facebook/create-react-app/issues/2488
|
||||
ascii_only: true,
|
||||
},
|
||||
},
|
||||
}),
|
||||
// This is only used in production mode
|
||||
new CssMinimizerPlugin(),
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
// This allows you to set a fallback for where webpack should look for modules.
|
||||
// We placed these paths second because we want `node_modules` to "win"
|
||||
// if there are any conflicts. This matches Node resolution mechanism.
|
||||
// https://github.com/facebook/create-react-app/issues/253
|
||||
modules: ['node_modules', paths.appNodeModules].concat(
|
||||
modules.additionalModulePaths || []
|
||||
),
|
||||
// These are the reasonable defaults supported by the Node ecosystem.
|
||||
// We also include JSX as a common component filename extension to support
|
||||
// some tools, although we do not recommend using it, see:
|
||||
// https://github.com/facebook/create-react-app/issues/290
|
||||
// `web` extension prefixes have been added for better support
|
||||
// for React Native Web.
|
||||
extensions: paths.moduleFileExtensions
|
||||
.map(ext => `.${ext}`)
|
||||
.filter(ext => useTypeScript || !ext.includes('ts')),
|
||||
alias: {
|
||||
// Support React Native Web
|
||||
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
|
||||
'react-native': 'react-native-web',
|
||||
// Allows for better profiling with ReactDevTools
|
||||
...(isEnvProductionProfile && {
|
||||
'react-dom$': 'react-dom/profiling',
|
||||
'scheduler/tracing': 'scheduler/tracing-profiling',
|
||||
}),
|
||||
...(modules.webpackAliases || {}),
|
||||
},
|
||||
plugins: [
|
||||
// Prevents users from importing files from outside of src/ (or node_modules/).
|
||||
// This often causes confusion because we only process files within src/ with babel.
|
||||
// To fix this, we prevent you from importing files out of src/ -- if you'd like to,
|
||||
// please link the files into your node_modules/ and let module-resolution kick in.
|
||||
// Make sure your source files are compiled, as they will not be processed in any way.
|
||||
new ModuleScopePlugin(paths.appSrc, [
|
||||
paths.appPackageJson,
|
||||
reactRefreshRuntimeEntry,
|
||||
reactRefreshWebpackPluginRuntimeEntry,
|
||||
babelRuntimeEntry,
|
||||
babelRuntimeEntryHelpers,
|
||||
babelRuntimeRegenerator,
|
||||
]),
|
||||
],
|
||||
},
|
||||
module: {
|
||||
strictExportPresence: true,
|
||||
rules: [
|
||||
// Handle node_modules packages that contain sourcemaps
|
||||
shouldUseSourceMap && {
|
||||
enforce: 'pre',
|
||||
exclude: /@babel(?:\/|\\{1,2})runtime/,
|
||||
test: /\.(js|mjs|jsx|ts|tsx|css)$/,
|
||||
loader: require.resolve('source-map-loader'),
|
||||
},
|
||||
{
|
||||
// "oneOf" will traverse all following loaders until one will
|
||||
// match the requirements. When no loader matches it will fall
|
||||
// back to the "file" loader at the end of the loader list.
|
||||
oneOf: [
|
||||
// TODO: Merge this config once `image/avif` is in the mime-db
|
||||
// https://github.com/jshttp/mime-db
|
||||
{
|
||||
test: [/\.avif$/],
|
||||
type: 'asset',
|
||||
mimetype: 'image/avif',
|
||||
parser: {
|
||||
dataUrlCondition: {
|
||||
maxSize: imageInlineSizeLimit,
|
||||
},
|
||||
},
|
||||
},
|
||||
// "url" loader works like "file" loader except that it embeds assets
|
||||
// smaller than specified limit in bytes as data URLs to avoid requests.
|
||||
// A missing `test` is equivalent to a match.
|
||||
{
|
||||
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
|
||||
type: 'asset',
|
||||
parser: {
|
||||
dataUrlCondition: {
|
||||
maxSize: imageInlineSizeLimit,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
use: [
|
||||
{
|
||||
loader: require.resolve('@svgr/webpack'),
|
||||
options: {
|
||||
prettier: false,
|
||||
svgo: false,
|
||||
svgoConfig: {
|
||||
plugins: [{ removeViewBox: false }],
|
||||
},
|
||||
titleProp: true,
|
||||
ref: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: require.resolve('file-loader'),
|
||||
options: {
|
||||
name: 'static/media/[name].[hash].[ext]',
|
||||
},
|
||||
},
|
||||
],
|
||||
issuer: {
|
||||
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
|
||||
},
|
||||
},
|
||||
// Process application JS with Babel.
|
||||
// The preset includes JSX, Flow, TypeScript, and some ESnext features.
|
||||
{
|
||||
test: /\.(js|mjs|jsx|ts|tsx)$/,
|
||||
include: paths.appSrc,
|
||||
loader: require.resolve('babel-loader'),
|
||||
options: {
|
||||
customize: require.resolve(
|
||||
'babel-preset-react-app/webpack-overrides'
|
||||
),
|
||||
presets: [
|
||||
[
|
||||
require.resolve('babel-preset-react-app'),
|
||||
{
|
||||
runtime: hasJsxRuntime ? 'automatic' : 'classic',
|
||||
},
|
||||
],
|
||||
],
|
||||
|
||||
plugins: [
|
||||
isEnvDevelopment &&
|
||||
shouldUseReactRefresh &&
|
||||
require.resolve('react-refresh/babel'),
|
||||
].filter(Boolean),
|
||||
// This is a feature of `babel-loader` for webpack (not Babel itself).
|
||||
// It enables caching results in ./node_modules/.cache/babel-loader/
|
||||
// directory for faster rebuilds.
|
||||
cacheDirectory: true,
|
||||
// See #6846 for context on why cacheCompression is disabled
|
||||
cacheCompression: false,
|
||||
compact: isEnvProduction,
|
||||
},
|
||||
},
|
||||
// Process any JS outside of the app with Babel.
|
||||
// Unlike the application JS, we only compile the standard ES features.
|
||||
{
|
||||
test: /\.(js|mjs)$/,
|
||||
exclude: /@babel(?:\/|\\{1,2})runtime/,
|
||||
loader: require.resolve('babel-loader'),
|
||||
options: {
|
||||
babelrc: false,
|
||||
configFile: false,
|
||||
compact: false,
|
||||
presets: [
|
||||
[
|
||||
require.resolve('babel-preset-react-app/dependencies'),
|
||||
{ helpers: true },
|
||||
],
|
||||
],
|
||||
cacheDirectory: true,
|
||||
// See #6846 for context on why cacheCompression is disabled
|
||||
cacheCompression: false,
|
||||
|
||||
// Babel sourcemaps are needed for debugging into node_modules
|
||||
// code. Without the options below, debuggers like VSCode
|
||||
// show incorrect code and set breakpoints on the wrong lines.
|
||||
sourceMaps: shouldUseSourceMap,
|
||||
inputSourceMap: shouldUseSourceMap,
|
||||
},
|
||||
},
|
||||
// "postcss" loader applies autoprefixer to our CSS.
|
||||
// "css" loader resolves paths in CSS and adds assets as dependencies.
|
||||
// "style" loader turns CSS into JS modules that inject <style> tags.
|
||||
// In production, we use MiniCSSExtractPlugin to extract that CSS
|
||||
// to a file, but in development "style" loader enables hot editing
|
||||
// of CSS.
|
||||
// By default we support CSS Modules with the extension .module.css
|
||||
{
|
||||
test: cssRegex,
|
||||
exclude: cssModuleRegex,
|
||||
use: getStyleLoaders({
|
||||
importLoaders: 1,
|
||||
sourceMap: isEnvProduction
|
||||
? shouldUseSourceMap
|
||||
: isEnvDevelopment,
|
||||
modules: {
|
||||
mode: 'icss',
|
||||
},
|
||||
}),
|
||||
// Don't consider CSS imports dead code even if the
|
||||
// containing package claims to have no side effects.
|
||||
// Remove this when webpack adds a warning or an error for this.
|
||||
// See https://github.com/webpack/webpack/issues/6571
|
||||
sideEffects: true,
|
||||
},
|
||||
// Adds support for CSS Modules (https://github.com/css-modules/css-modules)
|
||||
// using the extension .module.css
|
||||
{
|
||||
test: cssModuleRegex,
|
||||
use: getStyleLoaders({
|
||||
importLoaders: 1,
|
||||
sourceMap: isEnvProduction
|
||||
? shouldUseSourceMap
|
||||
: isEnvDevelopment,
|
||||
modules: {
|
||||
mode: 'local',
|
||||
getLocalIdent: getCSSModuleLocalIdent,
|
||||
},
|
||||
}),
|
||||
},
|
||||
// Opt-in support for SASS (using .scss or .sass extensions).
|
||||
// By default we support SASS Modules with the
|
||||
// extensions .module.scss or .module.sass
|
||||
{
|
||||
test: sassRegex,
|
||||
exclude: sassModuleRegex,
|
||||
use: getStyleLoaders(
|
||||
{
|
||||
importLoaders: 3,
|
||||
sourceMap: isEnvProduction
|
||||
? shouldUseSourceMap
|
||||
: isEnvDevelopment,
|
||||
modules: {
|
||||
mode: 'icss',
|
||||
},
|
||||
},
|
||||
'sass-loader'
|
||||
),
|
||||
// Don't consider CSS imports dead code even if the
|
||||
// containing package claims to have no side effects.
|
||||
// Remove this when webpack adds a warning or an error for this.
|
||||
// See https://github.com/webpack/webpack/issues/6571
|
||||
sideEffects: true,
|
||||
},
|
||||
// Adds support for CSS Modules, but using SASS
|
||||
// using the extension .module.scss or .module.sass
|
||||
{
|
||||
test: sassModuleRegex,
|
||||
use: getStyleLoaders(
|
||||
{
|
||||
importLoaders: 3,
|
||||
sourceMap: isEnvProduction
|
||||
? shouldUseSourceMap
|
||||
: isEnvDevelopment,
|
||||
modules: {
|
||||
mode: 'local',
|
||||
getLocalIdent: getCSSModuleLocalIdent,
|
||||
},
|
||||
},
|
||||
'sass-loader'
|
||||
),
|
||||
},
|
||||
// "file" loader makes sure those assets get served by WebpackDevServer.
|
||||
// When you `import` an asset, you get its (virtual) filename.
|
||||
// In production, they would get copied to the `build` folder.
|
||||
// This loader doesn't use a "test" so it will catch all modules
|
||||
// that fall through the other loaders.
|
||||
{
|
||||
// Exclude `js` files to keep "css" loader working as it injects
|
||||
// its runtime that would otherwise be processed through "file" loader.
|
||||
// Also exclude `html` and `json` extensions so they get processed
|
||||
// by webpacks internal loaders.
|
||||
exclude: [/^$/, /\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
|
||||
type: 'asset/resource',
|
||||
},
|
||||
// ** STOP ** Are you adding a new loader?
|
||||
// Make sure to add the new loader(s) before the "file" loader.
|
||||
],
|
||||
},
|
||||
].filter(Boolean),
|
||||
},
|
||||
plugins: [
|
||||
// Generates an `index.html` file with the <script> injected.
|
||||
new HtmlWebpackPlugin(
|
||||
Object.assign(
|
||||
{},
|
||||
{
|
||||
inject: true,
|
||||
template: paths.appHtml,
|
||||
},
|
||||
isEnvProduction
|
||||
? {
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeRedundantAttributes: true,
|
||||
useShortDoctype: true,
|
||||
removeEmptyAttributes: true,
|
||||
removeStyleLinkTypeAttributes: true,
|
||||
keepClosingSlash: true,
|
||||
minifyJS: true,
|
||||
minifyCSS: true,
|
||||
minifyURLs: true,
|
||||
},
|
||||
}
|
||||
: undefined
|
||||
)
|
||||
),
|
||||
// Inlines the webpack runtime script. This script is too small to warrant
|
||||
// a network request.
|
||||
// https://github.com/facebook/create-react-app/issues/5358
|
||||
isEnvProduction &&
|
||||
shouldInlineRuntimeChunk &&
|
||||
new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime-.+[.]js/]),
|
||||
// Makes some environment variables available in index.html.
|
||||
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
|
||||
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
// It will be an empty string unless you specify "homepage"
|
||||
// in `package.json`, in which case it will be the pathname of that URL.
|
||||
new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw),
|
||||
// This gives some necessary context to module not found errors, such as
|
||||
// the requesting resource.
|
||||
new ModuleNotFoundPlugin(paths.appPath),
|
||||
// Makes some environment variables available to the JS code, for example:
|
||||
// if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`.
|
||||
// It is absolutely essential that NODE_ENV is set to production
|
||||
// during a production build.
|
||||
// Otherwise React will be compiled in the very slow development mode.
|
||||
new webpack.DefinePlugin(env.stringified),
|
||||
// Experimental hot reloading for React .
|
||||
// https://github.com/facebook/react/tree/main/packages/react-refresh
|
||||
isEnvDevelopment &&
|
||||
shouldUseReactRefresh &&
|
||||
new ReactRefreshWebpackPlugin({
|
||||
overlay: false,
|
||||
}),
|
||||
// Watcher doesn't work well if you mistype casing in a path so we use
|
||||
// a plugin that prints an error when you attempt to do this.
|
||||
// See https://github.com/facebook/create-react-app/issues/240
|
||||
isEnvDevelopment && new CaseSensitivePathsPlugin(),
|
||||
isEnvProduction &&
|
||||
new MiniCssExtractPlugin({
|
||||
// Options similar to the same options in webpackOptions.output
|
||||
// both options are optional
|
||||
filename: 'static/css/[name].[contenthash:8].css',
|
||||
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css',
|
||||
}),
|
||||
// Generate an asset manifest file with the following content:
|
||||
// - "files" key: Mapping of all asset filenames to their corresponding
|
||||
// output file so that tools can pick it up without having to parse
|
||||
// `index.html`
|
||||
// - "entrypoints" key: Array of files which are included in `index.html`,
|
||||
// can be used to reconstruct the HTML if necessary
|
||||
new WebpackManifestPlugin({
|
||||
fileName: 'asset-manifest.json',
|
||||
publicPath: paths.publicUrlOrPath,
|
||||
generate: (seed, files, entrypoints) => {
|
||||
const manifestFiles = files.reduce((manifest, file) => {
|
||||
manifest[file.name] = file.path;
|
||||
return manifest;
|
||||
}, seed);
|
||||
const entrypointFiles = entrypoints.main.filter(
|
||||
fileName => !fileName.endsWith('.map')
|
||||
);
|
||||
|
||||
return {
|
||||
files: manifestFiles,
|
||||
entrypoints: entrypointFiles,
|
||||
};
|
||||
},
|
||||
}),
|
||||
// Moment.js is an extremely popular library that bundles large locale files
|
||||
// by default due to how webpack interprets its code. This is a practical
|
||||
// solution that requires the user to opt into importing specific locales.
|
||||
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
|
||||
// You can remove this if you don't use Moment.js:
|
||||
new webpack.IgnorePlugin({
|
||||
resourceRegExp: /^\.\/locale$/,
|
||||
contextRegExp: /moment$/,
|
||||
}),
|
||||
// Generate a service worker script that will precache, and keep up to date,
|
||||
// the HTML & assets that are part of the webpack build.
|
||||
isEnvProduction &&
|
||||
fs.existsSync(swSrc) &&
|
||||
new WorkboxWebpackPlugin.InjectManifest({
|
||||
swSrc,
|
||||
dontCacheBustURLsMatching: /\.[0-9a-f]{8}\./,
|
||||
exclude: [/\.map$/, /asset-manifest\.json$/, /LICENSE/],
|
||||
// Bump up the default maximum size (2mb) that's precached,
|
||||
// to make lazy-loading failure scenarios less likely.
|
||||
// See https://github.com/cra-template/pwa/issues/13#issuecomment-722667270
|
||||
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
|
||||
}),
|
||||
// TypeScript type checking
|
||||
useTypeScript &&
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
async: isEnvDevelopment,
|
||||
typescript: {
|
||||
typescriptPath: resolve.sync('typescript', {
|
||||
basedir: paths.appNodeModules,
|
||||
}),
|
||||
configOverwrite: {
|
||||
compilerOptions: {
|
||||
sourceMap: isEnvProduction
|
||||
? shouldUseSourceMap
|
||||
: isEnvDevelopment,
|
||||
skipLibCheck: true,
|
||||
inlineSourceMap: false,
|
||||
declarationMap: false,
|
||||
noEmit: true,
|
||||
incremental: true,
|
||||
tsBuildInfoFile: paths.appTsBuildInfoFile,
|
||||
},
|
||||
},
|
||||
context: paths.appPath,
|
||||
diagnosticOptions: {
|
||||
syntactic: true,
|
||||
},
|
||||
mode: 'write-references',
|
||||
// profile: true,
|
||||
},
|
||||
issue: {
|
||||
// This one is specifically to match during CI tests,
|
||||
// as micromatch doesn't match
|
||||
// '../cra-template-typescript/template/src/App.tsx'
|
||||
// otherwise.
|
||||
include: [
|
||||
{ file: '../**/src/**/*.{ts,tsx}' },
|
||||
{ file: '**/src/**/*.{ts,tsx}' },
|
||||
],
|
||||
exclude: [
|
||||
{ file: '**/src/**/__tests__/**' },
|
||||
{ file: '**/src/**/?(*.){spec|test}.*' },
|
||||
{ file: '**/src/setupProxy.*' },
|
||||
{ file: '**/src/setupTests.*' },
|
||||
],
|
||||
},
|
||||
logger: {
|
||||
infrastructure: 'silent',
|
||||
},
|
||||
}),
|
||||
!disableESLintPlugin &&
|
||||
new ESLintPlugin({
|
||||
// Plugin options
|
||||
extensions: ['js', 'mjs', 'jsx', 'ts', 'tsx'],
|
||||
formatter: require.resolve('react-dev-utils/eslintFormatter'),
|
||||
eslintPath: require.resolve('eslint'),
|
||||
failOnError: !(isEnvDevelopment && emitErrorsAsWarnings),
|
||||
context: paths.appSrc,
|
||||
cache: true,
|
||||
cacheLocation: path.resolve(
|
||||
paths.appNodeModules,
|
||||
'.cache/.eslintcache'
|
||||
),
|
||||
// ESLint class options
|
||||
cwd: paths.appPath,
|
||||
resolvePluginsRelativeTo: __dirname,
|
||||
baseConfig: {
|
||||
extends: [require.resolve('eslint-config-react-app/base')],
|
||||
rules: {
|
||||
...(!hasJsxRuntime && {
|
||||
'react/react-in-jsx-scope': 'error',
|
||||
}),
|
||||
},
|
||||
},
|
||||
}),
|
||||
].filter(Boolean),
|
||||
// Turn off performance processing because we utilize
|
||||
// our own hints via the FileSizeReporter
|
||||
performance: false,
|
||||
};
|
||||
};
|
||||
@@ -1,9 +0,0 @@
|
||||
'use strict';
|
||||
const { createHash } = require('crypto');
|
||||
|
||||
module.exports = env => {
|
||||
const hash = createHash('md5');
|
||||
hash.update(JSON.stringify(env));
|
||||
|
||||
return hash.digest('hex');
|
||||
};
|
||||
@@ -1,127 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware');
|
||||
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware');
|
||||
const ignoredFiles = require('react-dev-utils/ignoredFiles');
|
||||
const redirectServedPath = require('react-dev-utils/redirectServedPathMiddleware');
|
||||
const paths = require('./paths');
|
||||
const getHttpsConfig = require('./getHttpsConfig');
|
||||
|
||||
const host = process.env.HOST || '0.0.0.0';
|
||||
const sockHost = process.env.WDS_SOCKET_HOST;
|
||||
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
|
||||
const sockPort = process.env.WDS_SOCKET_PORT;
|
||||
|
||||
module.exports = function (proxy, allowedHost) {
|
||||
const disableFirewall =
|
||||
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
|
||||
return {
|
||||
// WebpackDevServer 2.4.3 introduced a security fix that prevents remote
|
||||
// websites from potentially accessing local content through DNS rebinding:
|
||||
// https://github.com/webpack/webpack-dev-server/issues/887
|
||||
// https://medium.com/webpack/webpack-dev-server-middleware-security-issues-1489d950874a
|
||||
// However, it made several existing use cases such as development in cloud
|
||||
// environment or subdomains in development significantly more complicated:
|
||||
// https://github.com/facebook/create-react-app/issues/2271
|
||||
// https://github.com/facebook/create-react-app/issues/2233
|
||||
// While we're investigating better solutions, for now we will take a
|
||||
// compromise. Since our WDS configuration only serves files in the `public`
|
||||
// folder we won't consider accessing them a vulnerability. However, if you
|
||||
// use the `proxy` feature, it gets more dangerous because it can expose
|
||||
// remote code execution vulnerabilities in backends like Django and Rails.
|
||||
// So we will disable the host check normally, but enable it if you have
|
||||
// specified the `proxy` setting. Finally, we let you override it if you
|
||||
// really know what you're doing with a special environment variable.
|
||||
// Note: ["localhost", ".localhost"] will support subdomains - but we might
|
||||
// want to allow setting the allowedHosts manually for more complex setups
|
||||
allowedHosts: disableFirewall ? 'all' : [allowedHost],
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': '*',
|
||||
'Access-Control-Allow-Headers': '*',
|
||||
},
|
||||
// Enable gzip compression of generated files.
|
||||
compress: true,
|
||||
static: {
|
||||
// By default WebpackDevServer serves physical files from current directory
|
||||
// in addition to all the virtual build products that it serves from memory.
|
||||
// This is confusing because those files won’t automatically be available in
|
||||
// production build folder unless we copy them. However, copying the whole
|
||||
// project directory is dangerous because we may expose sensitive files.
|
||||
// Instead, we establish a convention that only files in `public` directory
|
||||
// get served. Our build script will copy `public` into the `build` folder.
|
||||
// In `index.html`, you can get URL of `public` folder with %PUBLIC_URL%:
|
||||
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
// In JavaScript code, you can access it with `process.env.PUBLIC_URL`.
|
||||
// Note that we only recommend to use `public` folder as an escape hatch
|
||||
// for files like `favicon.ico`, `manifest.json`, and libraries that are
|
||||
// for some reason broken when imported through webpack. If you just want to
|
||||
// use an image, put it in `src` and `import` it from JavaScript instead.
|
||||
directory: paths.appPublic,
|
||||
publicPath: [paths.publicUrlOrPath],
|
||||
// By default files from `contentBase` will not trigger a page reload.
|
||||
watch: {
|
||||
// Reportedly, this avoids CPU overload on some systems.
|
||||
// https://github.com/facebook/create-react-app/issues/293
|
||||
// src/node_modules is not ignored to support absolute imports
|
||||
// https://github.com/facebook/create-react-app/issues/1065
|
||||
ignored: ignoredFiles(paths.appSrc),
|
||||
},
|
||||
},
|
||||
client: {
|
||||
webSocketURL: {
|
||||
// Enable custom sockjs pathname for websocket connection to hot reloading server.
|
||||
// Enable custom sockjs hostname, pathname and port for websocket connection
|
||||
// to hot reloading server.
|
||||
hostname: sockHost,
|
||||
pathname: sockPath,
|
||||
port: sockPort,
|
||||
},
|
||||
overlay: {
|
||||
errors: true,
|
||||
warnings: false,
|
||||
},
|
||||
},
|
||||
devMiddleware: {
|
||||
// It is important to tell WebpackDevServer to use the same "publicPath" path as
|
||||
// we specified in the webpack config. When homepage is '.', default to serving
|
||||
// from the root.
|
||||
// remove last slash so user can land on `/test` instead of `/test/`
|
||||
publicPath: paths.publicUrlOrPath.slice(0, -1),
|
||||
},
|
||||
|
||||
https: getHttpsConfig(),
|
||||
host,
|
||||
historyApiFallback: {
|
||||
// Paths with dots should still use the history fallback.
|
||||
// See https://github.com/facebook/create-react-app/issues/387.
|
||||
disableDotRule: true,
|
||||
index: paths.publicUrlOrPath,
|
||||
},
|
||||
// `proxy` is run between `before` and `after` `webpack-dev-server` hooks
|
||||
proxy,
|
||||
onBeforeSetupMiddleware(devServer) {
|
||||
// Keep `evalSourceMapMiddleware`
|
||||
// middlewares before `redirectServedPath` otherwise will not have any effect
|
||||
// This lets us fetch source contents from webpack for the error overlay
|
||||
devServer.app.use(evalSourceMapMiddleware(devServer));
|
||||
|
||||
if (fs.existsSync(paths.proxySetup)) {
|
||||
// This registers user provided middleware for proxy reasons
|
||||
require(paths.proxySetup)(devServer.app);
|
||||
}
|
||||
},
|
||||
onAfterSetupMiddleware(devServer) {
|
||||
// Redirect to `PUBLIC_URL` or `homepage` from `package.json` if url not match
|
||||
devServer.app.use(redirectServedPath(paths.publicUrlOrPath));
|
||||
|
||||
// This service worker file is effectively a 'no-op' that will reset any
|
||||
// previous service worker registered for the same host:port combination.
|
||||
// We do this in development to avoid hitting the production cache if
|
||||
// it used the same host and port.
|
||||
// https://github.com/facebook/create-react-app/issues/2272#issuecomment-302832432
|
||||
devServer.app.use(noopServiceWorkerMiddleware(paths.publicUrlOrPath));
|
||||
},
|
||||
};
|
||||
};
|
||||
56
k8s.yaml
Normal file
@@ -0,0 +1,56 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata: &metadata
|
||||
name: blog
|
||||
labels: &label
|
||||
app: blog
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: *label
|
||||
template:
|
||||
metadata: *metadata
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: gitea.tymur999.com/tymur999/blog:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: http
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: blog
|
||||
labels: &labels
|
||||
app: blog
|
||||
spec:
|
||||
selector: *labels
|
||||
ports:
|
||||
- port: 8000
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
name: http
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: blog
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
tls:
|
||||
- hosts:
|
||||
- tymur999.com
|
||||
rules:
|
||||
- host: tymur999.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: blog
|
||||
port:
|
||||
name: http
|
||||
@@ -1,81 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: blog-nginx
|
||||
data:
|
||||
nginx.conf: |
|
||||
worker_processes auto;
|
||||
pid /tmp/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
# Prevent nginx HTTP Server Detection
|
||||
server_tokens off;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
server_name tymur999.com;
|
||||
listen 8000;
|
||||
|
||||
# set max upload size and increase upload timeout:
|
||||
client_max_body_size 10G;
|
||||
client_body_timeout 300s;
|
||||
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_comp_level 4;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
|
||||
gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
|
||||
|
||||
# HTTP response headers borrowed from Nextcloud `.htaccess`
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
|
||||
# Path to the root of your installation
|
||||
root /var/www/html;
|
||||
index index.html;
|
||||
|
||||
location = /robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Serve static files
|
||||
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
|
||||
try_files $uri /index.php$request_uri;
|
||||
add_header Cache-Control "public, max-age=15778463";
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
}
|
||||
|
||||
location ~ \.(otf|woff2?)$ {
|
||||
try_files $uri /index.php$request_uri;
|
||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php$request_uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata: &meta
|
||||
name: blog
|
||||
labels: &labels
|
||||
app: blog
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: *labels
|
||||
template:
|
||||
metadata: *meta
|
||||
spec:
|
||||
restartPolicy: Always
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
protocol: TCP
|
||||
name: http
|
||||
volumeMounts:
|
||||
- mountPath: /var/www/html
|
||||
name: html
|
||||
readOnly: true
|
||||
- mountPath: /etc/nginx/nginx.conf
|
||||
name: nginx-conf
|
||||
subPath: nginx.conf
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: html
|
||||
persistentVolumeClaim:
|
||||
claimName: blog-html
|
||||
- name: nginx-conf
|
||||
configMap:
|
||||
name: blog-nginx
|
||||
items:
|
||||
- key: nginx.conf
|
||||
path: nginx.conf
|
||||
@@ -1,22 +0,0 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: blog
|
||||
labels:
|
||||
app: blog
|
||||
spec:
|
||||
ingressClassName: traefik
|
||||
tls:
|
||||
- hosts:
|
||||
- tymur999.com
|
||||
rules:
|
||||
- host: tymur999.com
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: blog
|
||||
port:
|
||||
name: http
|
||||
@@ -1,11 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: blog-html
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1T
|
||||
volumeName: blog-html
|
||||
@@ -1,13 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: blog
|
||||
labels: &labels
|
||||
app: blog
|
||||
spec:
|
||||
ports:
|
||||
- port: 80
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
name: http
|
||||
selector: *labels
|
||||
@@ -1,21 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: blog-html
|
||||
spec:
|
||||
capacity:
|
||||
storage: 1T
|
||||
volumeMode: Filesystem
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Delete
|
||||
local:
|
||||
path: /hdd/blog
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- tymur999srv
|
||||
82
nginx.conf
Normal file
@@ -0,0 +1,82 @@
|
||||
worker_processes auto;
|
||||
pid /tmp/nginx.pid;
|
||||
user tymur999;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
# Prevent nginx HTTP Server Detection
|
||||
server_tokens off;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
server {
|
||||
server_name tymur999.com;
|
||||
listen 8000;
|
||||
|
||||
# set max upload size and increase upload timeout:
|
||||
client_max_body_size 10G;
|
||||
client_body_timeout 300s;
|
||||
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_comp_level 4;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied expired no-cache no-store private no_last_modified no_etag auth;
|
||||
gzip_types application/atom+xml text/javascript application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy;
|
||||
|
||||
# HTTP response headers borrowed from Nextcloud `.htaccess`
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
|
||||
# Path to the root of your installation
|
||||
root /var/www/html;
|
||||
index index.html;
|
||||
|
||||
location = /robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Serve static files
|
||||
location ~ \.(?:css|js|mjs|svg|gif|ico|jpg|png|webp|wasm|tflite|map|ogg|flac)$ {
|
||||
try_files $uri @index;
|
||||
add_header Cache-Control "public, max-age=15778463";
|
||||
add_header Referrer-Policy "no-referrer" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "SAMEORIGIN" always;
|
||||
add_header X-Permitted-Cross-Domain-Policies "none" always;
|
||||
add_header X-Robots-Tag "noindex, nofollow" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
}
|
||||
|
||||
location ~ \.(otf|woff2?)$ {
|
||||
try_files $uri @index;
|
||||
expires 7d; # Cache-Control policy borrowed from `.htaccess`
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri @index;
|
||||
}
|
||||
|
||||
location @index {
|
||||
add_header Cache-Control no-cache;
|
||||
expires 0;
|
||||
try_files /index.html =404;
|
||||
}
|
||||
}
|
||||
}
|
||||
14953
package-lock.json
generated
164
package.json
@@ -3,7 +3,6 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.0",
|
||||
"@fontsource/inter": "^5.2.8",
|
||||
"@fontsource/neuton": "^5.2.7",
|
||||
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
||||
@@ -11,77 +10,19 @@
|
||||
"@fortawesome/free-regular-svg-icons": "^7.2.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
||||
"@fortawesome/react-fontawesome": "^3.2.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
||||
"@react-three/drei": "^10.7.7",
|
||||
"@react-three/fiber": "^9.5.0",
|
||||
"@svgr/webpack": "^5.5.0",
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^16.18.126",
|
||||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"babel-jest": "^27.4.2",
|
||||
"babel-loader": "^8.2.3",
|
||||
"babel-plugin-named-asset-import": "^0.3.8",
|
||||
"babel-preset-react-app": "^10.0.1",
|
||||
"bfj": "^7.0.2",
|
||||
"browserslist": "^4.18.1",
|
||||
"camelcase": "^6.2.1",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
||||
"css-loader": "^6.5.1",
|
||||
"css-minimizer-webpack-plugin": "^3.2.0",
|
||||
"dotenv": "^10.0.0",
|
||||
"dotenv-expand": "^5.1.0",
|
||||
"eslint": "^8.3.0",
|
||||
"eslint-config-react-app": "^7.0.1",
|
||||
"eslint-webpack-plugin": "^3.1.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"html-webpack-plugin": "^5.5.0",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest": "^27.4.3",
|
||||
"jest-resolve": "^27.4.2",
|
||||
"jest-watch-typeahead": "^1.0.0",
|
||||
"mini-css-extract-plugin": "^2.4.5",
|
||||
"@react-three/postprocessing": "^3.0.4",
|
||||
"motion": "^12.34.3",
|
||||
"postcss": "^8.4.4",
|
||||
"postcss-flexbugs-fixes": "^5.0.2",
|
||||
"postcss-loader": "^6.2.1",
|
||||
"postcss-normalize": "^10.0.1",
|
||||
"postcss-preset-env": "^7.0.1",
|
||||
"prompts": "^2.4.2",
|
||||
"react": "^19.2.4",
|
||||
"react-app-polyfill": "^3.0.0",
|
||||
"react-dev-utils": "^12.0.1",
|
||||
"react-dom": "^19.2.4",
|
||||
"react-refresh": "^0.11.0",
|
||||
"resolve": "^1.20.0",
|
||||
"resolve-url-loader": "^4.0.0",
|
||||
"sass-loader": "^12.3.0",
|
||||
"semver": "^7.3.5",
|
||||
"source-map-loader": "^3.0.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"tailwindcss": "^3.0.2",
|
||||
"terser-webpack-plugin": "^5.2.5",
|
||||
"three": "^0.183.2",
|
||||
"web-vitals": "^2.1.4",
|
||||
"webpack": "^5.64.4",
|
||||
"webpack-dev-server": "^4.6.0",
|
||||
"webpack-manifest-plugin": "^4.0.2",
|
||||
"workbox-webpack-plugin": "^6.4.1"
|
||||
"three": "^0.183.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node scripts/start.js",
|
||||
"build": "node scripts/build.js",
|
||||
"test": "node scripts/test.js"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app",
|
||||
"react-app/jest"
|
||||
]
|
||||
"dev": "NODE_ENV=development webpack serve -c webpack.config.ts",
|
||||
"build": "NODE_ENV=production webpack -c webpack.config.ts",
|
||||
"deploy": "gh-pages -d build",
|
||||
"serve": "serve -s build"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
@@ -96,60 +37,47 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.29.0",
|
||||
"@babel/preset-env": "^7.29.0",
|
||||
"@babel/preset-react": "^7.28.5",
|
||||
"@babel/preset-typescript": "^7.28.5",
|
||||
"@mdx-js/loader": "^3.1.1",
|
||||
"@mdx-js/react": "^3.1.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
|
||||
"@svgr/webpack": "^8.1.0",
|
||||
"@testing-library/dom": "^10.4.1",
|
||||
"@testing-library/jest-dom": "^6.9.1",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/mdx": "^2.0.13",
|
||||
"@types/node": "^25.3.3",
|
||||
"@types/react": "^19.2.14",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@types/three": "^0.183.1",
|
||||
"babel-loader": "^10.0.0",
|
||||
"babel-preset-react-app": "^10.1.0",
|
||||
"browserslist": "^4.28.1",
|
||||
"css-loader": "^7.1.4",
|
||||
"css-minimizer-webpack-plugin": "^8.0.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^9.1.0",
|
||||
"html-webpack-plugin": "^5.6.6",
|
||||
"mini-css-extract-plugin": "^2.10.0",
|
||||
"postcss": "^8.5.8",
|
||||
"postcss-loader": "^8.2.1",
|
||||
"sass": "^1.97.3",
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"jest": {
|
||||
"roots": [
|
||||
"<rootDir>/src"
|
||||
],
|
||||
"collectCoverageFrom": [
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"!src/**/*.d.ts"
|
||||
],
|
||||
"setupFiles": [
|
||||
"react-app-polyfill/jsdom"
|
||||
],
|
||||
"setupFilesAfterEnv": [
|
||||
"<rootDir>/src/setupTests.ts"
|
||||
],
|
||||
"testMatch": [
|
||||
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
|
||||
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
|
||||
],
|
||||
"testEnvironment": "jsdom",
|
||||
"transform": {
|
||||
"^.+\\.(js|jsx|mjs|cjs|ts|tsx)$": "<rootDir>/config/jest/babelTransform.js",
|
||||
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
|
||||
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
|
||||
},
|
||||
"transformIgnorePatterns": [
|
||||
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
|
||||
"^.+\\.module\\.(css|sass|scss)$"
|
||||
],
|
||||
"modulePaths": [],
|
||||
"moduleNameMapper": {
|
||||
"^react-native$": "react-native-web",
|
||||
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
|
||||
},
|
||||
"moduleFileExtensions": [
|
||||
"web.js",
|
||||
"js",
|
||||
"web.ts",
|
||||
"ts",
|
||||
"web.tsx",
|
||||
"tsx",
|
||||
"json",
|
||||
"web.jsx",
|
||||
"jsx",
|
||||
"node"
|
||||
],
|
||||
"watchPlugins": [
|
||||
"jest-watch-typeahead/filename",
|
||||
"jest-watch-typeahead/testname"
|
||||
],
|
||||
"resetMocks": true
|
||||
"sass-loader": "^16.0.7",
|
||||
"sass-migrator": "^2.5.7",
|
||||
"source-map-loader": "^5.0.0",
|
||||
"style-loader": "^4.0.0",
|
||||
"terser-webpack-plugin": "^5.3.17",
|
||||
"ts-loader": "^9.5.4",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.9.3",
|
||||
"webpack": "^5.105.4",
|
||||
"webpack-cli": "^6.0.1",
|
||||
"webpack-dev-server": "^5.2.3"
|
||||
},
|
||||
"babel": {
|
||||
"presets": [
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.1 KiB |
@@ -2,29 +2,16 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta
|
||||
name="description"
|
||||
content="Web site created using create-react-app"
|
||||
content="Tymur Arsentiev's portfolio and blog site"
|
||||
/>
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
<link rel="apple-touch-icon" href="/logo192.png" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<title>tymur999.com</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 454 KiB |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"short_name": "tymur999.com",
|
||||
"name": "Tymur Arsentiev's blog",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
|
||||
217
scripts/build.js
@@ -1,217 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// Do this as the first thing so that any code reading it knows the right env.
|
||||
process.env.BABEL_ENV = 'production';
|
||||
process.env.NODE_ENV = 'production';
|
||||
|
||||
// Makes the script crash on unhandled rejections instead of silently
|
||||
// ignoring them. In the future, promise rejections that are not handled will
|
||||
// terminate the Node.js process with a non-zero exit code.
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
// Ensure environment variables are read.
|
||||
require('../config/env');
|
||||
|
||||
const path = require('path');
|
||||
const chalk = require('react-dev-utils/chalk');
|
||||
const fs = require('fs-extra');
|
||||
const bfj = require('bfj');
|
||||
const webpack = require('webpack');
|
||||
const configFactory = require('../config/webpack.config');
|
||||
const paths = require('../config/paths');
|
||||
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
||||
const formatWebpackMessages = require('react-dev-utils/formatWebpackMessages');
|
||||
const printHostingInstructions = require('react-dev-utils/printHostingInstructions');
|
||||
const FileSizeReporter = require('react-dev-utils/FileSizeReporter');
|
||||
const printBuildError = require('react-dev-utils/printBuildError');
|
||||
|
||||
const measureFileSizesBeforeBuild =
|
||||
FileSizeReporter.measureFileSizesBeforeBuild;
|
||||
const printFileSizesAfterBuild = FileSizeReporter.printFileSizesAfterBuild;
|
||||
const useYarn = fs.existsSync(paths.yarnLockFile);
|
||||
|
||||
// These sizes are pretty large. We'll warn for bundles exceeding them.
|
||||
const WARN_AFTER_BUNDLE_GZIP_SIZE = 512 * 1024;
|
||||
const WARN_AFTER_CHUNK_GZIP_SIZE = 1024 * 1024;
|
||||
|
||||
const isInteractive = process.stdout.isTTY;
|
||||
|
||||
// Warn and crash if required files are missing
|
||||
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const argv = process.argv.slice(2);
|
||||
const writeStatsJson = argv.indexOf('--stats') !== -1;
|
||||
|
||||
// Generate configuration
|
||||
const config = configFactory('production');
|
||||
|
||||
// We require that you explicitly set browsers and do not fall back to
|
||||
// browserslist defaults.
|
||||
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
|
||||
checkBrowsers(paths.appPath, isInteractive)
|
||||
.then(() => {
|
||||
// First, read the current file sizes in build directory.
|
||||
// This lets us display how much they changed later.
|
||||
return measureFileSizesBeforeBuild(paths.appBuild);
|
||||
})
|
||||
.then(previousFileSizes => {
|
||||
// Remove all content but keep the directory so that
|
||||
// if you're in it, you don't end up in Trash
|
||||
fs.emptyDirSync(paths.appBuild);
|
||||
// Merge with the public folder
|
||||
copyPublicFolder();
|
||||
// Start the webpack build
|
||||
return build(previousFileSizes);
|
||||
})
|
||||
.then(
|
||||
({ stats, previousFileSizes, warnings }) => {
|
||||
if (warnings.length) {
|
||||
console.log(chalk.yellow('Compiled with warnings.\n'));
|
||||
console.log(warnings.join('\n\n'));
|
||||
console.log(
|
||||
'\nSearch for the ' +
|
||||
chalk.underline(chalk.yellow('keywords')) +
|
||||
' to learn more about each warning.'
|
||||
);
|
||||
console.log(
|
||||
'To ignore, add ' +
|
||||
chalk.cyan('// eslint-disable-next-line') +
|
||||
' to the line before.\n'
|
||||
);
|
||||
} else {
|
||||
console.log(chalk.green('Compiled successfully.\n'));
|
||||
}
|
||||
|
||||
console.log('File sizes after gzip:\n');
|
||||
printFileSizesAfterBuild(
|
||||
stats,
|
||||
previousFileSizes,
|
||||
paths.appBuild,
|
||||
WARN_AFTER_BUNDLE_GZIP_SIZE,
|
||||
WARN_AFTER_CHUNK_GZIP_SIZE
|
||||
);
|
||||
console.log();
|
||||
|
||||
const appPackage = require(paths.appPackageJson);
|
||||
const publicUrl = paths.publicUrlOrPath;
|
||||
const publicPath = config.output.publicPath;
|
||||
const buildFolder = path.relative(process.cwd(), paths.appBuild);
|
||||
printHostingInstructions(
|
||||
appPackage,
|
||||
publicUrl,
|
||||
publicPath,
|
||||
buildFolder,
|
||||
useYarn
|
||||
);
|
||||
},
|
||||
err => {
|
||||
const tscCompileOnError = process.env.TSC_COMPILE_ON_ERROR === 'true';
|
||||
if (tscCompileOnError) {
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
'Compiled with the following type errors (you may want to check these before deploying your app):\n'
|
||||
)
|
||||
);
|
||||
printBuildError(err);
|
||||
} else {
|
||||
console.log(chalk.red('Failed to compile.\n'));
|
||||
printBuildError(err);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
)
|
||||
.catch(err => {
|
||||
if (err && err.message) {
|
||||
console.log(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// Create the production build and print the deployment instructions.
|
||||
function build(previousFileSizes) {
|
||||
console.log('Creating an optimized production build...');
|
||||
|
||||
const compiler = webpack(config);
|
||||
return new Promise((resolve, reject) => {
|
||||
compiler.run((err, stats) => {
|
||||
let messages;
|
||||
if (err) {
|
||||
if (!err.message) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
let errMessage = err.message;
|
||||
|
||||
// Add additional information for postcss errors
|
||||
if (Object.prototype.hasOwnProperty.call(err, 'postcssNode')) {
|
||||
errMessage +=
|
||||
'\nCompileError: Begins at CSS selector ' +
|
||||
err['postcssNode'].selector;
|
||||
}
|
||||
|
||||
messages = formatWebpackMessages({
|
||||
errors: [errMessage],
|
||||
warnings: [],
|
||||
});
|
||||
} else {
|
||||
messages = formatWebpackMessages(
|
||||
stats.toJson({ all: false, warnings: true, errors: true })
|
||||
);
|
||||
}
|
||||
if (messages.errors.length) {
|
||||
// Only keep the first error. Others are often indicative
|
||||
// of the same problem, but confuse the reader with noise.
|
||||
if (messages.errors.length > 1) {
|
||||
messages.errors.length = 1;
|
||||
}
|
||||
return reject(new Error(messages.errors.join('\n\n')));
|
||||
}
|
||||
if (
|
||||
process.env.CI &&
|
||||
(typeof process.env.CI !== 'string' ||
|
||||
process.env.CI.toLowerCase() !== 'false') &&
|
||||
messages.warnings.length
|
||||
) {
|
||||
// Ignore sourcemap warnings in CI builds. See #8227 for more info.
|
||||
const filteredWarnings = messages.warnings.filter(
|
||||
w => !/Failed to parse source map/.test(w)
|
||||
);
|
||||
if (filteredWarnings.length) {
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
'\nTreating warnings as errors because process.env.CI = true.\n' +
|
||||
'Most CI servers set it automatically.\n'
|
||||
)
|
||||
);
|
||||
return reject(new Error(filteredWarnings.join('\n\n')));
|
||||
}
|
||||
}
|
||||
|
||||
const resolveArgs = {
|
||||
stats,
|
||||
previousFileSizes,
|
||||
warnings: messages.warnings,
|
||||
};
|
||||
|
||||
if (writeStatsJson) {
|
||||
return bfj
|
||||
.write(paths.appBuild + '/bundle-stats.json', stats.toJson())
|
||||
.then(() => resolve(resolveArgs))
|
||||
.catch(error => reject(new Error(error)));
|
||||
}
|
||||
|
||||
return resolve(resolveArgs);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function copyPublicFolder() {
|
||||
fs.copySync(paths.appPublic, paths.appBuild, {
|
||||
dereference: true,
|
||||
filter: file => file !== paths.appHtml,
|
||||
});
|
||||
}
|
||||
154
scripts/start.js
@@ -1,154 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// Do this as the first thing so that any code reading it knows the right env.
|
||||
process.env.BABEL_ENV = 'development';
|
||||
process.env.NODE_ENV = 'development';
|
||||
|
||||
// Makes the script crash on unhandled rejections instead of silently
|
||||
// ignoring them. In the future, promise rejections that are not handled will
|
||||
// terminate the Node.js process with a non-zero exit code.
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
// Ensure environment variables are read.
|
||||
require('../config/env');
|
||||
|
||||
const fs = require('fs');
|
||||
const chalk = require('react-dev-utils/chalk');
|
||||
const webpack = require('webpack');
|
||||
const WebpackDevServer = require('webpack-dev-server');
|
||||
const clearConsole = require('react-dev-utils/clearConsole');
|
||||
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles');
|
||||
const {
|
||||
choosePort,
|
||||
createCompiler,
|
||||
prepareProxy,
|
||||
prepareUrls,
|
||||
} = require('react-dev-utils/WebpackDevServerUtils');
|
||||
const openBrowser = require('react-dev-utils/openBrowser');
|
||||
const semver = require('semver');
|
||||
const paths = require('../config/paths');
|
||||
const configFactory = require('../config/webpack.config');
|
||||
const createDevServerConfig = require('../config/webpackDevServer.config');
|
||||
const getClientEnvironment = require('../config/env');
|
||||
const react = require(require.resolve('react', { paths: [paths.appPath] }));
|
||||
|
||||
const env = getClientEnvironment(paths.publicUrlOrPath.slice(0, -1));
|
||||
const useYarn = fs.existsSync(paths.yarnLockFile);
|
||||
const isInteractive = process.stdout.isTTY;
|
||||
|
||||
// Warn and crash if required files are missing
|
||||
if (!checkRequiredFiles([paths.appHtml, paths.appIndexJs])) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Tools like Cloud9 rely on this.
|
||||
const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3000;
|
||||
const HOST = process.env.HOST || '0.0.0.0';
|
||||
|
||||
if (process.env.HOST) {
|
||||
console.log(
|
||||
chalk.cyan(
|
||||
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
||||
chalk.bold(process.env.HOST)
|
||||
)}`
|
||||
)
|
||||
);
|
||||
console.log(
|
||||
`If this was unintentional, check that you haven't mistakenly set it in your shell.`
|
||||
);
|
||||
console.log(
|
||||
`Learn more here: ${chalk.yellow('https://cra.link/advanced-config')}`
|
||||
);
|
||||
console.log();
|
||||
}
|
||||
|
||||
// We require that you explicitly set browsers and do not fall back to
|
||||
// browserslist defaults.
|
||||
const { checkBrowsers } = require('react-dev-utils/browsersHelper');
|
||||
checkBrowsers(paths.appPath, isInteractive)
|
||||
.then(() => {
|
||||
// We attempt to use the default port but if it is busy, we offer the user to
|
||||
// run on a different port. `choosePort()` Promise resolves to the next free port.
|
||||
return choosePort(HOST, DEFAULT_PORT);
|
||||
})
|
||||
.then(port => {
|
||||
if (port == null) {
|
||||
// We have not found a port.
|
||||
return;
|
||||
}
|
||||
|
||||
const config = configFactory('development');
|
||||
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http';
|
||||
const appName = require(paths.appPackageJson).name;
|
||||
|
||||
const useTypeScript = fs.existsSync(paths.appTsConfig);
|
||||
const urls = prepareUrls(
|
||||
protocol,
|
||||
HOST,
|
||||
port,
|
||||
paths.publicUrlOrPath.slice(0, -1)
|
||||
);
|
||||
// Create a webpack compiler that is configured with custom messages.
|
||||
const compiler = createCompiler({
|
||||
appName,
|
||||
config,
|
||||
urls,
|
||||
useYarn,
|
||||
useTypeScript,
|
||||
webpack,
|
||||
});
|
||||
// Load proxy config
|
||||
const proxySetting = require(paths.appPackageJson).proxy;
|
||||
const proxyConfig = prepareProxy(
|
||||
proxySetting,
|
||||
paths.appPublic,
|
||||
paths.publicUrlOrPath
|
||||
);
|
||||
// Serve webpack assets generated by the compiler over a web server.
|
||||
const serverConfig = {
|
||||
...createDevServerConfig(proxyConfig, urls.lanUrlForConfig),
|
||||
host: HOST,
|
||||
port,
|
||||
};
|
||||
const devServer = new WebpackDevServer(serverConfig, compiler);
|
||||
// Launch WebpackDevServer.
|
||||
devServer.startCallback(() => {
|
||||
if (isInteractive) {
|
||||
clearConsole();
|
||||
}
|
||||
|
||||
if (env.raw.FAST_REFRESH && semver.lt(react.version, '16.10.0')) {
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
`Fast Refresh requires React 16.10 or higher. You are using React ${react.version}.`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
console.log(chalk.cyan('Starting the development server...\n'));
|
||||
openBrowser(urls.localUrlForBrowser);
|
||||
});
|
||||
|
||||
['SIGINT', 'SIGTERM'].forEach(function (sig) {
|
||||
process.on(sig, function () {
|
||||
devServer.close();
|
||||
process.exit();
|
||||
});
|
||||
});
|
||||
|
||||
if (process.env.CI !== 'true') {
|
||||
// Gracefully exit when stdin ends
|
||||
process.stdin.on('end', function () {
|
||||
devServer.close();
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
if (err && err.message) {
|
||||
console.log(err.message);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1,52 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// Do this as the first thing so that any code reading it knows the right env.
|
||||
process.env.BABEL_ENV = 'test';
|
||||
process.env.NODE_ENV = 'test';
|
||||
process.env.PUBLIC_URL = '';
|
||||
|
||||
// Makes the script crash on unhandled rejections instead of silently
|
||||
// ignoring them. In the future, promise rejections that are not handled will
|
||||
// terminate the Node.js process with a non-zero exit code.
|
||||
process.on('unhandledRejection', err => {
|
||||
throw err;
|
||||
});
|
||||
|
||||
// Ensure environment variables are read.
|
||||
require('../config/env');
|
||||
|
||||
const jest = require('jest');
|
||||
const execSync = require('child_process').execSync;
|
||||
let argv = process.argv.slice(2);
|
||||
|
||||
function isInGitRepository() {
|
||||
try {
|
||||
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isInMercurialRepository() {
|
||||
try {
|
||||
execSync('hg --cwd . root', { stdio: 'ignore' });
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Watch unless on CI or explicitly running all tests
|
||||
if (
|
||||
!process.env.CI &&
|
||||
argv.indexOf('--watchAll') === -1 &&
|
||||
argv.indexOf('--watchAll=false') === -1
|
||||
) {
|
||||
// https://github.com/facebook/create-react-app/issues/5210
|
||||
const hasSourceControl = isInGitRepository() || isInMercurialRepository();
|
||||
argv.push(hasSourceControl ? '--watch' : '--watchAll');
|
||||
}
|
||||
|
||||
|
||||
jest.run(argv);
|
||||
94
src/about/About.mdx
Normal file
@@ -0,0 +1,94 @@
|
||||
import openingImage from "../img/DSC_5633.webp";
|
||||
import rainbow from "../img/IMG-0186.webp";
|
||||
import japanese from "../img/IMG_20230531_000224_01.webp";
|
||||
import computers from "../img/IMG_3071.webp";
|
||||
import mobo from "../img/2025-10-03-02-20-50-077.webp";
|
||||
import suit from "../img/military.webp";
|
||||
import nutrivend from "../img/nutrivend.webp";
|
||||
|
||||
<img src={openingImage} alt="Tymur Arsentiev" className="self"/>
|
||||
|
||||
# Welcome to my blog and personal website!
|
||||
|
||||
For the longest time, I never had a personal website to show my skills.
|
||||
Project after project, I have over 4 years under my belt, but I've never considered making a portfolio.
|
||||
Since early 2026, I've begun working on one. My website styles blend together an abstract UI while retaining functional simplicity on UX.
|
||||
Website development is my favorite hobby, and is naturally my favorite type of software engineering.
|
||||
|
||||
My goals are the following:
|
||||
|
||||
- Journaling my thoughts (originally done on [Medium](https://medium.com/@tymur.arsent)
|
||||
and [Substack](https://substack.com/@timsnodocmartins))
|
||||
- Merging my unique fashion sense with my website design skills
|
||||
- Cultivating my personal brand by documenting unique coding challenges
|
||||
|
||||
|
||||
## Fashion Rebel
|
||||
|
||||
<div className="clothing">
|
||||
<img src={rainbow} alt="Rainbow colored clothing"/>
|
||||
<img src={japanese} alt="Purple shirt with Japanese text"/>
|
||||
</div>
|
||||
|
||||
I am a fashion rebel at heart; just like my websites, the goal of my fashion is to stand out.
|
||||
I'm more of a shirt/jacket person more than anything, and I tend to keep my pants simple.
|
||||
I'm a sucker for flashy colors and abstract designs, so I'm always out buying, looking for inspiration.
|
||||
|
||||
I'm originally from Chicago, but I go to Georgia Tech in Atlanta. But I like Atlanta more for fashion.
|
||||
Whenever I can, I like to go thrifting near Ponce De Leon or Little Five Points.
|
||||
Chicago has few boutiques, mostly only name brand clothing. It's gotten so bad recently that I've been doing all my shopping on [Ebay](https://www.ebay.com/usr/tymur999).
|
||||
I like Ebay because it's like a collector's website. I've been a collector all my life, so you could say that I collect clothing.
|
||||
I also sell stuff on there, so be sure to check out my listings.
|
||||
|
||||
Why do I talk about fashion? That's because my fashion hobby inspired me to start this website.
|
||||
I'd like to think my taste in wearing outfits has been a huge asset in finding a modern design that works for this site.
|
||||
|
||||
## Self-Hosting Champion
|
||||
|
||||
<div className="computers">
|
||||
<img src={computers} alt="Surrounded by computers"/>
|
||||
<img src={mobo} alt="Surrounded by computers"/>
|
||||
</div>
|
||||
|
||||
As a rebel, I greatly value my independence.
|
||||
I don't like how big tech companies operate by encroaching on my data,
|
||||
so I've been self-hosting nearly all the software I use.
|
||||
|
||||
This website is hosted on my Kubernetes cluster, run at home.
|
||||
Here are some other software I self-host on it:
|
||||
- [Gitea, for VCS operations and CI/CD solution](https://gitea.tymur999.com)
|
||||
- [Nextcloud, for private cloud and file+calendar+task synchronization](https://nextcloud.tymur999.com)
|
||||
- Postfix, for private email solution and custom domain
|
||||
|
||||
### That alone means I have my own self-hosted version of Google Drive, Gmail, and Github.
|
||||
|
||||
I take pride in my Kubernetes cluster as Kubernetes knowledge is invaluable at nearly all software companies.
|
||||
I like managing the software at every step of the deployment pipeline, besides writing the actual code.
|
||||
|
||||
If you couldn't tell, I'm very DIY-ey. I build every computer and server from scratch.
|
||||
The cluster runs on a 28-core dual Intel Xeon server, which is my most impressive build.
|
||||
Otherwise, All my computers run on Arch Linux, which is built from scratch.
|
||||
Not to mention, my Linux experience spans nearly my entire life. I got my first Raspberry Pi in 2013.
|
||||
And now I daily drive Arch Linux, if that says anything about my Linux experience.
|
||||
|
||||
## Savvy Entrepreneur
|
||||
|
||||
<div className="clothing">
|
||||
<img src={suit} alt="Surrounded by computers"/>
|
||||
<img src={nutrivend} alt="Surrounded by computers"/>
|
||||
</div>
|
||||
|
||||
At heart, I'm always self-employed. Always looking to hustle or solve a challenge to earn money.
|
||||
I've been a part of two startups, Nutrivend and Kiwoon Learning, both of which I worked as CTO.
|
||||
|
||||
At Kiwoon Learning, around 2023, I made a stock market simulator backend in C# and built a frontend in React.
|
||||
The goal of the app was to teach high school students how to invest in stocks.
|
||||
Through coding the app, I learned how to stop being so perfectionist.
|
||||
My perfectionism led to delays in releases, and I learned to value my time much more.
|
||||
However, the simulator turned out to be one of the most advanced on the market, especially for high school students.
|
||||
|
||||
At Nutrivend, I built a full-stack web application using Next.js.
|
||||
The app featured a quiz system that filtered people into different categories of supplements based on their
|
||||
fitness goals and health. I helped my friend Woosik integrate Stripe so he could easily accept payments
|
||||
and manage his supplement orders and supply.
|
||||
Here, I used my Kubernetes experience to deploy the app on my cluster and keep uptime as close to 24/7 as possible.
|
||||
@@ -1,51 +1,20 @@
|
||||
import "./about.scss";
|
||||
import openingImage from "../img/IMG_20240725_175449_803.jpg";
|
||||
import rainbow from "../img/IMG-0186.jpg";
|
||||
import japanese from "../img/IMG_20230531_000224_01.jpg";
|
||||
import {PropsWithChildren} from "react";
|
||||
import "./about.sass";
|
||||
import {lazy} from "react";
|
||||
import {ExternalLink} from "../router/Link";
|
||||
import {motion} from "motion/react";
|
||||
import {AnimateFade} from "../animations";
|
||||
|
||||
const About = lazy(() => import("./About.mdx"));
|
||||
|
||||
const main = AnimateFade();
|
||||
export default function AboutPage() {
|
||||
return <main>
|
||||
<div className="edge">
|
||||
|
||||
</div>
|
||||
return <motion.main initial={main.initial} animate={main.animate} className="about-page">
|
||||
<div className="edge"/>
|
||||
<section className="about-container">
|
||||
<img src={openingImage} alt="Tymur Arsentiev" className="self"/>
|
||||
<h1 className="title">Welcome to my blog and personal website!</h1>
|
||||
<p>
|
||||
For the longest time, I never had a personal website to show my skills.
|
||||
I'm a longtime coder, project after project, but have never considered making a place to share my thoughts.
|
||||
After a while, I was inspired by my <ExternalLink href="https://medium.com/@tymur.arsent">Medium</ExternalLink> and
|
||||
<ExternalLink href="https://substack.com/@timsnodocmartins">Substack</ExternalLink> account to begin journaling my thoughts on my own.
|
||||
</p>
|
||||
<p>
|
||||
I like to take pride in my uniqueness as a web developer.
|
||||
I don't go for trends, I consider myself <i>the trendsetter.</i>
|
||||
My website design was definitely influenced by my fashion sense.
|
||||
</p>
|
||||
<h2>Fashion Rebel</h2>
|
||||
<div className="clothing">
|
||||
<img src={rainbow} alt="Rainbow colored clothing"/>
|
||||
<img src={japanese} alt="Purple shirt with Japanese text"/>
|
||||
</div>
|
||||
<p>
|
||||
Clothes shopping is a great knack of mine. I'm skilled in finding all kinds of weird clothes to wear.
|
||||
I like doing stuff that makes me stand out, as you can see from the gallery.
|
||||
</p>
|
||||
<p>
|
||||
My store of choice is <ExternalLink href="https://www.ebay.com/usr/tymur999">Ebay</ExternalLink>, where I love thrifting out-of-this-world outfits for a low price.
|
||||
EBay is a place for me to liquidate my assets, which is random items around the house.
|
||||
My favorite thing about Ebay is that they have almost every clothing brand, typically at reduced prices due to use.
|
||||
</p>
|
||||
<About components={{
|
||||
'a': ExternalLink,
|
||||
}}/>
|
||||
</section>
|
||||
<div className="edge">
|
||||
|
||||
</div>
|
||||
</main>
|
||||
<div className="edge"/>
|
||||
</motion.main>
|
||||
}
|
||||
|
||||
function ExternalLink(props: PropsWithChildren & { href: string }) {
|
||||
return (
|
||||
<a href={props.href} className="link external-link" target="_blank">{props.children}</a>
|
||||
)
|
||||
}
|
||||
82
src/about/about.sass
Normal file
@@ -0,0 +1,82 @@
|
||||
@use "../nav/nav"
|
||||
$paragraph: 20px
|
||||
$max-width: 600px
|
||||
$min-width: 400px
|
||||
$reader-bg: #27213C
|
||||
|
||||
.about-page
|
||||
color: white
|
||||
display: flex
|
||||
justify-content: center
|
||||
|
||||
.title
|
||||
text-align: center
|
||||
margin: nav.$padding
|
||||
|
||||
.self
|
||||
width: 100%
|
||||
border-bottom: white 4px solid
|
||||
|
||||
|
||||
.about-container
|
||||
min-width: $min-width
|
||||
flex-shrink: 1
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
font-family: Neuton, serif
|
||||
line-height: 40px
|
||||
|
||||
img:not(.self)
|
||||
border: 2px white solid
|
||||
|
||||
p
|
||||
text-indent: 30px
|
||||
padding: nav.$padding
|
||||
max-width: $max-width
|
||||
font-size: $paragraph
|
||||
h1,h2,h3
|
||||
padding: nav.$padding
|
||||
font-size: $paragraph * 2
|
||||
|
||||
h2
|
||||
font-size: $paragraph * 1.5
|
||||
|
||||
h3
|
||||
font-size: $paragraph * 1.1
|
||||
|
||||
.edge
|
||||
background: $reader-bg
|
||||
flex-grow: 1
|
||||
min-width: 30%
|
||||
|
||||
.clothing, .computers
|
||||
margin: 15px 0
|
||||
display: flex
|
||||
flex-direction: row
|
||||
justify-content: center
|
||||
> img
|
||||
min-width: 200px
|
||||
|
||||
|
||||
.clothing>img
|
||||
width: 33%
|
||||
|
||||
|
||||
.computers
|
||||
// select second
|
||||
img:not(:first-child)
|
||||
width: 20%
|
||||
|
||||
img
|
||||
width: 30%
|
||||
|
||||
.external-link
|
||||
text-decoration: underline !important
|
||||
|
||||
ul
|
||||
display: flex
|
||||
flex-direction: column
|
||||
font-size: $paragraph
|
||||
max-width: $max-width
|
||||
gap: 10px
|
||||
@@ -1,66 +0,0 @@
|
||||
@import "../nav/nav.scss";
|
||||
|
||||
main {
|
||||
color: white;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
margin: $padding;
|
||||
}
|
||||
|
||||
.self {
|
||||
width: 100%;
|
||||
border-bottom: white 4px solid;
|
||||
}
|
||||
|
||||
.about-container {
|
||||
margin-top: 2 * $padding;
|
||||
flex-shrink: 1;
|
||||
max-width: 75%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-family: Neuton;
|
||||
|
||||
img:not(.self) {
|
||||
border: 2px white solid;
|
||||
}
|
||||
|
||||
p {
|
||||
text-indent: 2 * $padding;
|
||||
margin: 10px;
|
||||
max-width: 600px;
|
||||
line-height: 40px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 40px;
|
||||
}
|
||||
h2 {
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.edge {
|
||||
background:#27213C;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.clothing {
|
||||
margin: 15px 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.clothing>img {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.external-link {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
27
src/animations.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import {Target} from "motion";
|
||||
|
||||
export type AnimateTemplate = {
|
||||
initial: Target,
|
||||
animate: Target,
|
||||
};
|
||||
|
||||
export function AnimateDirection(dir: "top" | "left" | "right" | "bottom", top: string | number = 0) : AnimateTemplate {
|
||||
const animation: Required<AnimateTemplate> = { animate: {}, initial: {} };
|
||||
animation.animate[dir] = top;
|
||||
animation.initial[dir] = "-100%";
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
export function AnimateFade() : AnimateTemplate {
|
||||
return {
|
||||
initial: { opacity: 0 },
|
||||
animate: { opacity: 1 },
|
||||
};
|
||||
}
|
||||
|
||||
export function AnimateSpin() : Pick<AnimateTemplate, "animate"> {
|
||||
return {
|
||||
animate : { rotate: 360 },
|
||||
};
|
||||
}
|
||||
87
src/articles/ArticlesList.tsx
Normal file
@@ -0,0 +1,87 @@
|
||||
import "./list.sass";
|
||||
import {ReactComponent as BoxSvg} from "../img/blog-box.svg";
|
||||
import {Article, ARTICLES} from "./articles";
|
||||
import {motion} from "motion/react";
|
||||
import {AnimateFade} from "../animations";
|
||||
import {Canvas} from "@react-three/fiber";
|
||||
import {Environment, Html, OrbitControls} from "@react-three/drei";
|
||||
import MilkyWay from "../img/2k_stars_milky_way.jpg";
|
||||
import {Sun} from "../index/Canvas";
|
||||
import {Bloom, EffectComposer, Vignette} from "@react-three/postprocessing";
|
||||
import {useEffect, useState} from "react";
|
||||
import {Reader} from "./Reader";
|
||||
import {useRouter} from "../router/RouterContext";
|
||||
import {Path} from "../router/router";
|
||||
|
||||
const ARTICLE_QUERY = "a";
|
||||
const main = AnimateFade();
|
||||
export default function ArticlesList() {
|
||||
const [article, setArticle] = useState<Article | null>(null);
|
||||
const router = useRouter();
|
||||
|
||||
useEffect(() => {
|
||||
const params = new URLSearchParams(location.search);
|
||||
if(params.has(ARTICLE_QUERY)) {
|
||||
const id = Number.parseInt(params.get(ARTICLE_QUERY)!);
|
||||
setArticle(ARTICLES[id] ?? null);
|
||||
}
|
||||
}, [setArticle]);
|
||||
|
||||
useEffect(() => {
|
||||
if(!article) {
|
||||
// query param
|
||||
const params = new URLSearchParams(location.search);
|
||||
if(params.has(ARTICLE_QUERY)) {
|
||||
router.replacePage(location.pathname as Path);
|
||||
}
|
||||
} else {
|
||||
const id = ARTICLES.indexOf(article);
|
||||
router.replacePage(`${location.pathname}?${ARTICLE_QUERY}=${id}` as Path);
|
||||
}
|
||||
}, [article]);
|
||||
|
||||
|
||||
return <motion.main animate={main.animate} initial={main.initial} className="art-ctr">
|
||||
<Canvas camera={{position: [0,0,20]}}>
|
||||
<Environment background files={MilkyWay}/>
|
||||
<EffectComposer>
|
||||
<Bloom luminanceThreshold={0} luminanceSmoothing={0.9} />
|
||||
<Vignette eskil={false} offset={0.1} darkness={1.1} />
|
||||
</EffectComposer>
|
||||
<Sun/>
|
||||
<OrbitControls enablePan={false} enableZoom />
|
||||
<Html className="articles" zIndexRange={[100,0]} prepend center transform>
|
||||
{
|
||||
ARTICLES.map(a => <BlogBox setReading={setArticle} article={a}/>)
|
||||
}
|
||||
</Html>
|
||||
</Canvas>
|
||||
<Reader post={article} setPost={setArticle}/>
|
||||
</motion.main>
|
||||
}
|
||||
|
||||
function BlogBox(props: { article: Article, setReading: (_: Article | null) => void }) {
|
||||
const {article, setReading, article: {name, description, thumbnail, published} } = props;
|
||||
|
||||
return (
|
||||
<button className="link" onClick={() => setReading(article)}>
|
||||
<div className="blog-box">
|
||||
<img className="thumbnail" alt={`${name} thumbnail`} src={thumbnail}/>
|
||||
<div className="titles">
|
||||
<h1>
|
||||
{ name }
|
||||
</h1>
|
||||
<div className="desc">
|
||||
<h3>
|
||||
{ description }
|
||||
</h3>
|
||||
<p>
|
||||
{ published.toDateString() }
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<BoxSvg className='box-wave'/>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
46
src/articles/Reader.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import {animate, motion} from "framer-motion";
|
||||
import {useEffect} from "react";
|
||||
import {AnimateFade, AnimateTemplate} from "../animations";
|
||||
import "./reader.sass";
|
||||
import {ExternalLink} from "../router/Link";
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import {faClose} from "@fortawesome/free-solid-svg-icons/faClose";
|
||||
import {Article} from "./articles";
|
||||
|
||||
const READER : AnimateTemplate = AnimateFade();
|
||||
|
||||
export function Reader({post, setPost}: {post: Article | null, setPost: (_: Article | null) => void}) {
|
||||
|
||||
useEffect(() => {
|
||||
function pressEscape(e: KeyboardEvent) {
|
||||
e.key === "Escape" && handleClose();
|
||||
}
|
||||
|
||||
document.addEventListener("keydown", pressEscape);
|
||||
return () => document.removeEventListener("keydown", pressEscape);
|
||||
}, []);
|
||||
|
||||
function handleClose() {
|
||||
animate(".reader", READER.initial)
|
||||
.then(() => setPost(null));
|
||||
}
|
||||
|
||||
return post ? (
|
||||
<motion.section
|
||||
initial={READER.initial}
|
||||
animate={READER.animate}
|
||||
onClick={handleClose}
|
||||
className="reader link">
|
||||
<article onClick={e => e.stopPropagation()}>
|
||||
<button onClick={handleClose} className="link reader-close">
|
||||
<FontAwesomeIcon icon={faClose} />
|
||||
</button>
|
||||
<div className="content">
|
||||
<post.article components={{
|
||||
'a': ExternalLink
|
||||
}}/>
|
||||
</div>
|
||||
</article>
|
||||
</motion.section>
|
||||
) : <></>;
|
||||
}
|
||||
32
src/articles/articles.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import {Path} from "../router/router";
|
||||
import {MDXContent} from "mdx/types";
|
||||
import {lazy, LazyExoticComponent} from "react";
|
||||
import allBlack from "../img/IMG_3095.webp";
|
||||
import techTower from "../img/tech-tower.webp";
|
||||
|
||||
export interface Article {
|
||||
name: string,
|
||||
description: string,
|
||||
// image thumbnail
|
||||
thumbnail: Path,
|
||||
published: Date,
|
||||
// lazy load article content
|
||||
article: LazyExoticComponent<MDXContent>
|
||||
}
|
||||
|
||||
export const ARTICLES: Article[] = [
|
||||
{
|
||||
name: "My high school experience",
|
||||
description: "My first program, winning two senior superlatives, and why (and how) I chose Georgia Tech",
|
||||
thumbnail: allBlack,
|
||||
published: new Date("3/15/2026"),
|
||||
article: lazy(() => import("./mdx/high-school.mdx"))
|
||||
},
|
||||
{
|
||||
name: "Georgia Tech Review",
|
||||
description: "Reviewing Georgia Tech as a school while completing my Computer Science Bachelors",
|
||||
thumbnail: techTower,
|
||||
published: new Date("4/11/2026"),
|
||||
article: lazy(() => import("./mdx/gt-review.mdx"))
|
||||
}
|
||||
]
|
||||
77
src/articles/list.sass
Normal file
@@ -0,0 +1,77 @@
|
||||
@use "../nav/nav"
|
||||
@use "../index"
|
||||
$entry-width: 400px
|
||||
|
||||
canvas
|
||||
width: 100vw
|
||||
height: calc(100vh - 100px)
|
||||
|
||||
.blog-box
|
||||
display: flex
|
||||
flex-direction: column
|
||||
|
||||
.thumbnail
|
||||
height: 400px
|
||||
|
||||
.thumbnail
|
||||
max-width: $entry-width
|
||||
object-fit: cover
|
||||
object-position: 0 0
|
||||
|
||||
.spacer
|
||||
background: #393984FF
|
||||
flex-grow: 1
|
||||
|
||||
@media screen and (max-width: index.$phone)
|
||||
.spacer
|
||||
display: none
|
||||
|
||||
.titles
|
||||
font-family: Neuton, serif
|
||||
margin: 10px
|
||||
display: flex
|
||||
align-items: center
|
||||
|
||||
>h1
|
||||
flex-grow: 3
|
||||
text-align: left
|
||||
|
||||
>div
|
||||
flex-grow: 1
|
||||
text-align: center
|
||||
|
||||
h4
|
||||
color: grey
|
||||
|
||||
.articles
|
||||
z-index: -999
|
||||
display: flex
|
||||
flex-grow: 3
|
||||
justify-content: center
|
||||
margin-top: 100px
|
||||
flex-wrap: wrap-reverse
|
||||
flex-direction: row-reverse
|
||||
|
||||
.art-ctr
|
||||
display: flex
|
||||
flex-direction: row
|
||||
min-height: 100vh
|
||||
|
||||
ul
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: flex-start
|
||||
justify-items: center
|
||||
|
||||
li
|
||||
font-size: 20px
|
||||
|
||||
button
|
||||
display: flex
|
||||
flex-direction: column
|
||||
max-width: $entry-width
|
||||
margin: nav.$padding * 2
|
||||
&>div
|
||||
background: #282c34
|
||||
color: white
|
||||
padding: 0
|
||||
79
src/articles/mdx/gt-review.mdx
Normal file
@@ -0,0 +1,79 @@
|
||||
import techTower from "../../img/tech-tower.webp";
|
||||
import talking from "../../img/campus-life-essentials.png";
|
||||
import nav from "../../img/nav.jpg";
|
||||
import lecture from "../../img/lecturehall.jpg";
|
||||
|
||||
# Georgia Tech Review
|
||||
|
||||
<img src={techTower} alt="Georgia Tech's Tech Tower" width={400}/>
|
||||
|
||||
## Value: 5/5
|
||||
|
||||
I'll start this review by saying that Georgia Tech was mentioned as a [New Ivy by Forbes for the third year](https://news.gatech.edu/news/2026/04/09/georgia-tech-earns-top-c-suite-ranking-among-forbes-new-ivies).
|
||||
So clearly it's a good school, and is top 5 for Computer Science.
|
||||
If you don't know, I am from Illinois so I pay out-of-state tuition.
|
||||
Despite this, I'd say the 50k tuition is worth it for the great return.
|
||||
You can basically get into any internship, and FAANG if you apply early enough.
|
||||
|
||||
I found that I was denied from FAANG mostly because I applied too late. I mean, applications start the summer before, seesh. Like, for real?!
|
||||
|
||||
The price is a lot cheaper for in-state students. They have a program called [HOPE/Zell Miller](https://finaid.gatech.edu/undergraduate-types-aid/hope-zell-faqs)
|
||||
which waives the entire tuition given you maintained a 3.3+ GPA in high school. Funnily enough, the scholarship gets funded from state lottery revenue.
|
||||
|
||||
If you are considering whether to choose this school, remember that employers tend to sort Georgia Tech near the top of the resume pile.
|
||||
|
||||
## Campus: 4/5
|
||||
|
||||
<img src={nav} alt="Nav Dining Hall" width={400} />
|
||||
|
||||
The campus is in the center of Atlanta, but in midtown rather than more dangerous downtown.
|
||||
I like Atlanta more than Chicago because the culture is more present whereas Chicago is the city of work.
|
||||
I enjoy shopping in Little Five Points and on Ponce De Leon, of which there is no equivalent in Chicago.
|
||||
|
||||
The campus itself is a square mile or so, and everything is walkable, at furthest being 15 minutes.
|
||||
I wish the campus had more *neoclassical* architecture like older campuses, but the campus seems kinda *functionalist*.
|
||||
Even the older buildings look boring and smell moldy, but that's besides the point.
|
||||
|
||||
I'm always in the 3rd floor of the library.
|
||||
There they have lots of people to study around and plenty of monitors to dock your laptop.
|
||||
|
||||
## Classwork: 2/5
|
||||
|
||||
<img src={lecture} alt="Nav Dining Hall" width={400} />
|
||||
|
||||
### It feels like they make the classwork harder just to say they did.
|
||||
|
||||
Sometimes the classwork feels hard, stressful just to say that it is so. I don't mind that too much, but it gets annoying.
|
||||
|
||||
I'm sure this is a problem at all colleges, but the CS classwork just doesn't map to your internship.
|
||||
Everyone I talked to found that their classes contributed nothing to their internship experience.
|
||||
I'd say what you learn is more math-major-esc, nothing related to coding or programming or architecture.
|
||||
|
||||
I don't mention my classes on my resume because I know they haven't taught me anything that recruiters seek.
|
||||
I lean more into showcasing my projects and startup experiences, stuff where I've actually coded something.
|
||||
The classes nowadays just seem too theoretical and in the clouds, with nothing to code or a project to showcase.
|
||||
|
||||
## Social: 3/5
|
||||
|
||||
<img src={talking} alt="Campus photo" width={400}/>
|
||||
|
||||
### Everyone's the shy nerd type
|
||||
|
||||
Finding friends was no problem for me, and you kinda reach the end of the Markov chain eventually.
|
||||
|
||||
But I wish there were more events that bring people together. I met some people at my dorm but not too many.
|
||||
Everyone's too shy to talk to each other, so it can feel kind of lonely at times.
|
||||
People congregate to study during finals, and honestly a study group is a solid form of friendship here.
|
||||
|
||||
Dating is kind of impossible here, especially for me.
|
||||
You have your female friends, but you don't meet any new women expect at the bars.
|
||||
So most are dating their friends, which can turn awkward. I personally found that each of my female friends *tried to have a thing with me*.
|
||||
At the end of the day, *that* left me without any female friends, which obviously sucks.
|
||||
|
||||
## Conclusion: 4/5
|
||||
|
||||
I would recommend you to go to Georgia Tech, as the value is too good to pass up.
|
||||
But recognize that it is a *nerdy* school, and everyone is on the quiet side.
|
||||
Still, attending clubs, gatherings, and dorm meetings can help you expand your visions.
|
||||
Like Forbes mentioned, Georgia Tech is a new ivy, and the reputation hits exactly like you think it would.
|
||||
Choosing Georgia Tech is straight fire.
|
||||
73
src/articles/mdx/high-school.mdx
Normal file
@@ -0,0 +1,73 @@
|
||||
import allBlack from "../../img/IMG_3095.webp";
|
||||
import style from "../../img/2026-04-07-20-45-39-165.webp";
|
||||
import savvy from "../../img/2026-04-07-20-44-35-818.webp";
|
||||
import {ReactComponent as Nextcloud} from "../../img/Nextcloud Logo Vector.svg";
|
||||
import {ReactComponent as K8s} from "../../img/Kubernetes Logo Vector.svg";
|
||||
|
||||
# My high school experience
|
||||
|
||||
<img className="thumbnail" src={allBlack} width={400} alt="turtleneck thumbnail"/>
|
||||
|
||||
My first coding experience was in middle school playing Code Combat.
|
||||
You could say Python is the first language I learned, not particularly uncommon.
|
||||
That was probably the most fun I ever had in a middle school classroom.
|
||||
I was way ahead of class and even played in my free time.
|
||||
|
||||
## High School Extracurriculars
|
||||
|
||||
The first time I competed in my software engineering skills was FBLA. I did the Computer Programming event, which
|
||||
required us to setup a spreadsheet app that could record data and export into various formats. Funny thing is that
|
||||
my dad pulled an all-nighter to finish it. It was written in C# and using Windows Forms for desktop support.
|
||||
|
||||
I didn't do well in the event but was inspired to fix it based on the rubric they provided. This is where I learned C#
|
||||
and also their web support. [GitHub repo here](https://github.com/tymur999/CommunityServiceDBTracker).
|
||||
After C#, I learned React to grind and spam hackathons with my friends. Our stack included React or Next.js, Firebase, with
|
||||
Typescript. [My Devpost](https://devpost.com/tymur999) hosts all my hackathon projects, which include:
|
||||
- [DormUp](https://devpost.com/software/dormup) - roommate finder app
|
||||
- [ExamIn](https://devpost.com/software/examin) - Quizlet x APClassroom
|
||||
- [Mura](https://devpost.com/software/mura) - YouTube spin-off for learning
|
||||
- [RecycleBot](https://devpost.com/software/recyclebot-zmr3tx) - my first solo project
|
||||
|
||||
Not to flex, but every submission after my first hackathon has won some award.
|
||||
Nonetheless, hackathons helped us get comfortable with React in a short time limit.
|
||||
But of course, I like to be different, so this is my take on an abstract design.
|
||||
I'm proud of not using Bootstrap, that's so 2015.
|
||||
## Programming Hobby
|
||||
|
||||
<div className="row">
|
||||
<Nextcloud/>
|
||||
<K8s/>
|
||||
</div>
|
||||
|
||||
I began to experiment with Ubuntu on an old computer, and I enjoyed its ease of use and up-to-date repositories.
|
||||
I've been daily-driving Linux distros since 5 years ago. I decided to self-host all my applications
|
||||
through Kubernetes and Docker. I made a goal for myself to remove Big Brother companies from my stack,
|
||||
so replace Google Drive with Nextcloud, etc. My life goal is to be independent, and that extends to my data.
|
||||
|
||||
Additionally, I did a startup in high school with my friends called [Kiwoon Learning](https://kiwoonlearning.web.app/). The goal was to educate
|
||||
high school students on investing and financial independence. I worked on the backend and a bit of the frontend.
|
||||
No longer was it a side personal project, [Kiwoon](https://kiwoonlearning.web.app/) taught me how to develop an application for a hundred or so real users.
|
||||
|
||||
## The Graduation
|
||||
|
||||
<div className="row">
|
||||
<img src={style} width={500} alt="style superlative"/>
|
||||
<img src={savvy} width={500} alt="tech savvy superlative"/>
|
||||
</div>
|
||||
|
||||
On my graduation, I won the senior superlatives for best style and most tech savvy.
|
||||
I took the pictures with my friend Rahil who also won most tech savvy.
|
||||
We decided to duo the tech-savvy, and for best style, he took my picture outside some pines.
|
||||
In fact, I think the animation on the TV is my old personal website.
|
||||
|
||||
I also won the Visionary Scholarship, which boosted my confidence in my creative abilities.
|
||||
It really taught me to trust my intuition, like nothing else.
|
||||
While men tend to be logical, I like to feel my way through everything and listen to my gut.
|
||||
|
||||
I applied to various schools, around 21+. I had some issues because I maxed out CommonApp, so I applied to some
|
||||
schools directly on their websites. Unfortunately, I didn't get into University Of Illinois for CS+Math.
|
||||
That's wild since I got into Georgia Tech out-of-state but the state school denied me.
|
||||
The Princeton interview stressed me out, but I was deferred and then rejected, which I still treat as an accomplishment.
|
||||
|
||||
My top two choices were Michigan State and Georgia Tech, mostly because MSU was so cheap.
|
||||
I chose Georgia Tech at the end because a Georgia Tech degree just looks too good to pass up.
|
||||
66
src/articles/reader.sass
Normal file
@@ -0,0 +1,66 @@
|
||||
@use "../nav/nav"
|
||||
@use "../about/about"
|
||||
@use "../index"
|
||||
|
||||
.reader
|
||||
z-index: 9999
|
||||
font-family: Neuton, serif
|
||||
background: rgba(0,0,0,0.5)
|
||||
backdrop-filter: blur(5px)
|
||||
width: 100vw
|
||||
height: 100vh
|
||||
position: fixed
|
||||
top: 0
|
||||
left: 0
|
||||
|
||||
display: flex
|
||||
justify-content: center
|
||||
align-items: center
|
||||
|
||||
> article
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
border-radius: 15px
|
||||
margin: auto
|
||||
overflow-y: scroll
|
||||
overflow-x: hidden
|
||||
background: white
|
||||
color: black
|
||||
height: 90vh
|
||||
|
||||
@media screen and (min-width: index.$phone)
|
||||
width: 800px
|
||||
|
||||
h1
|
||||
font-size: xxx-large
|
||||
h2
|
||||
font-size: xx-large
|
||||
h3
|
||||
font-size: x-large
|
||||
p
|
||||
font-size: large
|
||||
|
||||
.content
|
||||
max-width: 600px
|
||||
|
||||
.external-link
|
||||
color: inherit !important
|
||||
|
||||
.row
|
||||
margin: 30px 0
|
||||
display: flex
|
||||
flex-direction: row
|
||||
justify-content: center
|
||||
|
||||
.row>*
|
||||
width: 50%
|
||||
|
||||
.reader-close
|
||||
position: absolute
|
||||
align-self: flex-end
|
||||
font-size: large
|
||||
font-weight: bold
|
||||
color: red !important
|
||||
background: white
|
||||
border-radius: 999px
|
||||
BIN
src/img/12k_jupiter_rings.webp
Normal file
|
After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 69 KiB |
BIN
src/img/2025-10-03-02-20-50-077.webp
Normal file
|
After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 959 KiB |
BIN
src/img/2026-04-07-20-44-35-818.webp
Normal file
|
After Width: | Height: | Size: 239 KiB |
BIN
src/img/2026-04-07-20-45-39-165.webp
Normal file
|
After Width: | Height: | Size: 149 KiB |
BIN
src/img/2k_ceres_fictional.webp
Normal file
|
After Width: | Height: | Size: 493 KiB |
BIN
src/img/2k_haumea_fictional.webp
Normal file
|
After Width: | Height: | Size: 363 KiB |
BIN
src/img/2k_jupiter.webp
Normal file
|
After Width: | Height: | Size: 79 KiB |
BIN
src/img/2k_makemake_fictional.webp
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
src/img/2k_stars_milky_way.jpg
Normal file
|
After Width: | Height: | Size: 246 KiB |
|
Before Width: | Height: | Size: 13 MiB |
BIN
src/img/DSC_5633.webp
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
1
src/img/Gitea-Logo.wine.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="800" width="1200" viewBox="-18.77673 -19.385925 162.73166 116.31555"><path d="M22.1597.5C12.613.473-.1796 7.2982.5279 24.404c1.1056 26.729 25.4566 29.2084 35.1917 29.423 1.068 5.0136 12.5218 22.3057 21.0018 23.2167h37.1528c22.2776-1.6678 38.9607-75.7567 26.5932-76.0382-46.7816 2.4769-49.9952 2.1384-88.5998 0C29.3726.9789 25.8953.5107 22.1596.5zm2.4913 9.459c1.3514 13.6926 3.5559 21.7035 8.0182 33.9434-11.3829-1.5047-21.0698-5.2244-22.8515-19.1099C8.8667 17.3813 12.2081 9.625 24.651 9.959z" fill="#609926" stroke="#428f29"/><g transform="translate(-5.5503 -33.1175)" fill="#fff"><rect ry="5.4826" transform="rotate(25.915)" y="18.2916" x="87.5087" height="34.7621" width="34.7621"/><path d="M79.805 57.359l3.241 1.61V35.2557h-3.2626z"/></g><g transform="translate(-5.5503 -33.1175)"><circle cx="49.0647" cy="90.0778" r="3.4745" transform="rotate(-19.796)" fill="#609926"/><circle cx="36.8104" cy="102.1049" r="3.4745" transform="rotate(-19.796)" fill="#609926"/><circle cx="46.4843" cy="111.4393" r="3.4745" transform="rotate(-19.796)" fill="#609926"/><path fill="#609926" d="M79.5402 58.9355l2.4017 1.1726-11.961 24.4975-2.4017-1.1727z"/><path d="M76.5581 68.1163c12.9759 6.3954 13.013 4.102 4.8909 20.9073" fill="none" stroke="#609926" stroke-width="2.68"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.0 MiB |
BIN
src/img/IMG-0186.webp
Normal file
|
After Width: | Height: | Size: 934 KiB |
|
Before Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 900 KiB |
BIN
src/img/IMG_20230531_000224_01.webp
Normal file
|
After Width: | Height: | Size: 215 KiB |
|
Before Width: | Height: | Size: 69 KiB |
BIN
src/img/IMG_20240725_175449_803.webp
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
src/img/IMG_3071.webp
Normal file
|
After Width: | Height: | Size: 420 KiB |
BIN
src/img/IMG_3095.webp
Normal file
|
After Width: | Height: | Size: 2.0 MiB |
1
src/img/Kubernetes Logo Vector.svg
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 385 KiB |
1
src/img/Nextcloud Logo Vector.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 327.41"><defs><style>.cls-1{fill:#0082c9;}</style></defs><path class="cls-1" d="M500.22,336.29c-51.8,0-95.7,35.12-109.31,82.53a73.91,73.91,0,0,0-67.16-43C283.36,375.8,250,409.16,250,450a74.09,74.09,0,0,0,141.35,31.17,113.24,113.24,0,0,0,108.87,82.53c51.36,0,95.26-34.68,109.31-81.65A73.93,73.93,0,0,0,750,449.55c0-40.82-33.36-73.75-74.19-73.75a73.9,73.9,0,0,0-66.28,41.71C595.48,371,552,336.29,500.22,336.29Zm0,43.46A70.24,70.24,0,1,1,430,450,69.89,69.89,0,0,1,500.22,379.75Zm-176,39.51A30.73,30.73,0,1,1,293.46,450,30.54,30.54,0,0,1,324.19,419.26Zm351.62,0A30.73,30.73,0,1,1,645.08,450C645.52,432.87,658.69,419.26,675.81,419.26Z" transform="translate(-250 -336.29)"/><g id="g4571"><path class="cls-1" d="M377.84,616c12.19,0,19,8.67,19,21.68a2.29,2.29,0,0,1-2.27,2.27H361.74c.2,11.56,8.26,18.17,17.55,18.17a19.28,19.28,0,0,0,12-4.13c1.23-.83,2.27-.62,2.89.62l.62,1a2.06,2.06,0,0,1-.62,2.89,25.6,25.6,0,0,1-15.08,5c-13.42,0-23.74-9.71-23.74-23.75C355.54,624.89,365.45,616,377.84,616Zm12.6,19.41c-.41-9.5-6.2-14.25-12.8-14.25-7.64,0-14.25,5-15.7,14.25Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M458.79,622.61v-15.9a2.06,2.06,0,0,1,2.27-2.27h1.65c1.45,0,2.07.83,2.07,2.27v10.74h9.29a2.07,2.07,0,0,1,2.27,2.27v.62c0,1.45-.83,2.07-2.27,2.07h-9.29v22.71c0,10.53,6.4,11.77,9.91,12,1.86.2,2.48.62,2.48,2.27v1.24c0,1.44-.62,2.06-2.48,2.06-9.91,0-15.9-6-15.9-16.72Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M506.07,616a23.33,23.33,0,0,1,15.08,5.16c1,.82,1.24,1.86.2,3.1l-.62,1c-.82,1.24-1.85,1.24-3.09.41-2.07-1.44-6-4.13-11.36-4.13-9.91,0-17.76,7.44-17.76,18.38,0,10.74,7.85,18.17,17.76,18.17a19.07,19.07,0,0,0,12.8-4.75c1.24-.82,2.07-.62,2.89.62l.62.83a2.3,2.3,0,0,1-.62,3.09,25.37,25.37,0,0,1-16.1,5.79c-13.42,0-23.75-9.71-23.75-23.75C482.33,625.92,492.65,616,506.07,616Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M533.54,601.35c0-1.45-.83-2.28.62-2.28h1.65c1.44,0,3.72.83,3.72,2.28V650.7c0,5.78,2.68,6.4,4.74,6.6,1,0,1.86.62,1.86,2.07v1.45a2,2,0,0,1-2.27,2.27c-3.72,0-10.32-1.24-10.32-11.15Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M575.87,616c13.21,0,24,10.11,24,23.54a24,24,0,0,1-47.91,0C551.91,626.12,562.65,616,575.87,616Zm0,42.12c9.7,0,17.55-7.85,17.55-18.58,0-10.33-7.85-18-17.55-18a17.8,17.8,0,0,0-17.76,18C558.32,650.08,566.16,658.13,575.87,658.13Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M678.91,616a16.31,16.31,0,0,1,14.86,9.08H694a26.9,26.9,0,0,1-.21-3.51V601.14c0-1.45-.62-2.27.83-2.27h1.65c1.45,0,3.72.82,3.72,2.27V660c0,1.44-.62,2.27-2.07,2.27h-1.44c-1.45,0-2.27-.62-2.27-2.06v-3.51a10.19,10.19,0,0,1,.41-2.9h-.21a16.85,16.85,0,0,1-15.69,9.5c-12.18,0-19.82-9.7-19.82-23.74-.42-14,8-23.54,20-23.54Zm.2,42.12c7.64,0,14.66-5.37,14.66-18.38,0-9.29-4.75-18.17-14.45-18.17-8.05,0-14.66,6.61-14.66,18.17C664.87,650.9,670.65,658.13,679.11,658.13Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M302.06,662.47h1.65A2.06,2.06,0,0,0,306,660.2V616c0-7,7.64-12,16.32-12s16.31,5,16.31,12V660.4a2.06,2.06,0,0,0,2.27,2.27h1.65c1.45,0,2.07-.82,2.07-2.27V615.59c0-11.77-11.77-17.55-22.51-17.55h0c-10.32,0-22.09,5.78-22.09,17.55V660.2C300,661.64,300.62,662.47,302.06,662.47Z" transform="translate(-250 -336.29)"/><path class="cls-1" d="M646.69,617H645a2.07,2.07,0,0,0-2.27,2.27v25c0,7-4.54,13.42-13.42,13.42-8.67,0-13.42-6.4-13.42-13.42v-25a2.07,2.07,0,0,0-2.27-2.27H612c-1.44,0-2.06.83-2.06,2.27V646c0,11.77,8.67,17.55,19.41,17.55h0c10.74,0,19.41-5.78,19.41-17.55V619.31a1.84,1.84,0,0,0-2.07-2.27Z" transform="translate(-250 -336.29)"/><path id="path4165-9" class="cls-1" d="M442.27,616.83a2.18,2.18,0,0,0-1.45,1l-8.26,9.91-6.19,7.43-9.5-11.36-5.16-6.19a1.8,1.8,0,0,0-1.45-.83,3.33,3.33,0,0,0-1.65.62l-1.24,1c-1,.83-1,1.86-.2,3.1l8.25,9.91,7,8.26-10.12,12.19h0l-5.16,6.19a2.31,2.31,0,0,0,.2,3.3l1.24,1c1,.82,2.07.62,3.1-.42l8.26-9.91,6.19-7.43,9.5,11.36h0l5.16,6.19a1.94,1.94,0,0,0,3.1.21l1.24-1c1-.82,1-1.85.21-3.09l-8.26-9.91-7-8.26L440.2,628h0l5.17-6.19a2.33,2.33,0,0,0-.21-3.31l-1.24-1.23a1.71,1.71,0,0,0-1.65-.42Z" transform="translate(-250 -336.29)"/></g></svg>
|
||||
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 376 KiB |
1
src/img/blog-box.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="#282c34" fill-opacity="1" d="M0,192L30,186.7C60,181,120,171,180,149.3C240,128,300,96,360,106.7C420,117,480,171,540,186.7C600,203,660,181,720,154.7C780,128,840,96,900,122.7C960,149,1020,235,1080,245.3C1140,256,1200,192,1260,186.7C1320,181,1380,235,1410,261.3L1440,288L1440,0L1410,0C1380,0,1320,0,1260,0C1200,0,1140,0,1080,0C1020,0,960,0,900,0C840,0,780,0,720,0C660,0,600,0,540,0C480,0,420,0,360,0C300,0,240,0,180,0C120,0,60,0,30,0L0,0Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 524 B |
BIN
src/img/campus-life-essentials.png
Normal file
|
After Width: | Height: | Size: 2.9 MiB |
BIN
src/img/lecturehall.jpg
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
src/img/military.webp
Normal file
|
After Width: | Height: | Size: 339 KiB |
BIN
src/img/nav.jpg
Normal file
|
After Width: | Height: | Size: 172 KiB |
BIN
src/img/nutrivend.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/img/resume.pdf
Executable file
BIN
src/img/tech-tower.webp
Normal file
|
After Width: | Height: | Size: 66 KiB |
59
src/react-app-env.d.ts → src/index.d.ts
vendored
@@ -1,57 +1,88 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="react" />
|
||||
/// <reference types="react-dom" />
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
readonly NODE_ENV: 'development' | 'production' | 'test';
|
||||
readonly PUBLIC_URL: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module '*.mdx' {
|
||||
import {MDXProps} from "mdx/types";
|
||||
|
||||
let MDXComponent: (props: MDXProps) => JSX.Element;
|
||||
export default MDXComponent;
|
||||
}
|
||||
|
||||
declare module '*.md' {
|
||||
import {MDXProps} from "mdx/types";
|
||||
|
||||
let MDXComponent: (props: MDXProps) => JSX.Element;
|
||||
export default MDXComponent;
|
||||
}
|
||||
|
||||
declare module '*.pdf' {
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.avif' {
|
||||
const src: string;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.bmp' {
|
||||
const src: string;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.gif' {
|
||||
const src: string;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.jpg' {
|
||||
const src: string;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.jpeg' {
|
||||
const src: string;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.png' {
|
||||
const src: string;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.webp' {
|
||||
const src: string;
|
||||
export default src;
|
||||
import {Path} from "./router/router";
|
||||
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.svg' {
|
||||
import {Path} from "./router/router";
|
||||
import * as React from 'react';
|
||||
|
||||
export const ReactComponent: React.FunctionComponent<React.SVGProps<
|
||||
SVGSVGElement
|
||||
> & { title?: string }>;
|
||||
|
||||
const src: string;
|
||||
const src: Path;
|
||||
export default src;
|
||||
}
|
||||
|
||||
29
src/index.sass
Normal file
@@ -0,0 +1,29 @@
|
||||
$phone: 750px
|
||||
|
||||
html, body
|
||||
margin: 0
|
||||
padding: 0
|
||||
font-family: Inter, sans-serif
|
||||
-webkit-font-smoothing: antialiased
|
||||
-moz-osx-font-smoothing: grayscale
|
||||
width: 100vw
|
||||
overflow-x: hidden
|
||||
|
||||
#root
|
||||
display: flex
|
||||
flex-direction: column
|
||||
min-height: 100vh
|
||||
background: black
|
||||
color: white
|
||||
|
||||
// disable image dragging
|
||||
img
|
||||
user-select: none
|
||||
pointer-events: none
|
||||
|
||||
button
|
||||
background: none
|
||||
border: none
|
||||
padding: 0
|
||||
color: white
|
||||
cursor: pointer
|
||||
@@ -1,24 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: black;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: white;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
|
||||
button {
|
||||
background: none;
|
||||
border: none;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -1,17 +1,11 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.scss';
|
||||
import './index.sass';
|
||||
import {RouterProvider} from "./router/RouterContext";
|
||||
import {Route} from "./router/Route";
|
||||
import "@fontsource/inter"; // Defaults to weight 400
|
||||
import "@fontsource/inter/400.css"; // Specify weight
|
||||
import "@fontsource/inter/400-italic.css"; // Specify weight and style
|
||||
import "@fontsource/neuton"; // Defaults to weight 400
|
||||
import "@fontsource/neuton/400.css"; // Specify weight
|
||||
import "@fontsource/neuton/400-italic.css"; // Specify weight and style
|
||||
import "@fontsource/neuton";
|
||||
import {Routes} from "./router/Route";
|
||||
|
||||
const Canvas = React.lazy(() => import("./index/Canvas"));
|
||||
const About = React.lazy(() => import("./about/AboutPage"));
|
||||
const Nav = React.lazy(() => import("./nav/Nav"));
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
@@ -22,12 +16,7 @@ root.render(
|
||||
<React.StrictMode>
|
||||
<RouterProvider>
|
||||
<Nav/>
|
||||
<Route path="/">
|
||||
<Canvas/>
|
||||
</Route>
|
||||
<Route path="/about">
|
||||
<About/>
|
||||
</Route>
|
||||
<Routes/>
|
||||
</RouterProvider>
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
@@ -1,42 +1,86 @@
|
||||
import "./canvas.sass";
|
||||
import {motion} from "framer-motion";
|
||||
import "./canvas.scss";
|
||||
import {Canvas as ThreeCanvas, useFrame} from "@react-three/fiber";
|
||||
import React, {useMemo, useRef, useState} from "react";
|
||||
import {Mesh, Vector3} from "three";
|
||||
import {Moon} from "./Moon";
|
||||
import {Stars} from "./Stars";
|
||||
import {Environment, Html, OrbitControls, Preload, useTexture} from "@react-three/drei";
|
||||
import Jupiter from "../img/2k_jupiter.webp";
|
||||
import Makemake from "../img/2k_makemake_fictional.webp";
|
||||
import Ceres from "../img/2k_ceres_fictional.webp";
|
||||
import Haumea from "../img/2k_haumea_fictional.webp";
|
||||
import MilkyWay from "../img/2k_stars_milky_way.jpg";
|
||||
import SaturnRings from "../img/12k_jupiter_rings.webp";
|
||||
import {useRef} from "react";
|
||||
import type {Mesh} from "three";
|
||||
import {Bloom, EffectComposer, Vignette} from "@react-three/postprocessing";
|
||||
|
||||
useTexture.preload([Jupiter, Makemake, Ceres, Haumea, MilkyWay, SaturnRings]);
|
||||
|
||||
export default function Canvas() {
|
||||
|
||||
// fade animation sync with loading
|
||||
return (
|
||||
<main>
|
||||
<ThreeCanvas gl={{antialias: true, alpha: true}} >
|
||||
<Sphere/>
|
||||
<Moon radius={8} color="pink" step={0.01}/>
|
||||
<Moon radius={6} color="grey" step={0.02}/>
|
||||
<Moon radius={4} color="green" step={0.03}/>
|
||||
<Stars/>
|
||||
<directionalLight color="#E3A857" args={[1,10]} position={[100,10,100]} />
|
||||
<motion.main className="canvas">
|
||||
<section className="canvas-ctr">
|
||||
<ThreeCanvas camera={{position: [0,0,10]}} shadows dpr={[1, 2]}>
|
||||
<EffectComposer>
|
||||
<Bloom luminanceThreshold={0} luminanceSmoothing={0.9} />
|
||||
<Vignette eskil={false} offset={0.1} darkness={1.1} />
|
||||
</EffectComposer>
|
||||
<OrbitControls enablePan={false} enableZoom={false} />
|
||||
<Environment background files={MilkyWay}/>
|
||||
<Sun/>
|
||||
<Moons/>
|
||||
<Planet/>
|
||||
<Html center transform position={[0,0,2]}>
|
||||
<h1 className="welcome">
|
||||
Welcome to my blog
|
||||
</h1>
|
||||
</Html>
|
||||
<Preload all />
|
||||
</ThreeCanvas>
|
||||
<motion.h2 className="welcome" animate={{ rotate: 360 }}>
|
||||
Welcome to my blog
|
||||
</motion.h2>
|
||||
</main>
|
||||
</section>
|
||||
<h3 className="tooltip">
|
||||
Drag to orbit
|
||||
</h3>
|
||||
</motion.main>
|
||||
)
|
||||
}
|
||||
|
||||
function Sphere() {
|
||||
useFrame(state => {
|
||||
const { x, y } = state.pointer
|
||||
// Smoothly interpolate the camera position
|
||||
// We multiply by a factor (e.g., 5) to increase the range of movement
|
||||
state.camera.position.lerp(new Vector3(x * 10, y * 10, 5), 0.1)
|
||||
// Always keep the camera looking at the center
|
||||
state.camera.lookAt(0, 0, 0)
|
||||
})
|
||||
export function Sun() {
|
||||
return (
|
||||
<mesh position={[-100, 0, -100]}>
|
||||
<sphereGeometry args={[5, 32, 32]} />
|
||||
<meshBasicMaterial color={[10, 7, 3]} />
|
||||
<directionalLight intensity={2} position={[0, 0, 0]} />
|
||||
</mesh>
|
||||
)
|
||||
}
|
||||
|
||||
return <mesh position={[0,0,0]}>
|
||||
<sphereGeometry />
|
||||
<meshPhysicalMaterial color="blue" iridescence={.5} />
|
||||
function Moons() {
|
||||
const makemake = useTexture(Makemake);
|
||||
const haumea = useTexture(Haumea);
|
||||
const ceres = useTexture(Ceres);
|
||||
|
||||
return <>
|
||||
<Moon radius={8} color="pink" map={makemake} step={0.01}/>
|
||||
<Moon radius={6} color="grey" map={haumea} step={0.02}/>
|
||||
<Moon radius={4} color="green" map={ceres} step={0.03}/>
|
||||
</>
|
||||
}
|
||||
|
||||
|
||||
function Planet() {
|
||||
const colorMap = useTexture(Jupiter);
|
||||
const planetRef = useRef<Mesh>(null);
|
||||
|
||||
// add planet spin
|
||||
useFrame(() => {
|
||||
if(!planetRef.current) return;
|
||||
|
||||
planetRef.current.rotation.y += 0.005;
|
||||
});
|
||||
|
||||
return <mesh castShadow ref={planetRef} position={[0,0,0]}>
|
||||
<sphereGeometry args={[1, 32, 32]} />
|
||||
<meshPhysicalMaterial map={colorMap} color="orange" iridescence={1} />
|
||||
</mesh>
|
||||
}
|
||||
@@ -1,28 +1,29 @@
|
||||
import {useMemo, useRef, useState} from "react";
|
||||
import {Mesh} from "three";
|
||||
import {useRef} from "react";
|
||||
import type {Mesh} from "three";
|
||||
import {useFrame} from "@react-three/fiber";
|
||||
|
||||
export function Moon(props: {radius: number, color: string, step: number}) {
|
||||
const {radius, color, step} = props;
|
||||
export function Moon(props: {radius: number, color: string, map: any, step: number}) {
|
||||
const {radius, color, map, step} = props;
|
||||
const moonRef = useRef<Mesh>(null);
|
||||
const [theta, setTheta] = useState(0);
|
||||
const thetaRef = useRef(0);
|
||||
|
||||
useFrame(() => {
|
||||
if(!moonRef.current) return;
|
||||
|
||||
moonRef.current.position.set(
|
||||
radius * Math.sin(theta),
|
||||
radius * Math.sin(thetaRef.current),
|
||||
0,
|
||||
radius * Math.cos(theta),
|
||||
)
|
||||
radius * Math.cos(thetaRef.current),
|
||||
);
|
||||
moonRef.current.rotation.y += 0.001;
|
||||
|
||||
setTheta(theta + step);
|
||||
thetaRef.current += step / 3;
|
||||
})
|
||||
|
||||
return (
|
||||
<mesh ref={moonRef} position={[0,0,0]}>
|
||||
<sphereGeometry args={[.5]} />
|
||||
<meshPhysicalMaterial color={color} iridescence={0.2} />
|
||||
<meshPhysicalMaterial color={color} map={map} iridescence={1} />
|
||||
</mesh>
|
||||
)
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
import {useMemo} from "react";
|
||||
|
||||
const RADIUS = 20;
|
||||
const COUNT = 100;
|
||||
type Coordinate = [number, number, number];
|
||||
export function Stars() {
|
||||
const positions = useMemo(() => {
|
||||
const positions: Coordinate[] = [];
|
||||
for(let i = 0; i < COUNT; i++) {
|
||||
const u = Math.random();
|
||||
const v = Math.random();
|
||||
|
||||
const theta = 2 * Math.PI * u;
|
||||
const phi = Math.acos(2 * v - 1);
|
||||
|
||||
// x = r*sin(theta)*cos(phi)
|
||||
// x = r*sin(theta)*sin(phi)
|
||||
// z = r*cos(phi)
|
||||
positions.push([
|
||||
RADIUS * Math.sin(phi) * Math.cos(theta),
|
||||
RADIUS * Math.sin(phi) * Math.sin(theta),
|
||||
RADIUS * Math.cos(phi),
|
||||
])
|
||||
}
|
||||
return positions;
|
||||
}, []);
|
||||
|
||||
return positions.map(coord => <mesh position={coord}>
|
||||
<sphereGeometry args={[.1]} />
|
||||
<meshBasicMaterial />
|
||||
</mesh>
|
||||
)
|
||||
}
|
||||
23
src/index/canvas.sass
Normal file
@@ -0,0 +1,23 @@
|
||||
@use "../index"
|
||||
|
||||
.canvas
|
||||
display: flex
|
||||
flex-direction: column
|
||||
justify-content: center
|
||||
align-items: center
|
||||
|
||||
.canvas-ctr
|
||||
width: 100%
|
||||
height: calc(100vh - 100px)
|
||||
display: flex
|
||||
flex-direction: column
|
||||
flex-grow: 1
|
||||
|
||||
.welcome
|
||||
font-family: Neuton, serif
|
||||
|
||||
.tooltip
|
||||
align-self: flex-end
|
||||
position: fixed
|
||||
bottom: 0
|
||||
right: 15px
|
||||
@@ -1,19 +0,0 @@
|
||||
main {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: black;
|
||||
color: white;
|
||||
z-index: -999;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.welcome {
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: calc(50% + 50px);
|
||||
font-family: Neuton;
|
||||
font-size: 30px;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3"><g fill="#61DAFB"><path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/><circle cx="420.9" cy="296.5" r="45.7"/><path d="M520.5 78.1z"/></g></svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,21 +1,27 @@
|
||||
import React, {useState} from "react";
|
||||
import {Link} from "../router/Link";
|
||||
import {motion} from "framer-motion";
|
||||
import {ROUTES} from "../router/Route";
|
||||
import ResumePdf from "../img/resume.pdf";
|
||||
import {motion} from "motion/react";
|
||||
import {Path} from "../router/router";
|
||||
|
||||
export function Links() {
|
||||
const [links, setLinks] = useState(["About", "Articles"]);
|
||||
|
||||
return <div className="links">
|
||||
{ links.map(() => /* add spacers for flexbox */ <div/> )}
|
||||
<Title/>
|
||||
{ links.map(link => <Link href={`/${link}`}><h3>{link}</h3></Link>) }
|
||||
</div>
|
||||
}
|
||||
|
||||
function Title() {
|
||||
return (
|
||||
<Link href="/" className="name">
|
||||
<motion.h1 className="name">Tymur Arsentiev</motion.h1>
|
||||
<motion.h1>Tymur Arsentiev</motion.h1>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
{
|
||||
ROUTES.map(([path, name]) =>
|
||||
<Link key={path} href={path}>
|
||||
<h3>{name}</h3>
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
<Link key={ResumePdf} href={ResumePdf} target="_blank">
|
||||
<h3>Resume</h3>
|
||||
</Link>
|
||||
<Link key="Github" href={"https://github.com/tymur999" as Path} target="_blank">
|
||||
<h3>GitHub</h3>
|
||||
</Link>
|
||||
</div>
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import "./menu.scss";
|
||||
import {motion, animate} from "framer-motion";
|
||||
import {useEffect} from "react";
|
||||
|
||||
const articles = [
|
||||
"Test 123",
|
||||
"Hello",
|
||||
"Title of Album"
|
||||
];
|
||||
const hidden = -999;
|
||||
|
||||
export function Menu({active} : {active: boolean}) {
|
||||
useEffect(() => {
|
||||
if(active) {
|
||||
animate(".menu", {left : 0})
|
||||
} else {
|
||||
animate(".menu", {left : hidden})
|
||||
}
|
||||
}, [active]);
|
||||
|
||||
return (
|
||||
<motion.section initial={{left: hidden}} className="menu">
|
||||
{
|
||||
articles.map(title => <div>
|
||||
{title}
|
||||
</div>)
|
||||
}
|
||||
</motion.section>
|
||||
)
|
||||
}
|
||||
@@ -1,37 +1,12 @@
|
||||
import React, {useState} from "react";
|
||||
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
|
||||
import {faBars} from "@fortawesome/free-solid-svg-icons/faBars";
|
||||
import {Menu} from "./Menu";
|
||||
import wave from "../img/menu-wave.svg";
|
||||
import "./nav.scss";
|
||||
import {motion} from "framer-motion";
|
||||
import {Link} from "../router/Link";
|
||||
import {Path} from "../router/router";
|
||||
import {ReactComponent as Wave} from "../img/menu-wave.svg";
|
||||
import "./nav.sass";
|
||||
import {Links} from "./Links";
|
||||
|
||||
export default function Nav() {
|
||||
const [active, setActive] = useState(false);
|
||||
|
||||
return <>
|
||||
return <div>
|
||||
<nav>
|
||||
<MenuButton active={active} setActive={setActive}/>
|
||||
<Links/>
|
||||
</nav>
|
||||
<Menu active={active}/>
|
||||
<img className="wave" alt="wave" src={wave}/>
|
||||
</>;
|
||||
}
|
||||
|
||||
function MenuButton(props : { active: boolean, setActive: (_:boolean) => void }) {
|
||||
const {active, setActive} = props;
|
||||
|
||||
return (
|
||||
<div className="menu-btn">
|
||||
<button>
|
||||
<FontAwesomeIcon icon={faBars} onClick={function() {
|
||||
setActive(!active);
|
||||
}}/>
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
<Wave className="wave" />
|
||||
</div>;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
@import "./nav";
|
||||
|
||||
.menu {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: $menu;
|
||||
z-index: 10;
|
||||
color: white;
|
||||
width: 25%;
|
||||
height: 100vh;
|
||||
|
||||
div {
|
||||
padding: $padding;
|
||||
}
|
||||
}
|
||||
48
src/nav/nav.sass
Normal file
@@ -0,0 +1,48 @@
|
||||
@use "../index"
|
||||
$padding: 15px
|
||||
$menu: #282c34
|
||||
|
||||
.menu-btn
|
||||
align-self: center
|
||||
display: flex
|
||||
flex-direction: column
|
||||
align-items: center
|
||||
font-size: 30px
|
||||
|
||||
|
||||
// hide menu button and center links
|
||||
@media screen and (max-width: index.$phone)
|
||||
.menu-btn
|
||||
display: none
|
||||
position: absolute
|
||||
|
||||
.links
|
||||
justify-content: center
|
||||
|
||||
nav
|
||||
background-color: $menu
|
||||
padding: $padding
|
||||
display: flex
|
||||
align-items: center
|
||||
justify-content: center
|
||||
|
||||
.name
|
||||
margin: auto
|
||||
h1
|
||||
margin: auto 0
|
||||
font-size: 40px
|
||||
|
||||
.links
|
||||
flex-grow: 1
|
||||
justify-content: flex-end
|
||||
align-items: center
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
gap: 15px
|
||||
|
||||
|
||||
.wave
|
||||
z-index: 999
|
||||
user-select: none
|
||||
pointer-events: none
|
||||
position: absolute
|
||||
@@ -1,57 +0,0 @@
|
||||
$padding: 15px;
|
||||
$menu: #282c34;
|
||||
|
||||
.menu-btn>button:hover {
|
||||
opacity: 90%;
|
||||
}
|
||||
|
||||
.menu-btn>button:active {
|
||||
opacity: 80%;
|
||||
}
|
||||
|
||||
.menu-btn {
|
||||
align-self: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
button {
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
nav {
|
||||
background-color: $menu;
|
||||
padding: $padding;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
nav>a{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.name>h1 {
|
||||
margin: 0;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
.name {
|
||||
margin: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wave {
|
||||
user-select: none;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.nav {
|
||||
font-family: Inter;
|
||||
}
|
||||
@@ -1,21 +1,35 @@
|
||||
import "./link.scss";
|
||||
import "./link.sass";
|
||||
|
||||
import React, {PropsWithChildren} from "react";
|
||||
import React, {HTMLProps, ReactNode} from "react";
|
||||
import {useRouter} from "./RouterContext";
|
||||
import {Path} from "./router";
|
||||
|
||||
export function Link(props: {className?: string, href: Path, replace?: boolean } & PropsWithChildren) {
|
||||
const {children, className, href, replace} = props;
|
||||
export function Link(props: {href: Path, children : ReactNode, target?: '_blank' } & HTMLProps<HTMLAnchorElement>) {
|
||||
let {children, className, href} = props;
|
||||
const router = useRouter();
|
||||
className = `${className ?? ""} link`.trim();
|
||||
|
||||
function onClick(event: React.MouseEvent) {
|
||||
// event.preventDefault();
|
||||
if(replace) {
|
||||
router.replacePage(props.href);
|
||||
} else {
|
||||
router.pushPage(props.href);
|
||||
}
|
||||
// perform the default action if _blank
|
||||
if(props.target === "_blank") {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
if(window.location.pathname === href) {
|
||||
router.replacePage(props.href);
|
||||
} else {
|
||||
router.pushPage(props.href);
|
||||
}
|
||||
}
|
||||
|
||||
return <a onClick={onClick} href={href} className={`${className} link`}>{children}</a>
|
||||
}
|
||||
return <a {...props} onClick={onClick} className={className}>
|
||||
{children}
|
||||
</a>
|
||||
}
|
||||
|
||||
export function ExternalLink(props: HTMLProps<HTMLAnchorElement>) {
|
||||
return (
|
||||
<Link {...props} href={props.href as Path} className="external-link" target="_blank">{props.children}</Link>
|
||||
)
|
||||
}
|
||||
|
||||