Skip to content

Commit

Permalink
Initializing the project with strip-down instance of ReCodEx webapp.
Browse files Browse the repository at this point in the history
  • Loading branch information
krulis-martin committed Dec 6, 2024
1 parent c37900b commit 05f92a2
Show file tree
Hide file tree
Showing 235 changed files with 27,984 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
["formatjs", {
"ast": true
}],
"transform-object-assign",
"transform-flow-strip-types",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-runtime",
["prismjs", {
"languages": [
"csharp",
"css",
"go",
"groovy",
"java",
"javascript",
"kotlin",
"markdown",
"pascal",
"php",
"python",
"rust",
"scala",
"typescript",
"bash",
"cpp",
"haskell",
"cshtml",
"arduino",
"prolog",
"bash",
"sql",
"bison"
],
"theme": "default",
"css": true
}]
],
"env": {
"production": {
"plugins": [
"@babel/plugin-transform-react-inline-elements"
]
}
}
}
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
13 changes: 13 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
NODE_ENV=production
# WEBPACK_DEV_SERVER_PORT=8081 # might be usefull for dev environment, if port 8081 is necessary for something

# LOGGER_MIDDLEWARE is active only if NODE_ENV=development

# verbose debug action logging
LOGGER_MIDDLEWARE_VERBOSE=false

# log complete dump of exceptions
LOGGER_MIDDLEWARE_EXCEPTIONS=true

# manual specification of footer version
# VERSION=1.0.0
7 changes: 7 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ignore]

[include]

[libs]

[options]
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.js text eol=lf
24 changes: 24 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Issue Description

<!-- Write down your issue or question. -->

## Environment

<!-- Please provide your Operating System and your web browser with appropriate versions. -->

## Steps to Reproduce

1.
2.

## Expected Behaviour

<!-- What was the expected behaviour. -->

## Actual Results

<!--
What did actually happen.
Please give us examples and ideally support it with screenshots or error messages from our notification system or from browser console.
Browser console can be usually displayed by hitting F12, if not please follow your browser instructions.
-->
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: ['20']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
- run: corepack enable
- run: yarn install
- run: yarn test

lint:
runs-on: ubuntu-24.04
strategy:
matrix:
node-version: ['20']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
- run: corepack enable
- run: yarn install
- run: yarn lint
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
node_modules
node_modules/.bin/*
.DS_Store
public/bundle.js
public/bundle.js.map
public/
bin/*.jpg
bin/*.css
bin/server.mjs
bin/server.mjs.map
tmp
build
npm-debug.log
.env
.vscode
prod/
package-lock.json

/run_server.bat
/run_manage_translations.bat
/etc/env.json
/bin/server.mjs.LICENSE.txt
/yarn-error.log
/.yarn/cache
/.yarn/install-state.gz
17 changes: 17 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"parser": "babel",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"endOfLine": "auto"
}
546 changes: 546 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions .yarn/releases/yarn-3.2.2.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.2.2.cjs
77 changes: 77 additions & 0 deletions bin/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import Express from 'express';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import path from 'path';
import { fileURLToPath } from 'url';
import config from '../config/webpack.config-dev.js';
import colors from 'colors';
import fs from 'fs';

const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file
const __dirname = path.dirname(__filename); // get the name of the directory

const WEBPACK_DEV_SERVER_PORT = process.env.WEBPACK_DEV_SERVER_PORT || 8081;
const fileConfig = fs.readFileSync('etc/env.json', 'utf8');
const parsedConfig = JSON.parse(fileConfig);
const PORT = parsedConfig.PORT;
const SKIN = parsedConfig.SKIN;
const urlPrefix = parsedConfig.URL_PATH_PREFIX || '';

const app = new Express();
app.set('view engine', 'ejs');
app.use(urlPrefix, Express.static(path.join(__dirname, '../public')));

app.get('*', (req, res) => {
res.render('index', {
html: '',
head: {
htmlAttributes: 'lang="cs"',
title: '<title>ReCodEx</title>',
meta: '',
link: '',
},
reduxState: undefined,
skin: SKIN,
style: `http://localhost:${WEBPACK_DEV_SERVER_PORT}/style.css`,
bundle: `http://localhost:${WEBPACK_DEV_SERVER_PORT}/bundle.js`,
config: fileConfig,
urlPrefix,
});
});

const server = new WebpackDevServer(
{
static: {
directory: path.join(__dirname, '..', 'public'),
},
hot: true,
host: 'localhost',
port: WEBPACK_DEV_SERVER_PORT,
devMiddleware: {
stats: { colors: true },
publicPath: '/',
},
},
webpack(config)
);

(async () => {
await server.start();
console.log(
`${colors.yellow('WebpackDevServer')} is running on ${colors.underline(
`http://localhost:${WEBPACK_DEV_SERVER_PORT}`
)}`
);
})();
/*
server.listen(WEBPACK_DEV_SERVER_PORT, 'localhost', () => {
console.log(
`${colors.yellow('WebpackDevServer')} is running on ${colors.underline(
`http://localhost:${WEBPACK_DEV_SERVER_PORT}`
)}`
);
});
*/
app.listen(PORT, () => {
console.log(`${colors.green('WebApp')} is running on ${colors.underline(`http://localhost:${PORT}`)}`);
});
Loading

0 comments on commit 05f92a2

Please sign in to comment.