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
1 change: 1 addition & 0 deletions .claude/ProjectName
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
InGeorgianLari
54 changes: 54 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build and Test

# Run on PRs and pushes to any branch
on:
push:
branches: [ '**' ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal --configuration Release

- name: Publish
run: dotnet publish InGeorgianLari.csproj -c Release -o artifacts --nologo

# Upload build artifacts for inspection
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts-${{ github.sha }}
path: artifacts/
retention-days: 7

# Add build status comment to PR
- name: Comment PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ Build succeeded! The Blazor WASM app compiled successfully.'
})
87 changes: 87 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Deploy Preview to GitHub Pages

# Allow manual trigger from any branch
on:
workflow_dispatch:
inputs:
environment:
description: 'Deployment environment name'
required: false
default: 'preview'
type: string

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "pages-preview"
cancel-in-progress: true

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Publish
run: dotnet publish InGeorgianLari.csproj -c Release -o release --nologo

# Change base tag in index.html to match GitHub Pages subdirectory
- name: Change base tag
run: sed -i 's/<base href="\/" \/>/<base href="\/InGeorgianLari\/" \/>/g' release/wwwroot/index.html

# Copy index.html to 404.html to handle SPA routing
- name: Copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html

# Add .nojekyll file to tell GitHub Pages to not process files
- name: Add .nojekyll file
run: touch release/wwwroot/.nojekyll

# Add branch info file for preview identification
- name: Add branch info
run: |
echo "Branch: ${{ github.ref_name }}" > release/wwwroot/branch-info.txt
echo "Commit: ${{ github.sha }}" >> release/wwwroot/branch-info.txt
echo "Deployed: $(date -u +"%Y-%m-%d %H:%M:%S UTC")" >> release/wwwroot/branch-info.txt

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: release/wwwroot

# Deployment job
deploy:
environment:
name: ${{ inputs.environment || 'preview' }}
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

- name: Print deployment info
run: |
echo "🚀 Preview deployed!"
echo "📍 URL: ${{ steps.deployment.outputs.page_url }}"
echo "🌿 Branch: ${{ github.ref_name }}"
echo "📝 Commit: ${{ github.sha }}"
77 changes: 77 additions & 0 deletions .github/workflows/deploy-to-github-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Deploy to GitHub Pages

# Run workflow on every push to main branch
on:
push:
branches: [ main ]
# Allow manual trigger
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore

- name: Publish
run: dotnet publish InGeorgianLari.csproj -c Release -o release --nologo

# Change base tag in index.html to match GitHub Pages subdirectory
- name: Change base tag
run: |
# Check if custom domain exists
if [ -f "wwwroot/CNAME" ]; then
echo "Custom domain detected, keeping base href as /"
else
echo "No custom domain, updating base href for GitHub Pages subdirectory"
sed -i 's/<base href="\/" \/>/<base href="\/InGeorgianLari\/" \/>/g' release/wwwroot/index.html
fi

# Copy index.html to 404.html to handle SPA routing
- name: Copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html

# Add .nojekyll file to tell GitHub Pages to not process files
- name: Add .nojekyll file
run: touch release/wwwroot/.nojekyll

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: release/wwwroot

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
8 changes: 8 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"browser-tools": {
"command": "npx",
"args": ["-y", "@agentdeskai/browser-tools-mcp@1.2.0"]
}
}
}
6 changes: 6 additions & 0 deletions InGeorgianLari.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>47609749-732c-40b4-8e0c-c4058246eb44</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.4" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<Compile Remove="TestApi.cs" />
<Compile Remove="TestProgram.cs" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions InGeorgianLari.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.2.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InGeorgianLari", "InGeorgianLari.csproj", "{D349B586-9C07-545E-82ED-2AE339204C5E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D349B586-9C07-545E-82ED-2AE339204C5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D349B586-9C07-545E-82ED-2AE339204C5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D349B586-9C07-545E-82ED-2AE339204C5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D349B586-9C07-545E-82ED-2AE339204C5E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BDFDEA20-AB0C-491D-A9C5-0321ABF0444B}
EndGlobalSection
EndGlobal
12 changes: 1 addition & 11 deletions Layout/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,7 @@
<nav class="nav flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="counter">
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Counter
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="weather">
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> კონვერტორი
</NavLink>
</div>
</nav>
Expand Down
46 changes: 34 additions & 12 deletions Models/ExchangeRate.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
using System.Text.Json.Serialization;

namespace InGeorgianLari.Models;

// Model for BOG API response structure
public record ExchangeRatesResponse(List<CurrencyRate> Rates);

public record CurrencyRate(
string Currency,
string Code,
int Quantity,
decimal RateFormated,
decimal DiffFormated,
decimal Rate,
string ValidFromDate,
int OrderNo,
decimal Dgtl,
decimal Mid
);
public record CurrencyRate
{
[JsonPropertyName("code")]
public string Code { get; init; } = string.Empty;

[JsonPropertyName("name")]
public string Currency { get; init; } = string.Empty;

[JsonPropertyName("quantity")]
public int Quantity { get; init; }

[JsonPropertyName("rateFormated")]
public string RateFormated { get; init; } = string.Empty;

[JsonPropertyName("diffFormated")]
public string DiffFormated { get; init; } = string.Empty;

[JsonPropertyName("rate")]
public decimal Rate { get; init; }

[JsonPropertyName("date")]
public string ValidFromDate { get; init; } = string.Empty;

[JsonPropertyName("orderNo")]
public int OrderNo { get; init; }

[JsonPropertyName("dgtl")]
public decimal Dgtl { get; init; }

[JsonPropertyName("mid")]
public decimal Mid { get; init; }
}
18 changes: 0 additions & 18 deletions Pages/Counter.razor

This file was deleted.

7 changes: 0 additions & 7 deletions Pages/Home.razor

This file was deleted.

Loading