Compare commits

..

5 Commits

8 changed files with 6032 additions and 28 deletions

52
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
# Frontend
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: 24
registry-url: 'https://npm.pkg.github.com/'
scope: '@danneschs'
- run: npm ci
working-directory: ./src/frontend
env:
NODE_AUTH_TOKEN: ${{ secrets.PACKAGES_FETCH_TOKEN }}
- run: npm run build
working-directory: ./src/frontend
# Backend
- name: Setup .NET
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
with:
dotnet-version: '10.0.x'
- run: dotnet publish backend.csproj -c Release -o ./publish
working-directory: ./src/backend
# Create ZIP
- name: Create Zip Archive
run: zip -r release.zip ./src/frontend/dist ./src/backend/publish
# Release
- name: Create Release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
with:
files: release.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored
View File

@ -1,7 +1,6 @@
dist
node_modules
*.bak
package-lock.json
.idea
bin
obj

View File

@ -72,8 +72,10 @@ public class Program
builder.Services.AddAuthorization();
// Database
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseSqlite("Data Source=Data/app.db"));
options.UseSqlite(connectionString));
// CORS: in dev allow Vite (localhost:5173), in production allow specific domain
var allowedOrigins = builder.Environment.IsDevelopment()
@ -162,4 +164,4 @@ public class Program
app.Run();
}
}
}

View File

@ -4,5 +4,8 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
},
"ConnectionStrings": {
"DefaultConnection": "Data Source=Data/app.db"
},
}

View File

@ -1,27 +1,26 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@bookmarks/*": ["src/bookmarks/*"],
"@auth/*": ["src/auth/*"],
"@objects/*": ["src/objects/*"],
"@styles/*": ["src/styles/*"],
"@bookmarks/*": ["./src/bookmarks/*"],
"@auth/*": ["./src/auth/*"],
"@objects/*": ["./src/objects/*"],
"@styles/*": ["./src/styles/*"],
"@api/*": ["src/api/*"],
"@components/*": ["src/components/*"],
"@forms/*": ["src/components/forms/*"],
"@tables/*": ["src/components/tables/*"],
"@dialogs/*": ["src/components/dialogs/*"],
"@columns/*": ["src/components/columns/*"],
"@atoms/*": ["src/components/atoms/*"],
"@main/*": ["src/*"],
"@backend/*": ["backend/*"],
"@models/*": ["backend/models/*"],
"@routes/*": ["backend/routes/*"],
"@mappers/*": ["src/mappers/*"],
"@config/*": ["src/config/*"]
"@api/*": ["./src/api/*"],
"@components/*": ["./src/components/*"],
"@forms/*": ["./src/components/forms/*"],
"@tables/*": ["./src/components/tables/*"],
"@dialogs/*": ["./src/components/dialogs/*"],
"@columns/*": ["./src/components/columns/*"],
"@atoms/*": ["./src/components/atoms/*"],
"@main/*": ["./src/*"],
"@backend/*": ["./backend/*"],
"@models/*": ["./backend/models/*"],
"@routes/*": ["./backend/routes/*"],
"@mappers/*": ["./src/mappers/*"],
"@config/*": ["./src/config/*"]
},
"moduleResolution": "node"
"moduleResolution": "bundler"
},
"include": ["src", "backend"]
}

5937
src/frontend/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
{
"name": "my-app",
"name": "platbik-fe",
"private": true,
"version": "0.0.0",
"type": "module",
@ -12,7 +12,7 @@
"preview": "vite preview"
},
"dependencies": {
"@danneschs/libnik-ui": "file:../../../libnik-ui/danneschs-libnik-ui-0.1.0.tgz",
"@danneschs/libnik-ui": "^0.1.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@fontsource/roboto": "^5.2.5",
@ -36,6 +36,7 @@
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.19",
"globals": "^15.15.0",
"rollup-plugin-license": "^3.7.1",
"vite": "^6.2.0",
"vite-plugin-singlefile": "^2.2.0"
}

View File

@ -1,4 +1,5 @@
import { defineConfig } from "vite";
import license from 'rollup-plugin-license';
import react from "@vitejs/plugin-react";
import path from "path";
import { fileURLToPath } from "url";
@ -13,7 +14,17 @@ export default defineConfig({
build: {
target: "esnext",
cssCodeSplit: false,
assetsInlineLimit: 100000000, // vše inline
assetsInlineLimit: 100000000,
rollupOptions: {
plugins: [
license({
thirdParty: {
// Creates licenses.txt in dist folder
output: path.resolve(__dirname, './dist/licenses.txt'),
},
}),
],
},
},
resolve: {
alias: {
@ -40,9 +51,9 @@ export default defineConfig({
server: {
proxy: {
"/api": {
target: "http://localhost:5119", // port backendu z launchSettings
target: "http://localhost:5119", // port for backend from launchSettings
changeOrigin: true,
secure: false, // backend není HTTPS
secure: false, // backend is not HTTPS
},
},
},