Skip to content

Commit

Permalink
Merge pull request #207 from GeoWerkstatt/migrate-from-create-react-a…
Browse files Browse the repository at this point in the history
…pp-to-vite

Migrate from create-react-app to vite
  • Loading branch information
patrickackermann authored Jul 9, 2024
2 parents 08c0995 + f0a9794 commit f64df71
Show file tree
Hide file tree
Showing 21 changed files with 6,870 additions and 29,915 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ src/ClientApp/cypress/screenshots
src/ClientApp/coverage

# Production
src/ClientApp/build
src/ClientApp/dist

# Misc
src/ClientApp/.DS_Store
Expand Down
13 changes: 11 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.4'

services:
db:
image: postgres:14
Expand All @@ -17,3 +15,14 @@ services:
PGADMIN_DEFAULT_PASSWORD: FIREGOAT
volumes:
- ./config/pgadmin4-servers.json:/pgadmin4/servers.json
ilimodels:
build:
context: .
dockerfile: Dockerfile
args:
- VERSION=0.0.1
- REVISION=1a2b3c4d
environment:
CONNECTIONSTRINGS__RepoBrowserContext: Host=db;Username=postgres;Password=ARKBONES;Database=repobrowser
ports:
- 8080:8080
13 changes: 13 additions & 0 deletions launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"profiles": {
"Docker Compose": {
"commandName": "DockerCompose",
"commandVersion": "1.0",
"serviceActions": {
"db": "StartWithoutDebugging",
"ilimodels": "DoNotStart",
"pgadmin": "StartWithoutDebugging"
}
}
}
}
12 changes: 6 additions & 6 deletions src/ClientApp/aspnetcore-https.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This script sets up HTTPS for the application using the ASP.NET Core HTTPS certificate
const fs = require('fs');
const spawn = require('child_process').spawn;
const path = require('path');
import { existsSync } from "fs";
import { spawn } from "child_process";
import { join } from "path";

const baseFolder =
process.env.APPDATA !== undefined && process.env.APPDATA !== ''
Expand All @@ -16,10 +16,10 @@ if (!certificateName) {
process.exit(-1);
}

const certFilePath = path.join(baseFolder, `${certificateName}.pem`);
const keyFilePath = path.join(baseFolder, `${certificateName}.key`);
const certFilePath = join(baseFolder, `${certificateName}.pem`);
const keyFilePath = join(baseFolder, `${certificateName}.key`);

if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) {
if (!existsSync(certFilePath) || !existsSync(keyFilePath)) {
spawn('dotnet', [
'dev-certs',
'https',
Expand Down
18 changes: 9 additions & 9 deletions src/ClientApp/aspnetcore-react.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// This script configures the .env.development.local file with additional environment variables to configure HTTPS using the ASP.NET Core
// development certificate in the webpack development proxy.

const fs = require('fs');
const path = require('path');
import { existsSync, writeFileSync, readFileSync, appendFileSync } from "fs";
import { join } from "path";

const baseFolder =
process.env.APPDATA !== undefined && process.env.APPDATA !== ''
Expand All @@ -17,17 +17,17 @@ if (!certificateName) {
process.exit(-1);
}

const certFilePath = path.join(baseFolder, `${certificateName}.pem`);
const keyFilePath = path.join(baseFolder, `${certificateName}.key`);
const certFilePath = join(baseFolder, `${certificateName}.pem`);
const keyFilePath = join(baseFolder, `${certificateName}.key`);

if (!fs.existsSync('.env.development.local')) {
fs.writeFileSync(
if (!existsSync('.env.development.local')) {
writeFileSync(
'.env.development.local',
`SSL_CRT_FILE=${certFilePath}
SSL_KEY_FILE=${keyFilePath}`
);
} else {
let lines = fs.readFileSync('.env.development.local')
let lines = readFileSync('.env.development.local')
.toString()
.split('\n');

Expand All @@ -41,13 +41,13 @@ SSL_KEY_FILE=${keyFilePath}`
}
}
if (!hasCert) {
fs.appendFileSync(
appendFileSync(
'.env.development.local',
`\nSSL_CRT_FILE=${certFilePath}`
);
}
if (!hasCertKey) {
fs.appendFileSync(
appendFileSync(
'.env.development.local',
`\nSSL_KEY_FILE=${keyFilePath}`
);
Expand Down
7 changes: 4 additions & 3 deletions src/ClientApp/public/index.html → src/ClientApp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<base href="%PUBLIC_URL%/" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<base href="/" />
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
<title>INTERLIS Model Browser</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
Loading

0 comments on commit f64df71

Please sign in to comment.