Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["@babel/preset-react", "@babel/preset-env"],
"plugins": [
["@babel/transform-runtime"]
]
}
6 changes: 6 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
Dockerfile
.git
.gitignore
.dockerignore
# .env
116 changes: 116 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
8 changes: 8 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node
WORKDIR /app
COPY package.json .
RUN yarn
COPY . .
ENV REACT_APP_NAME=myName
EXPOSE 3400
CMD ["yarn", "start"]
29 changes: 29 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# => Build container
FROM node:alpine as builder
WORKDIR /app
COPY package.json .
RUN yarn install
COPY . .
ENV REACT_APP_NAME=myName
RUN yarn build

# => Run container
FROM nginx:1.15.2-alpine

# Nginx config
RUN rm -rf /etc/nginx/conf.d
COPY conf /etc/nginx

# Static build
COPY --from=builder /app/dist /usr/share/nginx/html/

# Default port exposure
EXPOSE 80

# Copy .env file and shell script to container
WORKDIR /usr/share/nginx/html
# COPY ./env.sh .
COPY .env .

# # Start Nginx server
# CMD ["/bin/sh", "-c", "nginx -g \"daemon off;\""]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Expires map
map $sent_http_content_type $expires {
default off;
text/html epoch;
text/css max;
application/json max;
application/javascript max;
~image/ max;
}

server {
listen 80;
listen [::]:80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
# error_page 404 =200 /index.html;
expires -1; # Set it to different value depending on your standard requirements
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
24 changes: 24 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/conf/conf.d/gzip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
gzip on;
gzip_http_version 1.0;
gzip_comp_level 5; # 1-9
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;

# MIME-types
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component;
38 changes: 38 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "cgen-builder-webapp",
"version": "1.0.0",
"scripts": {
"build": "webpack --mode production",
"build:dev": "webpack --mode development",
"build:start": "cd dist && PORT=3400 npx serve",
"start": "webpack serve --open --mode development",
"start:live": "webpack serve --open --mode development --live-reload --hot"
},
"license": "MIT",
"author": {
"name": "Jack Herrington",
"email": "jherr@pobox.com"
},
"devDependencies": {
"@babel/core": "^7.15.8",
"@babel/plugin-transform-runtime": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"@babel/preset-react": "^7.14.5",
"autoprefixer": "^10.1.0",
"babel-loader": "^8.2.2",
"css-loader": "^6.3.0",
"html-webpack-plugin": "^5.3.2",
"postcss": "^8.2.1",
"postcss-loader": "^4.1.0",
"style-loader": "^3.3.0",
"webpack": "^5.57.1",
"webpack-cli": "^4.9.0",
"webpack-dev-server": "^4.3.1",
"tailwindcss": "^2.0.2"
},
"dependencies": {
"@babel/runtime": "^7.13.10",
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
6 changes: 6 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const autoprefixer = require("autoprefixer");
const tailwindcss = require("tailwindcss");

module.exports = {
plugins: [tailwindcss, autoprefixer],
};
14 changes: 14 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import ReactDOM from "react-dom";

import "./index.scss";

const App = () => (
<div className="mt-10 text-3xl mx-auto max-w-6xl">
<div>Name: cgen-builder-webapp</div>
<div>Framework: react</div>
<div>Language: JavaScript</div>
<div>CSS: Tailwind</div>
</div>
);
ReactDOM.render(<App />, document.getElementById("app"));
14 changes: 14 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>cgen-builder-webapp</title>
</head>

<body>
<div id="app"></div>
</body>

</html>
1 change: 1 addition & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import("./App");
7 changes: 7 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/src/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
font-family: Arial, Helvetica, sans-serif;
}
15 changes: 15 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
extend: {
spacing:{
18: "4.5rem"
}
},
},
variants: {
extend: {},
},
plugins: [],
}
64 changes: 64 additions & 0 deletions src/WebApps/CGenWebApp/cgen-builder-webapp/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const HtmlWebPackPlugin = require("html-webpack-plugin");
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");

const deps = require("./package.json").dependencies;
module.exports = {
output: {
publicPath: "./",
},

resolve: {
extensions: [".tsx", ".ts", ".jsx", ".js", ".json"],
},

devServer: {
port: 3400,
historyApiFallback: true,
},

module: {
rules: [
{
test: /\.m?js/,
type: "javascript/auto",
resolve: {
fullySpecified: false,
},
},
{
test: /\.(css|s[ac]ss)$/i,
use: ["style-loader", "css-loader", "postcss-loader"],
},
{
test: /\.(ts|tsx|js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
},
},
],
},

plugins: [
new ModuleFederationPlugin({
name: "cgen_builder_webapp",
filename: "remoteEntry.js",
remotes: {},
exposes: {},
shared: {
...deps,
react: {
singleton: true,
requiredVersion: deps.react,
},
"react-dom": {
singleton: true,
requiredVersion: deps["react-dom"],
},
},
}),
new HtmlWebPackPlugin({
template: "./src/index.html",
}),
],
};
Loading