diff --git a/.env.sample b/.env.sample index 9a41187..6dd5f1f 100755 --- a/.env.sample +++ b/.env.sample @@ -1,7 +1,7 @@ BASE_URL="https://zv.example.org" AUTH_SECRET="Ah6Lm3h8Qmnhm8oDfw09AOUYEOMKpzfqIFPjBA2waLPm9SD65BA1eSXde9OS80nE" -DATABASE_URL="Server=aptabase_db;Port=5432;User Id=aptabase;Password=0000000000000000000000000000000000000000000000000000000000000000;Database=aptabase" -CLICKHOUSE_URL="Host=aptabase_events_db;Port=8123;Username=aptabase;Password=0000000000000000000000000000000000000000000000000000000000000000" +DATABASE_URL="Server=zalvena_database;Port=5432;User Id=zalvena;Password=0000000000000000000000000000000000000000000000000000000000000000;Database=zalvena" +CLICKHOUSE_URL="Host=zalvena_events;Port=8123;Username=zalvena;Password=0000000000000000000000000000000000000000000000000000000000000000" SMTP_HOST="smtp.resend.com" SMTP_PORT="465" SMTP_USERNAME="resend" diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..f4679a0 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,73 @@ +# Changelog + +## v0.0.4 + | New Login Page | New Registration Page | + |-|-| + | | | + + | New Login Email | New Registration Email | + |-|-| + | | | + + - Added new email templates + - Added new logo + - Added new designs of the login and registration screens + - Updated `Aptabase` backend functions to be renamed to `Zalvena` + - Updated `` component and add `Mars` server + - Updated cloud origin policy to use official Zalvena domains + - `https://events.sudovanilla.org/` + - `https://beta.events.sudovanilla.org/` + - Removed official Aptabase servers in `regions`, replaced with official Zalvena server + - Removed billing + +## v0.0.1 - v0.0.3 + - Updated app key generation to use `ZV` instead of `SH` + - Updated the name "Aptabase" to "Zalvena" in some sections + - Updated browserslist + - Updated `node:18` to `over/bun:1` in `Dockerfile` + - Updated the pacakge `@types/node` from `20.8.7` to `22.13.4` + - Updated the pacakge `@types/react` from `18.2.30` to `19.0.10` + - Updated the pacakge `@types/react-dom` from `18.2.14` to `19.0.4` + - Updated the pacakge `@vitejs/plugin-react-swc` from `3.4.0` to `3.8.0` + - Updated the pacakge `autoprefixer` from `10.4.16` to `10.4.20` + - Updated the pacakge `postcss` from `8.4.31` to `8.5.3` + - Updated the pacakge `tailwind-merge` from `1.14.0` to `3.0.1` + - Updated the pacakge `typescript` from `5.2.2` to `5.7.3` + - Updated the pacakge `vite` from `4.5.3` to `6.1.1` + - Updated the pacakge `vite-plugin-mkcert` from `1.17.5` to `1.17.6` + - Updated the pacakge `@aptabase/web` from `0.4.0` to `0.4.3` + - Updated the pacakge `@fontsource/inter` from `5.0.14` to `5.1.1` + - Updated the pacakge `@headlessui/react` from `2.1.2` to `2.2.0` + - Updated the pacakge `@radix-ui/react-accordion` from `1.1.2` to `1.2.3` + - Updated the pacakge `@radix-ui/react-label` from `2.0.2` to `2.1.2` + - Updated the pacakge `@radix-ui/react-popover` from `1.0.7` to `1.1.6` + - Updated the pacakge `@radix-ui/react-select` from `2.0.0` to `2.1.6` + - Updated the pacakge `@radix-ui/react-slot` from `1.0.2` to `1.1.2` + - Updated the pacakge `@radix-ui/react-tabs` from `1.0.4` to `1.1.3` + - Updated the pacakge `@radix-ui/react-tooltip` from `1.0.7` to `1.1.8` + - Updated the pacakge `@tabler/icons-react` from `2.39.0` to `3.30.0` + - Updated the pacakge `@tanstack/react-query` from `5.0.0` to `5.66.7` + - Updated the pacakge `chart.js` from `4.4.0` to `4.4.8` + - Updated the pacakge `chartjs-plugin-annotation` from `3.0.1` to `3.1.0` + - Updated the pacakge `cmdk` from `0.2.1` to `1.0.4` + - Updated the pacakge `date-fns` from `3.6.0` to `4.1.0` + - Updated the pacakge `framer-motion` from `10.16.4` to `12.4.5` + - Updated the pacakge `jotai` from `2.9.1` to `2.12.1` + - Updated the pacakge `react` from `18.2.0` to `19.0.0` + - Updated the pacakge `react-dom` from `18.2.0` to `19.0.0` + - Updated the pacakge `react-markdown` from `9.0.0` to `9.0.3` + - Updated the pacakge `react-router-dom` from `6.17.0` to `7.2.0` + - Updated the pacakge `rehype-highlight` from `7.0.0` to `7.0.2` + - Updated the pacakge `remark-gfm` from `4.0.0` to `4.0.1` + - Updated the pacakge `sonner` from `1.0.3` to `2.0.0` + - Added `.env.sample` + - Redesigned login screen + - Remote sources removed to make this fork comply with SudoVanilla Umbrella Policy + - Default avatar points to https://md.sudovanilla.org/images/icons/Aptabase.jpg + - Flags point to https://md.sudovanilla.org/images/flags/ + - Removed all support elements and Chirp + - Removed instructions screen + - Removed `/etc/tinybird` + - Removed `/src/Properties/` + - Removed `/tests/` + - Removed `/tools/` \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 44887cb..87376b2 100755 --- a/Dockerfile +++ b/Dockerfile @@ -2,16 +2,16 @@ FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS server WORKDIR /work/src -COPY ./src/Aptabase.csproj /work/src +COPY ./src/Zalvena.csproj /work/src ARG TARGETARCH -RUN dotnet restore "./Aptabase.csproj" -a $TARGETARCH +RUN dotnet restore "./Zalvena.csproj" -a $TARGETARCH COPY ./etc/clickhouse /work/etc/clickhouse COPY ./etc/geoip /work/etc/geoip COPY ./src /work/src -RUN dotnet publish "Aptabase.csproj" -a $TARGETARCH -c Release -o /work/publish /p:UseAppHost=false +RUN dotnet publish "Zalvena.csproj" -a $TARGETARCH -c Release -o /work/publish /p:UseAppHost=false # WebApp Build FROM oven/bun:1 AS webapp @@ -31,7 +31,7 @@ COPY --from=server /work/publish . COPY --from=webapp /work/wwwroot ./wwwroot COPY LICENSE . -ENTRYPOINT ["dotnet", "Aptabase.dll"] +ENTRYPOINT ["dotnet", "Zalvena.dll"] # Metadata LABEL org.opencontainers.image.title="Zalvena" @@ -40,4 +40,4 @@ LABEL org.opencontainers.image.description="Fork of Aptabase" LABEL org.opencontainers.image.licenses="AGPLv3" LABEL org.opencontainers.image.url="https://ark.sudovanilla.org/Korbs/Zalvena/" LABEL org.opencontainers.image.source="https://ark.sudovanilla.org/Korbs/Zalvena/" -LABEL org.opencontainers.image.version="0.0.3" \ No newline at end of file +LABEL org.opencontainers.image.version="0.0.4" \ No newline at end of file diff --git a/README.md b/README.md index 13dd047..60b2d04 100755 --- a/README.md +++ b/README.md @@ -2,69 +2,17 @@ A fork of Aptabase Server software, modified to only work with projects using Zalvena. -## Changes - - Updated app key generation to use `ZV` instead of `SH` - - Updated the name "Aptabase" to "Zalvena" in some sections - - Updated browserslist - - Updated `node:18` to `over/bun:1` in `Dockerfile` - - Updated the pacakge `@types/node` from `20.8.7` to `22.13.4` - - Updated the pacakge `@types/react` from `18.2.30` to `19.0.10` - - Updated the pacakge `@types/react-dom` from `18.2.14` to `19.0.4` - - Updated the pacakge `@vitejs/plugin-react-swc` from `3.4.0` to `3.8.0` - - Updated the pacakge `autoprefixer` from `10.4.16` to `10.4.20` - - Updated the pacakge `postcss` from `8.4.31` to `8.5.3` - - Updated the pacakge `tailwind-merge` from `1.14.0` to `3.0.1` - - Updated the pacakge `typescript` from `5.2.2` to `5.7.3` - - Updated the pacakge `vite` from `4.5.3` to `6.1.1` - - Updated the pacakge `vite-plugin-mkcert` from `1.17.5` to `1.17.6` - - Updated the pacakge `@aptabase/web` from `0.4.0` to `0.4.3` - - Updated the pacakge `@fontsource/inter` from `5.0.14` to `5.1.1` - - Updated the pacakge `@headlessui/react` from `2.1.2` to `2.2.0` - - Updated the pacakge `@radix-ui/react-accordion` from `1.1.2` to `1.2.3` - - Updated the pacakge `@radix-ui/react-label` from `2.0.2` to `2.1.2` - - Updated the pacakge `@radix-ui/react-popover` from `1.0.7` to `1.1.6` - - Updated the pacakge `@radix-ui/react-select` from `2.0.0` to `2.1.6` - - Updated the pacakge `@radix-ui/react-slot` from `1.0.2` to `1.1.2` - - Updated the pacakge `@radix-ui/react-tabs` from `1.0.4` to `1.1.3` - - Updated the pacakge `@radix-ui/react-tooltip` from `1.0.7` to `1.1.8` - - Updated the pacakge `@tabler/icons-react` from `2.39.0` to `3.30.0` - - Updated the pacakge `@tanstack/react-query` from `5.0.0` to `5.66.7` - - Updated the pacakge `chart.js` from `4.4.0` to `4.4.8` - - Updated the pacakge `chartjs-plugin-annotation` from `3.0.1` to `3.1.0` - - Updated the pacakge `cmdk` from `0.2.1` to `1.0.4` - - Updated the pacakge `date-fns` from `3.6.0` to `4.1.0` - - Updated the pacakge `framer-motion` from `10.16.4` to `12.4.5` - - Updated the pacakge `jotai` from `2.9.1` to `2.12.1` - - Updated the pacakge `react` from `18.2.0` to `19.0.0` - - Updated the pacakge `react-dom` from `18.2.0` to `19.0.0` - - Updated the pacakge `react-markdown` from `9.0.0` to `9.0.3` - - Updated the pacakge `react-router-dom` from `6.17.0` to `7.2.0` - - Updated the pacakge `rehype-highlight` from `7.0.0` to `7.0.2` - - Updated the pacakge `remark-gfm` from `4.0.0` to `4.0.1` - - Updated the pacakge `sonner` from `1.0.3` to `2.0.0` - - Added `.env.sample` - - Redesigned login screen - - Remote sources removed to make this fork comply with SudoVanilla Umbrella Policy - - Default avatar points to https://md.sudovanilla.org/images/icons/Aptabase.jpg - - Flags point to https://md.sudovanilla.org/images/flags/ - - Removed all support elements and Chirp - - Removed instructions screen - - Removed `/etc/tinybird` - - Removed `/src/Properties/` - - Removed `/tests/` - - Removed `/tools/` - ## Planned Changes - - Revamp emails - - Use SudoVanilla Gateway email template - - Revamp design - - Use Mona Font - - Replace sidebar layout with header - - Replace Tabler icons with Iconoir - - Add SudoVanilla Gateway OpenID Login - - Add new instruction screens - - Remove all traces of Aptabase trademarks, branding, and name to differentiate Zalvena from Aptabase - - Remove all Aptabase Cloud functions including Billing, US/EU Regions, and more + - [x] Revamp emails + - [ ] Revamp design + - [ ] Use Mona Font + - [ ] Replace sidebar layout with header + - [ ] Replace Tabler icons with Iconoir + - [x] New login screens + - [ ] Add SudoVanilla Gateway OpenID Login + - [ ] Add new instruction screens + - [ ] Remove all traces of Aptabase trademarks, branding, and name to differentiate Zalvena from Aptabase + - [ ] Remove all Aptabase Cloud functions including Billing, US/EU Regions, and more **Maybe** - Replace usage of React with Astro? 🤔 @@ -115,8 +63,8 @@ services: # .env BASE_URL="https://zv.example.org" AUTH_SECRET="Ah6Lm3h8Qmnhm8oDfw09AOUYEOMKpzfqIFPjBA2waLPm9SD65BA1eSXde9OS80nE" -DATABASE_URL="Server=aptabase_db;Port=5432;User Id=aptabase;Password=0000000000000000000000000000000000000000000000000000000000000000;Database=aptabase" -CLICKHOUSE_URL="Host=aptabase_events_db;Port=8123;Username=aptabase;Password=0000000000000000000000000000000000000000000000000000000000000000" +DATABASE_URL="Server=zalvena_database;Port=5432;User Id=zalvena;Password=0000000000000000000000000000000000000000000000000000000000000000;Database=zalvena" +CLICKHOUSE_URL="Host=zalvena_events;Port=8123;Username=zalvena;Password=0000000000000000000000000000000000000000000000000000000000000000" SMTP_HOST="smtp.resend.com" SMTP_PORT="465" SMTP_USERNAME="resend" diff --git a/build.docker.sh b/build.docker.sh index 8d48a04..7b0be42 100644 --- a/build.docker.sh +++ b/build.docker.sh @@ -1,3 +1,3 @@ # SudoVanilla Registry accepts OCI images instead of Docker images, # so `buidah` build tool is used instead. -buildah build -t oci.registry.sudovanilla.org/zalvena --no-cache \ No newline at end of file +buildah build -t oci.registry.sudovanilla.org/zalvena \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f41d5ad..2b0f081 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,28 +1,28 @@ services: - aptabase_db: - container_name: aptabase_db + zalvena_database: + container_name: zalvena_database image: postgres:15-alpine restart: always volumes: - ./tmp/db-data:/var/lib/postgresql/data environment: - POSTGRES_USER: aptabase + POSTGRES_USER: zalvena POSTGRES_PASSWORD: sLPnqXzjupt6pR1dumYrGeVXpVDup49hYRRn2TEUfRmF6eXbBu4CJYl5ynBFxXx8 - aptabase_events_db: - container_name: aptabase_events_db + zalvena_events: + container_name: zalvena_events image: clickhouse/clickhouse-server:23.8.4.69-alpine restart: always volumes: - ./tmp/events-db-data:/var/lib/clickhouse environment: - CLICKHOUSE_USER: aptabase + CLICKHOUSE_USER: zalvena CLICKHOUSE_PASSWORD: lBxMObwAWOU8L4ieQPq1ZcbQeUND4FwwgEfvmGstU5o8IZS3XekInmKtcAwqSxgm ulimits: nofile: soft: 262144 hard: 262144 - aptabase: - container_name: aptabase_app + zalvena: + container_name: zalvena image: oci.registry.sudovanilla.org/zalvena restart: always env_file: @@ -30,7 +30,7 @@ services: volumes: - /etc/hosts:/etc/hosts depends_on: - - aptabase_events_db - - aptabase_db + - zalvena_events + - zalvena_database ports: - 6521:8080 diff --git a/src/Data/ClickHouseMigrationRunner.cs b/src/Data/ClickHouseMigrationRunner.cs index eae95e0..66e3d00 100755 --- a/src/Data/ClickHouseMigrationRunner.cs +++ b/src/Data/ClickHouseMigrationRunner.cs @@ -1,8 +1,8 @@ using Dapper; using ClickHouse.Client.ADO; -using Aptabase.Features; +using Zalvena.Features; -namespace Aptabase.Data; +namespace Zalvena.Data; public interface IClickHouseMigrationRunner { diff --git a/src/Data/DbContext.cs b/src/Data/DbContext.cs index 356f17b..8bb9175 100755 --- a/src/Data/DbContext.cs +++ b/src/Data/DbContext.cs @@ -1,6 +1,6 @@ using System.Data.Common; -namespace Aptabase.Data; +namespace Zalvena.Data; public interface IDbContext { diff --git a/src/Data/Migrations/0001_InitialSetup.cs b/src/Data/Migrations/0001_InitialSetup.cs index f3eeb6a..f6df7da 100755 --- a/src/Data/Migrations/0001_InitialSetup.cs +++ b/src/Data/Migrations/0001_InitialSetup.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0001)] public class InitialSetup : Migration diff --git a/src/Data/Migrations/0002_UserProvider.cs b/src/Data/Migrations/0002_UserProvider.cs index 0a9084e..a8cf2de 100755 --- a/src/Data/Migrations/0002_UserProvider.cs +++ b/src/Data/Migrations/0002_UserProvider.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0002)] public class UserProvider : Migration diff --git a/src/Data/Migrations/0003_AddBlobs.cs b/src/Data/Migrations/0003_AddBlobs.cs index 8dd4280..02849b7 100755 --- a/src/Data/Migrations/0003_AddBlobs.cs +++ b/src/Data/Migrations/0003_AddBlobs.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0003)] public class AddBlobs : Migration diff --git a/src/Data/Migrations/0004_AddAppSalt.cs b/src/Data/Migrations/0004_AddAppSalt.cs index 77c500f..c9581a9 100755 --- a/src/Data/Migrations/0004_AddAppSalt.cs +++ b/src/Data/Migrations/0004_AddAppSalt.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0004)] public class AddAppSalt : Migration diff --git a/src/Data/Migrations/0005_AppShares.cs b/src/Data/Migrations/0005_AppShares.cs index 0dbe605..aca6705 100755 --- a/src/Data/Migrations/0005_AppShares.cs +++ b/src/Data/Migrations/0005_AppShares.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0005)] public class AppShares : Migration diff --git a/src/Data/Migrations/0006_AddSubscriptions.cs b/src/Data/Migrations/0006_AddSubscriptions.cs index 4711048..367b9db 100755 --- a/src/Data/Migrations/0006_AddSubscriptions.cs +++ b/src/Data/Migrations/0006_AddSubscriptions.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0006)] public class AddSubscriptions : Migration diff --git a/src/Data/Migrations/0007_AddOnboardingFlag.cs b/src/Data/Migrations/0007_AddOnboardingFlag.cs index d74a3ee..aef2c7b 100755 --- a/src/Data/Migrations/0007_AddOnboardingFlag.cs +++ b/src/Data/Migrations/0007_AddOnboardingFlag.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0007)] public class AddOnboardingFlag : Migration diff --git a/src/Data/Migrations/0008_AddLockReason.cs b/src/Data/Migrations/0008_AddLockReason.cs index d300f0f..16a544b 100755 --- a/src/Data/Migrations/0008_AddLockReason.cs +++ b/src/Data/Migrations/0008_AddLockReason.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0008)] public class AddLockReason : Migration diff --git a/src/Data/Migrations/0009_AddFreeTrial.cs b/src/Data/Migrations/0009_AddFreeTrial.cs index f26237a..dcf8d8c 100755 --- a/src/Data/Migrations/0009_AddFreeTrial.cs +++ b/src/Data/Migrations/0009_AddFreeTrial.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0009)] public class AddFreeTrial : Migration diff --git a/src/Data/Migrations/0010_AddCache.cs b/src/Data/Migrations/0010_AddCache.cs index 8b83fac..3e2ad68 100755 --- a/src/Data/Migrations/0010_AddCache.cs +++ b/src/Data/Migrations/0010_AddCache.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0010)] public class AddCache : Migration diff --git a/src/Data/Migrations/0011_AddFeatureFlags.cs b/src/Data/Migrations/0011_AddFeatureFlags.cs index 29ee597..46b71ba 100755 --- a/src/Data/Migrations/0011_AddFeatureFlags.cs +++ b/src/Data/Migrations/0011_AddFeatureFlags.cs @@ -1,6 +1,6 @@ using FluentMigrator; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [Migration(0011)] public class AddFeatureFlags : Migration diff --git a/src/Data/Migrations/MigrationExtensions.cs b/src/Data/Migrations/MigrationExtensions.cs index e0aa9d6..b58ad5b 100755 --- a/src/Data/Migrations/MigrationExtensions.cs +++ b/src/Data/Migrations/MigrationExtensions.cs @@ -1,7 +1,7 @@ using FluentMigrator; using FluentMigrator.Builders.Create.Table; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; internal static class MigrationExtensions { diff --git a/src/Data/Migrations/VersionInfoTable.cs b/src/Data/Migrations/VersionInfoTable.cs index 4e6fa74..b3361bb 100755 --- a/src/Data/Migrations/VersionInfoTable.cs +++ b/src/Data/Migrations/VersionInfoTable.cs @@ -1,6 +1,6 @@ using FluentMigrator.Runner.VersionTableInfo; -namespace Aptabase.Data.Migrations; +namespace Zalvena.Data.Migrations; [VersionTableMetaData] public class VersionTable : IVersionTableMetaData diff --git a/src/Data/NanoId.cs b/src/Data/NanoId.cs index 5830e5b..9038970 100755 --- a/src/Data/NanoId.cs +++ b/src/Data/NanoId.cs @@ -1,6 +1,6 @@ using NanoidDotNet; -namespace Aptabase.Data; +namespace Zalvena.Data; public class NanoId { diff --git a/src/Features/Apps/AppQueries.cs b/src/Features/Apps/AppQueries.cs index d153cf4..7685e18 100755 --- a/src/Features/Apps/AppQueries.cs +++ b/src/Features/Apps/AppQueries.cs @@ -1,7 +1,7 @@ -using Aptabase.Data; +using Zalvena.Data; using Dapper; -namespace Aptabase.Features.Apps; +namespace Zalvena.Features.Apps; public class Application { diff --git a/src/Features/Apps/AppsController.cs b/src/Features/Apps/AppsController.cs index 0655fab..842a265 100755 --- a/src/Features/Apps/AppsController.cs +++ b/src/Features/Apps/AppsController.cs @@ -1,11 +1,11 @@ using Dapper; -using Aptabase.Data; -using Aptabase.Features.Blob; +using Zalvena.Data; +using Zalvena.Features.Blob; using Microsoft.AspNetCore.Mvc; -using Aptabase.Features.Authentication; +using Zalvena.Features.Authentication; using System.ComponentModel.DataAnnotations; -namespace Aptabase.Features.Apps; +namespace Zalvena.Features.Apps; public class ApplicationShare { diff --git a/src/Features/Authentication/AuthController.cs b/src/Features/Authentication/AuthController.cs index d81c7ef..29db31c 100755 --- a/src/Features/Authentication/AuthController.cs +++ b/src/Features/Authentication/AuthController.cs @@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; using Microsoft.IdentityModel.Tokens; -namespace Aptabase.Features.Authentication; +namespace Zalvena.Features.Authentication; public class SignInBodyRequest { @@ -76,7 +76,7 @@ public class AuthController : Controller [HttpGet("/api/_auth/me")] [IsAuthenticated] - [EnableCors("AllowAptabaseCom")] + [EnableCors("AllowZalvenaOrg")] public async Task Me(CancellationToken cancellationToken) { var identity = this.GetCurrentUserIdentity(); @@ -89,7 +89,7 @@ public class AuthController : Controller [HttpPost("/api/_auth/account/delete")] [IsAuthenticated] - [EnableCors("AllowAptabaseCom")] + [EnableCors("AllowZalvenaOrg")] public async Task DeleteAccount(CancellationToken cancellationToken) { var identity = this.GetCurrentUserIdentity(); diff --git a/src/Features/Authentication/AuthExtensions.cs b/src/Features/Authentication/AuthExtensions.cs index 4a5e892..1a006f9 100755 --- a/src/Features/Authentication/AuthExtensions.cs +++ b/src/Features/Authentication/AuthExtensions.cs @@ -1,4 +1,4 @@ -using Aptabase.Features.Authentication; +using Zalvena.Features.Authentication; namespace Microsoft.AspNetCore.Mvc; diff --git a/src/Features/Authentication/AuthService.cs b/src/Features/Authentication/AuthService.cs index 7fe3689..ae5a879 100755 --- a/src/Features/Authentication/AuthService.cs +++ b/src/Features/Authentication/AuthService.cs @@ -1,11 +1,11 @@ -using Aptabase.Features.Notification; -using Aptabase.Data; +using Zalvena.Features.Notification; +using Zalvena.Data; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.Cookies; using System.Security.Claims; using Dapper; -namespace Aptabase.Features.Authentication; +namespace Zalvena.Features.Authentication; public interface IAuthService { @@ -53,7 +53,7 @@ public class AuthService : IAuthService if (user != null) { var token = _tokenManager.CreateAuthToken(AuthTokenType.SignIn, user.Name, user.Email); - await _emailClient.SendEmailAsync(email, "Log in to Aptabase", "SignIn", new() + await _emailClient.SendEmailAsync(email, "Log in to Zalvena", "SignIn", new() { { "name", user.Name }, { "url", GenerateAuthUrl(token) } diff --git a/src/Features/Authentication/AuthTokenManager.cs b/src/Features/Authentication/AuthTokenManager.cs index 05ae8bb..c68d26d 100755 --- a/src/Features/Authentication/AuthTokenManager.cs +++ b/src/Features/Authentication/AuthTokenManager.cs @@ -2,7 +2,7 @@ using Microsoft.IdentityModel.Tokens; using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; -namespace Aptabase.Features.Authentication; +namespace Zalvena.Features.Authentication; public enum AuthTokenType { diff --git a/src/Features/Authentication/IsAuthenticated.cs b/src/Features/Authentication/IsAuthenticated.cs index 7af7a72..525edee 100755 --- a/src/Features/Authentication/IsAuthenticated.cs +++ b/src/Features/Authentication/IsAuthenticated.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; -namespace Aptabase.Features.Authentication; +namespace Zalvena.Features.Authentication; public class IsAuthenticatedAttribute : ActionFilterAttribute { diff --git a/src/Features/Authentication/OAuthExtensions.cs b/src/Features/Authentication/OAuthExtensions.cs index 51ada58..8b38adc 100755 --- a/src/Features/Authentication/OAuthExtensions.cs +++ b/src/Features/Authentication/OAuthExtensions.cs @@ -1,8 +1,8 @@ using System.Net.Http.Headers; using System.Text.Json; using System.Text.Json.Serialization; -using Aptabase.Features; -using Aptabase.Features.Authentication; +using Zalvena.Features; +using Zalvena.Features.Authentication; using Microsoft.AspNetCore.Authentication.OAuth; namespace Microsoft.AspNetCore.Authentication; diff --git a/src/Features/Authentication/UserAccount.cs b/src/Features/Authentication/UserAccount.cs index 94132d9..ae3fb90 100755 --- a/src/Features/Authentication/UserAccount.cs +++ b/src/Features/Authentication/UserAccount.cs @@ -1,7 +1,7 @@ using System.Text; using System.Security.Cryptography; -namespace Aptabase.Features.Authentication; +namespace Zalvena.Features.Authentication; public class UserAccount { @@ -31,6 +31,6 @@ public class UserAccount foreach (var b in hash) sb.Append(b.ToString("x2")); - return $"https://md.sudovanilla.org/images/icons/Aptabase.jpg"; + return $"https://md.sudovanilla.org/images/logos/zalvena/zalvena-avatar.png"; } } \ No newline at end of file diff --git a/src/Features/Authentication/UserIdentifier.cs b/src/Features/Authentication/UserIdentifier.cs index e1cbfbe..bf4094c 100755 --- a/src/Features/Authentication/UserIdentifier.cs +++ b/src/Features/Authentication/UserIdentifier.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Authentication; +namespace Zalvena.Features.Authentication; public struct UserIdentity { diff --git a/src/Features/Billing/BillingController.cs b/src/Features/Billing/BillingController.cs index 20f272b..4a42696 100755 --- a/src/Features/Billing/BillingController.cs +++ b/src/Features/Billing/BillingController.cs @@ -1,9 +1,9 @@ -using Aptabase.Features.Authentication; -using Aptabase.Features.Billing.LemonSqueezy; -using Aptabase.Features.Stats; +using Zalvena.Features.Authentication; +using Zalvena.Features.Billing.LemonSqueezy; +using Zalvena.Features.Stats; using Microsoft.AspNetCore.Mvc; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; [ApiController, IsAuthenticated] [ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)] diff --git a/src/Features/Billing/BillingQueries.cs b/src/Features/Billing/BillingQueries.cs index 129554e..6044140 100755 --- a/src/Features/Billing/BillingQueries.cs +++ b/src/Features/Billing/BillingQueries.cs @@ -1,9 +1,9 @@ -using Aptabase.Data; -using Aptabase.Features.Authentication; -using Aptabase.Features.Stats; +using Zalvena.Data; +using Zalvena.Features.Authentication; +using Zalvena.Features.Stats; using Dapper; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public interface IBillingQueries { diff --git a/src/Features/Billing/BillingUsage.cs b/src/Features/Billing/BillingUsage.cs index 8fb1d32..6629696 100755 --- a/src/Features/Billing/BillingUsage.cs +++ b/src/Features/Billing/BillingUsage.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public class BillingUsage { diff --git a/src/Features/Billing/LemonSqueezy/LemonSqueezyClient.cs b/src/Features/Billing/LemonSqueezy/LemonSqueezyClient.cs index e8c0bf6..fd724fe 100755 --- a/src/Features/Billing/LemonSqueezy/LemonSqueezyClient.cs +++ b/src/Features/Billing/LemonSqueezy/LemonSqueezyClient.cs @@ -1,8 +1,8 @@ using System.Text.Json; -using Aptabase.Features.Authentication; +using Zalvena.Features.Authentication; using Yoh.Text.Json.NamingPolicies; -namespace Aptabase.Features.Billing.LemonSqueezy; +namespace Zalvena.Features.Billing.LemonSqueezy; public class LemonSqueezyClient { @@ -37,7 +37,7 @@ public class LemonSqueezyClient } }, product_options = new { - redirect_url = $"{_env.SelfBaseUrl}/billing", + redirect_url = $"{_env.SelfBaseUrl}/profile", }, checkout_options = new { embed = false, diff --git a/src/Features/Billing/LemonSqueezy/LemonSqueezyExtensions.cs b/src/Features/Billing/LemonSqueezy/LemonSqueezyExtensions.cs index 0f92306..bf61207 100755 --- a/src/Features/Billing/LemonSqueezy/LemonSqueezyExtensions.cs +++ b/src/Features/Billing/LemonSqueezy/LemonSqueezyExtensions.cs @@ -1,6 +1,6 @@ using System.Net.Http.Headers; -namespace Aptabase.Features.Billing.LemonSqueezy; +namespace Zalvena.Features.Billing.LemonSqueezy; public static class LemonSqueezyExtensions { diff --git a/src/Features/Billing/LemonSqueezy/Models.cs b/src/Features/Billing/LemonSqueezy/Models.cs index 8b03c61..c5f9e15 100755 --- a/src/Features/Billing/LemonSqueezy/Models.cs +++ b/src/Features/Billing/LemonSqueezy/Models.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Billing.LemonSqueezy; +namespace Zalvena.Features.Billing.LemonSqueezy; public class PagedList where T : new() { diff --git a/src/Features/Billing/LemonSqueezy/WebhookEvent.cs b/src/Features/Billing/LemonSqueezy/WebhookEvent.cs index 110ad73..e84342c 100755 --- a/src/Features/Billing/LemonSqueezy/WebhookEvent.cs +++ b/src/Features/Billing/LemonSqueezy/WebhookEvent.cs @@ -1,6 +1,6 @@ using System.Text.Json.Nodes; -namespace Aptabase.Features.Billing.LemonSqueezy; +namespace Zalvena.Features.Billing.LemonSqueezy; public class WebhookEvent { diff --git a/src/Features/Billing/LemonSqueezyWebhookController.cs b/src/Features/Billing/LemonSqueezyWebhookController.cs index c90dff4..7bcd1a3 100755 --- a/src/Features/Billing/LemonSqueezyWebhookController.cs +++ b/src/Features/Billing/LemonSqueezyWebhookController.cs @@ -1,12 +1,12 @@ -using Aptabase.Data; -using Aptabase.Features.Billing.LemonSqueezy; +using Zalvena.Data; +using Zalvena.Features.Billing.LemonSqueezy; using Dapper; using Microsoft.AspNetCore.Mvc; using System.Security.Cryptography; using System.Text; using System.Text.Json; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; [ApiController] [ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)] diff --git a/src/Features/Billing/OveruseNotificationCronJob.cs b/src/Features/Billing/OveruseNotificationCronJob.cs index cad53b7..f3ea1c9 100755 --- a/src/Features/Billing/OveruseNotificationCronJob.cs +++ b/src/Features/Billing/OveruseNotificationCronJob.cs @@ -1,8 +1,8 @@ -using Aptabase.Features.Notification; +using Zalvena.Features.Notification; using Features.Cache; using Sgbj.Cron; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public class OveruseNotificationCronJob : BackgroundService { diff --git a/src/Features/Billing/ResetOveruseCronJob.cs b/src/Features/Billing/ResetOveruseCronJob.cs index 21b7c95..390acb7 100755 --- a/src/Features/Billing/ResetOveruseCronJob.cs +++ b/src/Features/Billing/ResetOveruseCronJob.cs @@ -1,6 +1,6 @@ using Sgbj.Cron; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public class ResetOveruseCronJob : BackgroundService { diff --git a/src/Features/Billing/Subscription.cs b/src/Features/Billing/Subscription.cs index 9e55d02..703ca83 100755 --- a/src/Features/Billing/Subscription.cs +++ b/src/Features/Billing/Subscription.cs @@ -1,5 +1,5 @@ -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public class Subscription { diff --git a/src/Features/Billing/TrialExpiredCronJob.cs b/src/Features/Billing/TrialExpiredCronJob.cs index 4aa9c0e..308d10e 100755 --- a/src/Features/Billing/TrialExpiredCronJob.cs +++ b/src/Features/Billing/TrialExpiredCronJob.cs @@ -1,6 +1,6 @@ using Sgbj.Cron; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public class TrialExpiredCronJob : BackgroundService { diff --git a/src/Features/Billing/TrialNotificationCronJob.cs b/src/Features/Billing/TrialNotificationCronJob.cs index ba948d6..5603c72 100755 --- a/src/Features/Billing/TrialNotificationCronJob.cs +++ b/src/Features/Billing/TrialNotificationCronJob.cs @@ -1,7 +1,7 @@ -using Aptabase.Features.Notification; +using Zalvena.Features.Notification; using Sgbj.Cron; -namespace Aptabase.Features.Billing; +namespace Zalvena.Features.Billing; public class TrialNotificationCronJob : BackgroundService { diff --git a/src/Features/Blob/DatabaseBlobService.cs b/src/Features/Blob/DatabaseBlobService.cs index ec84b71..d6472b5 100755 --- a/src/Features/Blob/DatabaseBlobService.cs +++ b/src/Features/Blob/DatabaseBlobService.cs @@ -1,8 +1,8 @@ -using Aptabase.Data; +using Zalvena.Data; using ClickHouse.Client.Utility; using Dapper; -namespace Aptabase.Features.Blob; +namespace Zalvena.Features.Blob; public class DatabaseBlobService : IBlobService { diff --git a/src/Features/Blob/IBlobService.cs b/src/Features/Blob/IBlobService.cs index 4abab21..4e9c9cc 100755 --- a/src/Features/Blob/IBlobService.cs +++ b/src/Features/Blob/IBlobService.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Blob; +namespace Zalvena.Features.Blob; public class Blob { diff --git a/src/Features/Blob/UploadsController.cs b/src/Features/Blob/UploadsController.cs index 2dd8ea2..900297c 100755 --- a/src/Features/Blob/UploadsController.cs +++ b/src/Features/Blob/UploadsController.cs @@ -1,8 +1,8 @@ -using Aptabase.Features.Blob; +using Zalvena.Features.Blob; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace Aptabase.Features.Blob; +namespace Zalvena.Features.Blob; public class UploadedFile { diff --git a/src/Features/Cache/CacheService.cs b/src/Features/Cache/CacheService.cs index ec61a35..fb4dc62 100755 --- a/src/Features/Cache/CacheService.cs +++ b/src/Features/Cache/CacheService.cs @@ -1,4 +1,4 @@ -using Aptabase.Data; +using Zalvena.Data; using Dapper; namespace Features.Cache; diff --git a/src/Features/EnvSettings.cs b/src/Features/EnvSettings.cs index 118fd59..aad8458 100755 --- a/src/Features/EnvSettings.cs +++ b/src/Features/EnvSettings.cs @@ -1,6 +1,6 @@ using System.Text; -namespace Aptabase.Features; +namespace Zalvena.Features; public class EnvSettings { @@ -10,7 +10,7 @@ public class EnvSettings public string SelfBaseUrl { get; private set; } = ""; // The full connection string to postgres using .NET format - // E.g: Server=localhost;Port=5444;User Id=aptabase;Password=aptabase_pw;Database=aptabase + // E.g: Server=localhost;Port=5444;User Id=zalvena;Password=zalvena_pw;Database=zalvena // Variable Name: DATABASE_URL public string ConnectionString { get; private set; } = ""; @@ -76,7 +76,7 @@ public class EnvSettings public string OAuthGoogleClientSecret { get; private set; } = ""; // The following properties are derived from the other settings - public bool IsManagedCloud => Region == "EU" || Region == "US"; + public bool IsManagedCloud => Region == "Mars"; public bool IsBillingEnabled => IsManagedCloud || IsDevelopment; public bool IsProduction => !IsDevelopment; public bool IsDevelopment { get; private set; } @@ -88,14 +88,14 @@ public class EnvSettings public static EnvSettings Load() { var isDevelopment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development"; - var region = isDevelopment ? "DEV" : Get("REGION").ToUpper(); + var region = isDevelopment ? "DEV" : Get("REGION"); if (string.IsNullOrEmpty(region)) - region = "ZV"; // Self Hosted + region = "SH"; // Self Hosted return new EnvSettings { IsDevelopment = isDevelopment, - Region = region, + Region = Get("REGION"), SelfBaseUrl = MustGet("BASE_URL"), ConnectionString = GetOrNull("ConnectionStrings__postgresdb") ?? MustGet("DATABASE_URL"), ClickHouseConnectionString = GetOrNull("ConnectionStrings__clickhousedb") ?? Get("CLICKHOUSE_URL"), diff --git a/src/Features/Export/ExportController.cs b/src/Features/Export/ExportController.cs index d27844a..6033d36 100755 --- a/src/Features/Export/ExportController.cs +++ b/src/Features/Export/ExportController.cs @@ -1,10 +1,10 @@ -using Aptabase.Features.Authentication; -using Aptabase.Features.Stats; +using Zalvena.Features.Authentication; +using Zalvena.Features.Stats; using Microsoft.AspNetCore.Mvc; using System.Text.Json; using System.Text.RegularExpressions; -namespace Aptabase.Features.Export; +namespace Zalvena.Features.Export; public class DownloadRequest { diff --git a/src/Features/Export/StreamingFileResult.cs b/src/Features/Export/StreamingFileResult.cs index 0e4bd58..70f8da5 100755 --- a/src/Features/Export/StreamingFileResult.cs +++ b/src/Features/Export/StreamingFileResult.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace Aptabase.Features.Export; +namespace Zalvena.Features.Export; public class StreamingFileResult(Func streamContent, string contentType, string fileName) : IActionResult { diff --git a/src/Features/FeatureFlags/FeatureFlag.cs b/src/Features/FeatureFlags/FeatureFlag.cs index 0cc8bfc..c8c6342 100755 --- a/src/Features/FeatureFlags/FeatureFlag.cs +++ b/src/Features/FeatureFlags/FeatureFlag.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.FeatureFlags +namespace Zalvena.Features.FeatureFlags { public class FeatureFlag { diff --git a/src/Features/FeatureFlags/FeatureFlagStateController.cs b/src/Features/FeatureFlags/FeatureFlagStateController.cs index 2ad2078..417084d 100755 --- a/src/Features/FeatureFlags/FeatureFlagStateController.cs +++ b/src/Features/FeatureFlags/FeatureFlagStateController.cs @@ -1,12 +1,12 @@ -using Aptabase.Data; -using Aptabase.Features.Ingestion; +using Zalvena.Data; +using Zalvena.Features.Ingestion; using Dapper; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; using System.Text.Json; -namespace Aptabase.Features.FeatureFlags; +namespace Zalvena.Features.FeatureFlags; public class GetFeatureFlagBody { diff --git a/src/Features/FeatureFlags/FeatureFlagsController.cs b/src/Features/FeatureFlags/FeatureFlagsController.cs index 1d59bc0..5a0708a 100755 --- a/src/Features/FeatureFlags/FeatureFlagsController.cs +++ b/src/Features/FeatureFlags/FeatureFlagsController.cs @@ -1,11 +1,11 @@ -using Aptabase.Data; -using Aptabase.Features.Apps; -using Aptabase.Features.Authentication; +using Zalvena.Data; +using Zalvena.Features.Apps; +using Zalvena.Features.Authentication; using Dapper; using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; -namespace Aptabase.Features.FeatureFlags; +namespace Zalvena.Features.FeatureFlags; public class CreateFeatureFlagRequestBody : UpdateFeatureFlagRequestBody { diff --git a/src/Features/GeoIP/CloudGeoClient.cs b/src/Features/GeoIP/CloudGeoClient.cs index 434cb20..a6d840a 100755 --- a/src/Features/GeoIP/CloudGeoClient.cs +++ b/src/Features/GeoIP/CloudGeoClient.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace Aptabase.Features.GeoIP; +namespace Zalvena.Features.GeoIP; public class CloudGeoClient : GeoIPClient { diff --git a/src/Features/GeoIP/DatabaseGeoClient.cs b/src/Features/GeoIP/DatabaseGeoClient.cs index e12f288..c643837 100755 --- a/src/Features/GeoIP/DatabaseGeoClient.cs +++ b/src/Features/GeoIP/DatabaseGeoClient.cs @@ -1,6 +1,6 @@ using MaxMind.GeoIP2; -namespace Aptabase.Features.GeoIP; +namespace Zalvena.Features.GeoIP; public class DatabaseGeoClient : GeoIPClient { diff --git a/src/Features/GeoIP/GeoIPExtensions.cs b/src/Features/GeoIP/GeoIPExtensions.cs index 13c8b27..27f21d6 100755 --- a/src/Features/GeoIP/GeoIPExtensions.cs +++ b/src/Features/GeoIP/GeoIPExtensions.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.GeoIP; +namespace Zalvena.Features.GeoIP; public static class GeoIPExtensions { diff --git a/src/Features/GeoIP/IGeoIPClient.cs b/src/Features/GeoIP/IGeoIPClient.cs index 1a7825b..78c34fc 100755 --- a/src/Features/GeoIP/IGeoIPClient.cs +++ b/src/Features/GeoIP/IGeoIPClient.cs @@ -1,7 +1,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace Aptabase.Features.GeoIP; +namespace Zalvena.Features.GeoIP; public readonly struct GeoLocation { diff --git a/src/Features/Ingestion/Buffer/ClickHouseIngestionClient.cs b/src/Features/Ingestion/Buffer/ClickHouseIngestionClient.cs index d3d19ad..d4147e9 100755 --- a/src/Features/Ingestion/Buffer/ClickHouseIngestionClient.cs +++ b/src/Features/Ingestion/Buffer/ClickHouseIngestionClient.cs @@ -2,7 +2,7 @@ using Dapper; using ClickHouse.Client.Copy; using ClickHouse.Client.ADO; -namespace Aptabase.Features.Ingestion.Buffer; +namespace Zalvena.Features.Ingestion.Buffer; public class ClickHouseIngestionClient : IIngestionClient { diff --git a/src/Features/Ingestion/Buffer/EventBackgroundWritter.cs b/src/Features/Ingestion/Buffer/EventBackgroundWritter.cs index 3bd2146..78aabc0 100755 --- a/src/Features/Ingestion/Buffer/EventBackgroundWritter.cs +++ b/src/Features/Ingestion/Buffer/EventBackgroundWritter.cs @@ -1,9 +1,9 @@ using System.Diagnostics; -using Aptabase.Features.Privacy; +using Zalvena.Features.Privacy; -namespace Aptabase.Features.Ingestion.Buffer; +namespace Zalvena.Features.Ingestion.Buffer; public class EventBackgroundWritter : BackgroundService { diff --git a/src/Features/Ingestion/Buffer/EventRow.cs b/src/Features/Ingestion/Buffer/EventRow.cs index 2c495f9..5c76f3d 100755 --- a/src/Features/Ingestion/Buffer/EventRow.cs +++ b/src/Features/Ingestion/Buffer/EventRow.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace Aptabase.Features.Ingestion.Buffer; +namespace Zalvena.Features.Ingestion.Buffer; public readonly struct EventRow { diff --git a/src/Features/Ingestion/Buffer/IIngestionClient.cs b/src/Features/Ingestion/Buffer/IIngestionClient.cs index 98c77cc..9ecb2d5 100755 --- a/src/Features/Ingestion/Buffer/IIngestionClient.cs +++ b/src/Features/Ingestion/Buffer/IIngestionClient.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Ingestion.Buffer; +namespace Zalvena.Features.Ingestion.Buffer; public interface IIngestionClient { diff --git a/src/Features/Ingestion/Buffer/InMemoryEventBuffer.cs b/src/Features/Ingestion/Buffer/InMemoryEventBuffer.cs index 2849af6..ccf19ad 100755 --- a/src/Features/Ingestion/Buffer/InMemoryEventBuffer.cs +++ b/src/Features/Ingestion/Buffer/InMemoryEventBuffer.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Ingestion.Buffer; +namespace Zalvena.Features.Ingestion.Buffer; public interface IEventBuffer { diff --git a/src/Features/Ingestion/Buffer/TinybirdIngestionClient.cs b/src/Features/Ingestion/Buffer/TinybirdIngestionClient.cs index f61c069..6103290 100755 --- a/src/Features/Ingestion/Buffer/TinybirdIngestionClient.cs +++ b/src/Features/Ingestion/Buffer/TinybirdIngestionClient.cs @@ -1,6 +1,6 @@ using System.Text.Json.Serialization; -namespace Aptabase.Features.Ingestion.Buffer; +namespace Zalvena.Features.Ingestion.Buffer; public class InsertResult { diff --git a/src/Features/Ingestion/Buffer/TrackingEvent.cs b/src/Features/Ingestion/Buffer/TrackingEvent.cs index d28f71e..baa6efd 100755 --- a/src/Features/Ingestion/Buffer/TrackingEvent.cs +++ b/src/Features/Ingestion/Buffer/TrackingEvent.cs @@ -1,6 +1,6 @@ using System.Text.Json; -namespace Aptabase.Features.Ingestion; +namespace Zalvena.Features.Ingestion; public readonly struct TrackingEvent { diff --git a/src/Features/Ingestion/EventBody.cs b/src/Features/Ingestion/EventBody.cs index 8750be9..a3cbac6 100755 --- a/src/Features/Ingestion/EventBody.cs +++ b/src/Features/Ingestion/EventBody.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.Text.Json; using System.Text.Json.Nodes; -namespace Aptabase.Features.Ingestion; +namespace Zalvena.Features.Ingestion; public class SystemProperties { diff --git a/src/Features/Ingestion/EventsController.cs b/src/Features/Ingestion/EventsController.cs index a5e9176..11fd6fb 100755 --- a/src/Features/Ingestion/EventsController.cs +++ b/src/Features/Ingestion/EventsController.cs @@ -1,10 +1,10 @@ -using Aptabase.Features.GeoIP; -using Aptabase.Features.Ingestion.Buffer; +using Zalvena.Features.GeoIP; +using Zalvena.Features.Ingestion.Buffer; using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; -namespace Aptabase.Features.Ingestion; +namespace Zalvena.Features.Ingestion; [ApiController] [ResponseCache(NoStore = true, Location = ResponseCacheLocation.None)] diff --git a/src/Features/Ingestion/IngestionCache.cs b/src/Features/Ingestion/IngestionCache.cs index 243ae5c..d4083ad 100755 --- a/src/Features/Ingestion/IngestionCache.cs +++ b/src/Features/Ingestion/IngestionCache.cs @@ -1,7 +1,7 @@ -using Aptabase.Features.Apps; +using Zalvena.Features.Apps; using Microsoft.Extensions.Caching.Memory; -namespace Aptabase.Features.Ingestion; +namespace Zalvena.Features.Ingestion; public class CachedApplication { diff --git a/src/Features/Ingestion/LocaleFormatter.cs b/src/Features/Ingestion/LocaleFormatter.cs index 8d64dec..18f80dc 100755 --- a/src/Features/Ingestion/LocaleFormatter.cs +++ b/src/Features/Ingestion/LocaleFormatter.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Ingestion; +namespace Zalvena.Features.Ingestion; public static class LocaleFormatter { diff --git a/src/Features/Ingestion/UserAgentParser.cs b/src/Features/Ingestion/UserAgentParser.cs index 4047f81..f99a604 100755 --- a/src/Features/Ingestion/UserAgentParser.cs +++ b/src/Features/Ingestion/UserAgentParser.cs @@ -1,6 +1,6 @@ using System.Text.RegularExpressions; -namespace Aptabase.Features.Ingestion; +namespace Zalvena.Features.Ingestion; public static class UserAgentParser { diff --git a/src/Features/Notification/IEmailClient.cs b/src/Features/Notification/IEmailClient.cs index af6ed8a..c222377 100755 --- a/src/Features/Notification/IEmailClient.cs +++ b/src/Features/Notification/IEmailClient.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public interface IEmailClient { diff --git a/src/Features/Notification/LoggerEmailClient.cs b/src/Features/Notification/LoggerEmailClient.cs index 1a8eea0..1c00794 100755 --- a/src/Features/Notification/LoggerEmailClient.cs +++ b/src/Features/Notification/LoggerEmailClient.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public class LoggerEmailClient : IEmailClient { diff --git a/src/Features/Notification/MailCatcherSmtpClient.cs b/src/Features/Notification/MailCatcherSmtpClient.cs index df33b70..6eb1d42 100755 --- a/src/Features/Notification/MailCatcherSmtpClient.cs +++ b/src/Features/Notification/MailCatcherSmtpClient.cs @@ -1,6 +1,6 @@ using System.Net.Mail; -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public class MailCatcherSmtpClient : IEmailClient { @@ -16,7 +16,7 @@ public class MailCatcherSmtpClient : IEmailClient { var body = await _engine.Render(templateName, subject, properties); - using var message = new MailMessage("hi@aptabase.com", to) + using var message = new MailMessage("zalvena@sudovanilla.org", to) { Subject = subject, Body = body diff --git a/src/Features/Notification/NotificationExtensions.cs b/src/Features/Notification/NotificationExtensions.cs index 5b1a462..7a501f7 100755 --- a/src/Features/Notification/NotificationExtensions.cs +++ b/src/Features/Notification/NotificationExtensions.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public static class NotificationExtensions { diff --git a/src/Features/Notification/SESEmailClient.cs b/src/Features/Notification/SESEmailClient.cs index 4d5577a..c282551 100755 --- a/src/Features/Notification/SESEmailClient.cs +++ b/src/Features/Notification/SESEmailClient.cs @@ -2,7 +2,7 @@ using Amazon.Runtime.CredentialManagement; using Amazon.SimpleEmail; using Amazon.SimpleEmail.Model; -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public class SESEmailClient : IEmailClient { @@ -29,8 +29,8 @@ public class SESEmailClient : IEmailClient return new AmazonSimpleEmailServiceClient(); var chain = new CredentialProfileStoreChain(); - if (!chain.TryGetAWSCredentials("aptabase", out var credentials)) - throw new Exception("Failed to find the aptabase profile"); + if (!chain.TryGetAWSCredentials("zalvena", out var credentials)) + throw new Exception("Failed to find the zalvena profile"); return new AmazonSimpleEmailServiceClient(credentials, Amazon.RegionEndpoint.USEast1); } @@ -39,7 +39,7 @@ public class SESEmailClient : IEmailClient { return new SendEmailRequest { - Source = "Aptabase ", + Source = "Zalvena ", Destination = new Destination { ToAddresses = diff --git a/src/Features/Notification/SmtpEmailClient.cs b/src/Features/Notification/SmtpEmailClient.cs index 12f6a08..161ef82 100755 --- a/src/Features/Notification/SmtpEmailClient.cs +++ b/src/Features/Notification/SmtpEmailClient.cs @@ -1,7 +1,7 @@ using MimeKit; using MailKit.Net.Smtp; -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public class SmtpEmailClient : IEmailClient { diff --git a/src/Features/Notification/TemplateEngine.cs b/src/Features/Notification/TemplateEngine.cs index c60b89a..0b895af 100755 --- a/src/Features/Notification/TemplateEngine.cs +++ b/src/Features/Notification/TemplateEngine.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Text; using System.Web; -namespace Aptabase.Features.Notification; +namespace Zalvena.Features.Notification; public class TemplateEngine { @@ -28,7 +28,7 @@ public class TemplateEngine if (_templates.ContainsKey(name)) return _templates[name]; - var resourceStream = _assembly.GetManifestResourceStream($"Aptabase.assets.Templates.{name}.html"); + var resourceStream = _assembly.GetManifestResourceStream($"Zalvena.assets.Templates.{name}.html"); if (resourceStream == null) throw new Exception($"Failed to find the embedded resource named {name}"); diff --git a/src/Features/Privacy/DailyUserHasher.cs b/src/Features/Privacy/DailyUserHasher.cs index 16ce50a..9acd946 100755 --- a/src/Features/Privacy/DailyUserHasher.cs +++ b/src/Features/Privacy/DailyUserHasher.cs @@ -1,11 +1,11 @@ -using Aptabase.Data; +using Zalvena.Data; using System.Text; using System.Security.Cryptography; using Microsoft.Extensions.Caching.Memory; using Dapper; using FastHashes; -namespace Aptabase.Features.Privacy; +namespace Zalvena.Features.Privacy; public interface IUserHasher { diff --git a/src/Features/Privacy/PrivacyQueries.cs b/src/Features/Privacy/PrivacyQueries.cs index 2485778..2d6f221 100755 --- a/src/Features/Privacy/PrivacyQueries.cs +++ b/src/Features/Privacy/PrivacyQueries.cs @@ -1,7 +1,7 @@ -using Aptabase.Data; +using Zalvena.Data; using Dapper; -namespace Aptabase.Features.Privacy; +namespace Zalvena.Features.Privacy; public interface IPrivacyQueries { diff --git a/src/Features/Privacy/PurgeDailySaltsCronJob.cs b/src/Features/Privacy/PurgeDailySaltsCronJob.cs index 58c2fbf..4441067 100755 --- a/src/Features/Privacy/PurgeDailySaltsCronJob.cs +++ b/src/Features/Privacy/PurgeDailySaltsCronJob.cs @@ -1,6 +1,6 @@ using Sgbj.Cron; -namespace Aptabase.Features.Privacy; +namespace Zalvena.Features.Privacy; public class PurgeDailySaltsCronJob : BackgroundService { diff --git a/src/Features/Stats/ClickHouseQueryClient.cs b/src/Features/Stats/ClickHouseQueryClient.cs index edfd6a2..869a6fa 100755 --- a/src/Features/Stats/ClickHouseQueryClient.cs +++ b/src/Features/Stats/ClickHouseQueryClient.cs @@ -3,7 +3,7 @@ using Scriban; using ClickHouse.Client.ADO; using System.Collections.Concurrent; -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public class ClickHouseQueryClient : IQueryClient { diff --git a/src/Features/Stats/HasReadAccessToAppFilter.cs b/src/Features/Stats/HasReadAccessToAppFilter.cs index 55965f1..a5e4c22 100755 --- a/src/Features/Stats/HasReadAccessToAppFilter.cs +++ b/src/Features/Stats/HasReadAccessToAppFilter.cs @@ -1,9 +1,9 @@ -using Aptabase.Data; +using Zalvena.Data; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public class HasReadAccessToApp : ActionFilterAttribute { diff --git a/src/Features/Stats/IQueryClient.cs b/src/Features/Stats/IQueryClient.cs index 3c150ab..5ff8b06 100755 --- a/src/Features/Stats/IQueryClient.cs +++ b/src/Features/Stats/IQueryClient.cs @@ -1,4 +1,4 @@ -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public interface IQueryClient { diff --git a/src/Features/Stats/StatsController.cs b/src/Features/Stats/StatsController.cs index de85557..cf8ef66 100755 --- a/src/Features/Stats/StatsController.cs +++ b/src/Features/Stats/StatsController.cs @@ -1,9 +1,9 @@ -using Aptabase.Features.Authentication; -using Aptabase.Features.GeoIP; +using Zalvena.Features.Authentication; +using Zalvena.Features.GeoIP; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.RateLimiting; -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public record PeriodicStatsRow { diff --git a/src/Features/Stats/StatsQueries.cs b/src/Features/Stats/StatsQueries.cs index 7db9291..b2cc840 100755 --- a/src/Features/Stats/StatsQueries.cs +++ b/src/Features/Stats/StatsQueries.cs @@ -1,8 +1,8 @@ using Dapper; -using Aptabase.Data; -using Aptabase.Features.Authentication; +using Zalvena.Data; +using Zalvena.Features.Authentication; -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public static class StatsQueries { diff --git a/src/Features/Stats/TinybirdDateTimeJsonConverter.cs b/src/Features/Stats/TinybirdDateTimeJsonConverter.cs index 3690949..2e620d5 100755 --- a/src/Features/Stats/TinybirdDateTimeJsonConverter.cs +++ b/src/Features/Stats/TinybirdDateTimeJsonConverter.cs @@ -2,7 +2,7 @@ using System.Globalization; using System.Text.Json; using System.Text.Json.Serialization; -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public class TinybirdDateTimeJsonConverter : JsonConverter { diff --git a/src/Features/Stats/TinybirdQueryClient.cs b/src/Features/Stats/TinybirdQueryClient.cs index 05726f8..317ea24 100755 --- a/src/Features/Stats/TinybirdQueryClient.cs +++ b/src/Features/Stats/TinybirdQueryClient.cs @@ -3,7 +3,7 @@ using System.Text.Json; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Http.Extensions; -namespace Aptabase.Features.Stats; +namespace Zalvena.Features.Stats; public class QueryResult { diff --git a/src/Program.cs b/src/Program.cs index 6bf4a5d..8523585 100755 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,17 +1,17 @@ -using Aptabase.Data; -using Aptabase.Data.Migrations; -using Aptabase.Features; -using Aptabase.Features.Apps; -using Aptabase.Features.Authentication; -using Aptabase.Features.Billing; -using Aptabase.Features.Billing.LemonSqueezy; -using Aptabase.Features.Blob; -using Aptabase.Features.GeoIP; -using Aptabase.Features.Ingestion; -using Aptabase.Features.Ingestion.Buffer; -using Aptabase.Features.Notification; -using Aptabase.Features.Privacy; -using Aptabase.Features.Stats; +using Zalvena.Data; +using Zalvena.Data.Migrations; +using Zalvena.Features; +using Zalvena.Features.Apps; +using Zalvena.Features.Authentication; +using Zalvena.Features.Billing; +using Zalvena.Features.Billing.LemonSqueezy; +using Zalvena.Features.Blob; +using Zalvena.Features.GeoIP; +using Zalvena.Features.Ingestion; +using Zalvena.Features.Ingestion.Buffer; +using Zalvena.Features.Notification; +using Zalvena.Features.Privacy; +using Zalvena.Features.Stats; using ClickHouse.Client.ADO; using Features.Cache; using FluentMigrator.Runner; @@ -48,9 +48,17 @@ public partial class Program builder.Services.AddCors(options => { - options.AddPolicy(name: "AllowAptabaseCom", policy => + options.AddPolicy(name: "AllowZalvenaOrg", policy => { - policy.WithOrigins("https://aptabase.com") + policy.WithOrigins("https://events.sudovanilla.org") // Official Zalvena Instance + .WithMethods("GET") + .AllowCredentials() + .SetPreflightMaxAge(TimeSpan.FromHours(1)); + }); + + options.AddPolicy(name: "AllowZalvenaOrg", policy => + { + policy.WithOrigins("https://beta.events.sudovanilla.org") // Development Only .WithMethods("GET") .AllowCredentials() .SetPreflightMaxAge(TimeSpan.FromHours(1)); @@ -68,7 +76,7 @@ public partial class Program if (appEnv.IsManagedCloud) { builder.Services.AddDataProtection() - .PersistKeysToAWSSystemsManager("/aptabase/production/aspnet-dataprotection/"); + .PersistKeysToAWSSystemsManager("/zalvena/production/aspnet-dataprotection/"); } builder.Services.AddControllers(); diff --git a/src/Aptabase.csproj b/src/Zalvena.csproj similarity index 100% rename from src/Aptabase.csproj rename to src/Zalvena.csproj diff --git a/src/assets/Templates/Register.html b/src/assets/Templates/Register.html index 429e59a..b777331 100755 --- a/src/assets/Templates/Register.html +++ b/src/assets/Templates/Register.html @@ -1,7 +1,147 @@ -

Hi ##NAME##,

-

You asked for a magic link to Zalvena and here it is.

-

- Confirm your registration -

-

-

This link will only be valid for the next 15 minutes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/Templates/SignIn.html b/src/assets/Templates/SignIn.html index c858798..2ee9423 100755 --- a/src/assets/Templates/SignIn.html +++ b/src/assets/Templates/SignIn.html @@ -1,7 +1,150 @@ -

Hi ##NAME##,

-

You asked for a magic link and here it is.

-

- Log in to Aptabase -

-

-

This link will only be valid for the next 15 minutes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/index.html b/src/index.html index 93c1261..da57397 100755 --- a/src/index.html +++ b/src/index.html @@ -1,7 +1,7 @@ - Aptabase + Zalvena - + - diff --git a/src/webapp/analytics.ts b/src/webapp/analytics.ts deleted file mode 100755 index df3332e..0000000 --- a/src/webapp/analytics.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { init } from "@aptabase/web"; -import { isDevelopment, region } from "./features/env"; - -const devAppKey = "A-DEV-0000000000"; -const appKeys: { [host: string]: string } = { - us: "A-US-9580647299", - eu: "A-EU-2458276968", -}; - -const appKey = region ? appKeys[region] : isDevelopment ? devAppKey : undefined; - -export function initAnalytics() { - if (!appKey) return; - - init(appKey, { - appVersion: import.meta.env.APP_VERSION, - isDebug: isDevelopment, - }); -} diff --git a/src/webapp/components/RegionFlag.tsx b/src/webapp/components/RegionFlag.tsx index 0ae1c23..f796414 100755 --- a/src/webapp/components/RegionFlag.tsx +++ b/src/webapp/components/RegionFlag.tsx @@ -1,6 +1,8 @@ import { region } from "@features/env"; +import React from "react"; const flags: { [host: string]: string } = { + Mars: new URL('./icons/mars.svg', import.meta.url).href, us: new URL(`./icons/us.svg`, import.meta.url).href, eu: new URL(`./icons/eu.svg`, import.meta.url).href, }; diff --git a/src/webapp/components/icons/mars.svg b/src/webapp/components/icons/mars.svg new file mode 100644 index 0000000..dd32274 --- /dev/null +++ b/src/webapp/components/icons/mars.svg @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/webapp/features/analytics/HomePage.tsx b/src/webapp/features/analytics/HomePage.tsx index cc4c755..e6dd168 100755 --- a/src/webapp/features/analytics/HomePage.tsx +++ b/src/webapp/features/analytics/HomePage.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { LazyLoad } from "@components/LazyLoad"; import { Page, PageHeading } from "@components/Page"; import { useApps } from "@features/apps"; @@ -21,12 +20,6 @@ export function Component() { if (!startDateIso || !endDateIso) { return; } - - trackEvent("home_viewed", { - startDate: startDateIso, - endDate: endDateIso, - apps_count: apps.length, - }); }, [startDateIso, endDateIso, apps]); if (apps.length === 0) { diff --git a/src/webapp/features/analytics/LiveSessionDetailsPage.tsx b/src/webapp/features/analytics/LiveSessionDetailsPage.tsx index 50b3c7c..ae56fc0 100755 --- a/src/webapp/features/analytics/LiveSessionDetailsPage.tsx +++ b/src/webapp/features/analytics/LiveSessionDetailsPage.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { Button } from "@components/Button"; import { Page, PageHeading } from "@components/Page"; import { liveSessionDetails } from "@features/analytics/query"; @@ -29,9 +28,7 @@ export function Component() { refetchInterval: 10000, }); - useEffect(() => { - trackEvent("liveview_session_viewed"); - }, []); + useEffect(() => {}, []); const handleBack = () => { if (location.state?.returnTo) { diff --git a/src/webapp/features/analytics/LiveViewPage.tsx b/src/webapp/features/analytics/LiveViewPage.tsx index f5736be..5fedefe 100755 --- a/src/webapp/features/analytics/LiveViewPage.tsx +++ b/src/webapp/features/analytics/LiveViewPage.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { Page, PageHeading } from "@components/Page"; import { PingSignal } from "@components/PingSignal"; import { liveGeoDataPoints } from "@features/analytics/query"; @@ -24,9 +23,7 @@ export function Component() { refetchInterval: 10000, }); - useEffect(() => { - trackEvent("liveview_viewed", { name: app.name }); - }, [app.name]); + useEffect(() => {}, [app.name]); const totalUsers = dataPoints?.reduce((total, point) => total + point.users, 0) ?? 0; diff --git a/src/webapp/features/analytics/UserSessionsPage.tsx b/src/webapp/features/analytics/UserSessionsPage.tsx index ea10828..f53f428 100755 --- a/src/webapp/features/analytics/UserSessionsPage.tsx +++ b/src/webapp/features/analytics/UserSessionsPage.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { Page, PageHeading } from "@components/Page"; import { UserSessionsList } from "@features/analytics/sessions/UsersSessionsList"; import { useApps, useCurrentApp } from "@features/apps"; @@ -14,9 +13,7 @@ export function Component() { if (!app) return ; - useEffect(() => { - trackEvent("user_sessions_viewed"); - }, []); + useEffect(() => {}, [app.name]); return ( diff --git a/src/webapp/features/analytics/dashboard/custom-widgets/EventsChartWidget.tsx b/src/webapp/features/analytics/dashboard/custom-widgets/EventsChartWidget.tsx index 96fd371..ff9216f 100755 --- a/src/webapp/features/analytics/dashboard/custom-widgets/EventsChartWidget.tsx +++ b/src/webapp/features/analytics/dashboard/custom-widgets/EventsChartWidget.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { Button } from "@components/Button"; import { EventNameFilterDropdown } from "@features/analytics/sessions/filters/EventNameFilterDropdown"; import { useApps } from "@features/apps"; @@ -121,12 +120,6 @@ export function EventsChartWidget(props: Props) { useEffect(() => { if (!startDateIso || !endDateIso) return; - - trackEvent("custom_events_chart_viewed", { - startDate: startDateIso, - endDate: endDateIso, - name: props.appName, - }); }, [startDateIso, endDateIso, props.appName]); const total = useMemo( diff --git a/src/webapp/features/analytics/date-filters/DatePickerSuggestPeriod.tsx b/src/webapp/features/analytics/date-filters/DatePickerSuggestPeriod.tsx index 72c40ff..50800e5 100755 --- a/src/webapp/features/analytics/date-filters/DatePickerSuggestPeriod.tsx +++ b/src/webapp/features/analytics/date-filters/DatePickerSuggestPeriod.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { Tooltip } from "@components/Tooltip"; import { DateSuggestion } from "@datepicker-suggest/core"; import { DatePickerSuggest } from "@datepicker-suggest/react"; @@ -90,9 +89,7 @@ export function DatePickerSuggestPeriod() { } }; - useEffect(() => { - trackEvent("date_custom_used"); - }, []); + useEffect(() => {}, [app.name]); return ( <> diff --git a/src/webapp/features/analytics/key_metrics/MainChartWidget.tsx b/src/webapp/features/analytics/key_metrics/MainChartWidget.tsx index 92bba81..f6268eb 100755 --- a/src/webapp/features/analytics/key_metrics/MainChartWidget.tsx +++ b/src/webapp/features/analytics/key_metrics/MainChartWidget.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { useApps } from "@features/apps"; import { formatPeriod } from "@fns/format-date"; import { formatNumber } from "@fns/format-number"; @@ -80,11 +79,6 @@ export function MainChartWidget(props: Props) { if (!startDateIso || !endDateIso) { return; } - trackEvent("dashboard_viewed", { - startDate: startDateIso, - endDate: endDateIso, - name: props.appName, - }); }, [startDateIso, endDateIso, props.appName]); const users: number[] = [], diff --git a/src/webapp/features/analytics/mode/BuildModeSelector.tsx b/src/webapp/features/analytics/mode/BuildModeSelector.tsx index 9887444..1a043da 100755 --- a/src/webapp/features/analytics/mode/BuildModeSelector.tsx +++ b/src/webapp/features/analytics/mode/BuildModeSelector.tsx @@ -4,8 +4,8 @@ import { IconBug, IconRocket } from "@tabler/icons-react"; import { twJoin } from "tailwind-merge"; const options = [ - { icon: IconRocket, label: "Release", value: "release" as BuildMode }, - { icon: IconBug, label: "Debug", value: "debug" as BuildMode }, + { icon: IconRocket, label: "Production", value: "release" as BuildMode }, + { icon: IconBug, label: "Development", value: "debug" as BuildMode }, ]; export function BuildModeSelector() { @@ -44,14 +44,7 @@ export function BuildModeSelector() { ))} -

- Your data is separated by{" "} - - build mode - - . -

- +

Your data is separated by build mode.

); diff --git a/src/webapp/features/analytics/mode/DebugModeBanner.tsx b/src/webapp/features/analytics/mode/DebugModeBanner.tsx index f290ad8..fd07a87 100755 --- a/src/webapp/features/analytics/mode/DebugModeBanner.tsx +++ b/src/webapp/features/analytics/mode/DebugModeBanner.tsx @@ -8,20 +8,11 @@ export function DebugModeBanner() { - Debug Data + Development Data -

The dashboard is showing data from debug mode.

-

- - Switch to release mode - {" "} - to see production data. -

+

The dashboard is showing data from development mode.

+

Switch to production mode to see production data.

diff --git a/src/webapp/features/apps/AppSharing.tsx b/src/webapp/features/apps/AppSharing.tsx index 883305d..628bf10 100755 --- a/src/webapp/features/apps/AppSharing.tsx +++ b/src/webapp/features/apps/AppSharing.tsx @@ -61,7 +61,7 @@ export function AppSharing(props: Props) { type="email" required={true} value={email} - placeholder="peter.parker@corp.com" + placeholder="nemo@example.org" maxLength={300} onChange={(e) => setEmail(e.target.value)} description="Enter the email address you want to share your app with." diff --git a/src/webapp/features/auth/DataResidency.tsx b/src/webapp/features/auth/DataResidency.tsx index 4cc2834..7cddccb 100755 --- a/src/webapp/features/auth/DataResidency.tsx +++ b/src/webapp/features/auth/DataResidency.tsx @@ -9,7 +9,7 @@ export function DataResidency() {
-

{region.toUpperCase()} Data Residency

+

{region} Server

); } diff --git a/src/webapp/features/auth/LegalNotice.tsx b/src/webapp/features/auth/LegalNotice.tsx index 16cc78e..677a674 100755 --- a/src/webapp/features/auth/LegalNotice.tsx +++ b/src/webapp/features/auth/LegalNotice.tsx @@ -10,9 +10,9 @@ export function LegalNotice(props: Props) { return (

By {props.operation === "signin" ? "signing in" : "signing up"}, you agree - to our{" "} + to the{" "} @@ -20,7 +20,7 @@ export function LegalNotice(props: Props) { {" "} and{" "} diff --git a/src/webapp/features/auth/LoginPage.backup.tsx b/src/webapp/features/auth/LoginPage.backup.tsx index f5c36ef..887a9cb 100755 --- a/src/webapp/features/auth/LoginPage.backup.tsx +++ b/src/webapp/features/auth/LoginPage.backup.tsx @@ -110,7 +110,7 @@ export function Component() { label="Enter your email address" name="email" type="email" - placeholder="peter.parker@corp.com" + placeholder="nemo@example.org" autoComplete="email" value={email} required={true} @@ -123,7 +123,7 @@ export function Component() { - + {/* */} {/* No others servers at this moment */} ); diff --git a/src/webapp/features/auth/LoginPage.tsx b/src/webapp/features/auth/LoginPage.tsx index 59d6720..a0676a5 100755 --- a/src/webapp/features/auth/LoginPage.tsx +++ b/src/webapp/features/auth/LoginPage.tsx @@ -1,9 +1,11 @@ import { requestSignInLink } from "@features/auth"; -import { Page } from "@components/Page"; import React, { useState } from "react"; import { Link, useSearchParams } from "react-router-dom"; import { Button } from "@components/Button"; import { TextInput } from "@components/TextInput"; +import { IconSend } from "@tabler/icons-react"; +import { DataResidency } from "./DataResidency"; +import { LegalNotice } from "./LegalNotice"; type FormStatus = "idle" | "loading" | "success" | "notfound"; @@ -16,8 +18,7 @@ const SignUpMessage = () => ( Don't have an account?{" "} Sign up - {" "} - for free. + ! ); @@ -49,7 +50,7 @@ const RedirectErrorMessage = () => { return (

- {message} Link invalid, try again. Links only last 15 minutes. + {message} Link invalid, try again.

); }; @@ -73,37 +74,33 @@ export function Component() {

Zalvena

+
+ +
-

+
+

Login to your account

- - -
-
diff --git a/src/webapp/features/auth/Logo.tsx b/src/webapp/features/auth/Logo.tsx index 4cd1bb9..2a2b418 100755 --- a/src/webapp/features/auth/Logo.tsx +++ b/src/webapp/features/auth/Logo.tsx @@ -1,14 +1,20 @@ +import React from "react"; + type Props = { className?: string; }; export function Logo(props: Props) { return ( - - + + +
+
+ + + + +
); -} +} \ No newline at end of file diff --git a/src/webapp/features/auth/RegionSwitch.tsx b/src/webapp/features/auth/RegionSwitch.tsx index e93c534..fa47092 100755 --- a/src/webapp/features/auth/RegionSwitch.tsx +++ b/src/webapp/features/auth/RegionSwitch.tsx @@ -1,10 +1,11 @@ import { isManagedCloud, region } from "@features/env"; +import React from "react"; export function RegionSwitch() { if (!isManagedCloud) return null; - const otherRegion = region === "eu" ? "us" : "eu"; - const href = `https://${otherRegion}.aptabase.com`; + const otherRegion = region === "eu" ? "Mars" : "eu"; + const href = `https://${otherRegion}.events.sudovanilla.org`; return (
diff --git a/src/webapp/features/auth/RegisterPage.backup.tsx b/src/webapp/features/auth/RegisterPage.backup.tsx new file mode 100755 index 0000000..d5f315e --- /dev/null +++ b/src/webapp/features/auth/RegisterPage.backup.tsx @@ -0,0 +1,102 @@ +import { requestRegisterLink } from "@features/auth"; +import { Page } from "@components/Page"; +import { useState } from "react"; +import { Link } from "react-router-dom"; +import { DataResidency } from "./DataResidency"; +import { LegalNotice } from "./LegalNotice"; +import { RegionSwitch } from "./RegionSwitch"; +import { SignInWithGitHub } from "./SignInWithGitHub"; +import { SignInWithGoogle } from "./SignInWithGoogle"; +import { isOAuthEnabled } from "@features/env"; +import { Logo } from "./Logo"; +import { Button } from "@components/Button"; +import { TextInput } from "@components/TextInput"; +import React from "react"; + +type FormStatus = "idle" | "loading" | "success"; + +type StatusMessageProps = { + status: FormStatus; +}; + +const StatusMessage = (props: StatusMessageProps) => { + if (props.status === "success") { + return Woo-hoo! Email sent, go check your inbox!; + } + + return ( + <> + Already registered?{" "} + + Sign in + {" "} + to your account. + + ); +}; + +Component.displayName = "RegisterPage"; +export function Component() { + const [name, setName] = useState(""); + const [email, setEmail] = useState(""); + const [status, setStatus] = useState("idle"); + + const handleSubmit = async (event: React.FormEvent) => { + event.preventDefault(); + setStatus("loading"); + + await requestRegisterLink(name, email); + + setStatus("success"); + }; + + return ( + +
+ +

Sign up for an account

+ +
+
+
+ +
+ + +
+ setName(e.target.value)} + /> + setEmail(e.target.value)} + /> + +

+ +

+ +
+ + {/* */} +
+ + ); +} diff --git a/src/webapp/features/auth/RegisterPage.tsx b/src/webapp/features/auth/RegisterPage.tsx index db8ad0d..110f8c4 100755 --- a/src/webapp/features/auth/RegisterPage.tsx +++ b/src/webapp/features/auth/RegisterPage.tsx @@ -1,16 +1,12 @@ import { requestRegisterLink } from "@features/auth"; -import { Page } from "@components/Page"; import { useState } from "react"; import { Link } from "react-router-dom"; import { DataResidency } from "./DataResidency"; import { LegalNotice } from "./LegalNotice"; -import { RegionSwitch } from "./RegionSwitch"; -import { SignInWithGitHub } from "./SignInWithGitHub"; -import { SignInWithGoogle } from "./SignInWithGoogle"; -import { isOAuthEnabled } from "@features/env"; -import { Logo } from "./Logo"; import { Button } from "@components/Button"; import { TextInput } from "@components/TextInput"; +import React from "react"; +import { IconSend } from "@tabler/icons-react"; type FormStatus = "idle" | "loading" | "success"; @@ -50,59 +46,45 @@ export function Component() { }; return ( - -
- -

Sign up for an account

- -
-
-
- {isOAuthEnabled && ( - <> -
- - -
-
- - - )} - -
- setName(e.target.value)} - /> - setEmail(e.target.value)} - /> - -

- -

- +
+
+
+ +

Zalvena

+
+ +
+
+
+

Sign up for an account

+
+
+ setName(e.target.value)} + /> + setEmail(e.target.value)} + /> +
+
+ +
+
+

+
+ +
- -
- - ); +
+ ) } diff --git a/src/webapp/features/auth/auth.ts b/src/webapp/features/auth/auth.ts index 15247b7..dc4de6b 100755 --- a/src/webapp/features/auth/auth.ts +++ b/src/webapp/features/auth/auth.ts @@ -1,5 +1,4 @@ import { api } from "@fns/api"; -import { trackEvent } from "@aptabase/web"; export type UserAccount = { id: string; @@ -22,7 +21,6 @@ export async function requestSignInLink(email: string): Promise { export async function requestRegisterLink(name: string, email: string): Promise { await api.post("/_auth/register", { name, email }); - trackEvent("register"); } export async function me(): Promise { diff --git a/src/webapp/features/billing/BillingPage.tsx b/src/webapp/features/billing/BillingPage.tsx deleted file mode 100755 index 39a65be..0000000 --- a/src/webapp/features/billing/BillingPage.tsx +++ /dev/null @@ -1,123 +0,0 @@ -import { Button } from "@components/Button"; -import { ErrorState } from "@components/ErrorState"; -import { LoadingState } from "@components/LoadingState"; -import { Page, PageHeading } from "@components/Page"; -import { formatPeriod } from "@fns/format-date"; -import { useState } from "react"; -import { CurrentPlan } from "./CurrentPlan"; -import { CurrentUsage } from "./CurrentUsage"; -import { DeleteAccountModal } from "./DeleteAccountModal"; -import { MonthlyUsageChart } from "./MonthlyUsageChart"; -import { BillingHistoricalUsage, BillingInfo, useBilling, useHistoricalData } from "./useBilling"; - -Component.displayName = "BillingPage"; -export function Component() { - const { isLoading: isLoadingBilling, isError: isErrorBilling, data: billing } = useBilling(); - const { isLoading: isLoadingHistorical, isError: isErrorHistorical, data: historical } = useHistoricalData(); - - const isLoading = isLoadingBilling || isLoadingHistorical; - const isError = isErrorBilling || isErrorHistorical; - - return ( - - - -
- {isLoading && } - {isError && } - {billing && historical && } -
-
- ); -} - -function Body(props: { billing: BillingInfo; historical: BillingHistoricalUsage[] }) { - const [showDeleteModal, setShowDeleteModal] = useState(false); - const openDeleteModal = () => setShowDeleteModal(true); - const closeDeleteModal = () => setShowDeleteModal(false); - - return ( - <> -
-
- -
-
- -
-
-
-

Monthly Usage

- -
- formatPeriod("month", x.date))} - events={props.historical.map((x) => x.events)} - state={props.billing.state} - quota={props.billing.plan.monthlyEvents} - /> -
- -
-
-
- Limit -
- -
-
- Usage -
-
-
- -
- -
- -
-
- - - - ); -} - -function DangerZoneItem({ - title, - description, - subDescription, - actionText, - onClick, -}: { - title: string; - description: string; - subDescription: string; - actionText: string; - onClick: () => void; -}) { - return ( -
-
-

{title}

-

{description}

-

{subDescription}

-
- -
- ); -} diff --git a/src/webapp/features/billing/CurrentPlan.tsx b/src/webapp/features/billing/CurrentPlan.tsx deleted file mode 100755 index 96fdea4..0000000 --- a/src/webapp/features/billing/CurrentPlan.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { api } from "@fns/api"; -import { useState } from "react"; -import { SubscriptionStatusBadge } from "./SubscriptionStatusBadge"; -import { BillingInfo } from "./useBilling"; -import { Button } from "@components/Button"; -import { formatDate } from "@fns/format-date"; - -type Props = { - billing: BillingInfo; -}; - -export function CurrentPlan(props: Props) { - const [loading, setLoading] = useState(false); - - const status = props.billing.subscription?.status; - const expiresOn = status === "cancelled" ? props.billing.subscription?.endsAt : undefined; - const isExpired = status === "expired"; - const hasSubscription = !!props.billing.subscription; - - const action = async () => { - setLoading(true); - - const path = hasSubscription ? `/_billing/portal` : `/_billing/checkout`; - const response = await api.post<{ url: string }>(path); - location.href = response.url; - }; - - return ( -
-

- {props.billing.plan.name} - {props.billing.plan.monthlyPrice > 0 && ( - - ${props.billing.plan.monthlyPrice} /mo + Tax - - )} -

-

- {props.billing.plan.freeTrialEndsAt ? ( - - Free access until - {new Date(props.billing.plan.freeTrialEndsAt).toLocaleDateString()} - - ) : ( - - {props.billing.plan.monthlyEvents.toLocaleString()}{" "} - events / mo - - )} - -

- {status && !isExpired && ( -

- - {expiresOn && Expires on {formatDate(expiresOn)}} -

- )} -
- ); -} diff --git a/src/webapp/features/billing/CurrentUsage.tsx b/src/webapp/features/billing/CurrentUsage.tsx deleted file mode 100755 index 4ae3b94..0000000 --- a/src/webapp/features/billing/CurrentUsage.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { PingSignal } from "@components/PingSignal"; -import { twMerge } from "tailwind-merge"; - -const months = [ - "January", - "February", - "March", - "April", - "May", - "June", - "July", - "August", - "September", - "October", - "November", - "December", -]; - -type Props = { - month: number; - year: number; - usage: number; - quota: number; - state: "OK" | "OVERUSE"; -}; - -const colors = { - OK: "bg-primary", - OVERUSE: "bg-destructive", -}; - -export function CurrentUsage(props: Props) { - const percentage = (props.usage / props.quota) * 100; - - return ( -
-
- Usage - - {months[props.month - 1]} / {props.year} - -
-
-
- {props.usage.toLocaleString()} - - / {props.quota.toLocaleString()} events ({percentage.toFixed(2)} - %) - - {props.state === "OVERUSE" && } -
-
-
-
-
-
- ); -} diff --git a/src/webapp/features/billing/MonthlyUsageChart.tsx b/src/webapp/features/billing/MonthlyUsageChart.tsx deleted file mode 100755 index e68e823..0000000 --- a/src/webapp/features/billing/MonthlyUsageChart.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { Chart } from "@components/Chart"; -import { useChartColors } from "@features/theme"; -import { ChartConfigurationCustomTypesPerDataset } from "chart.js"; - -type Props = { - dates: string[]; - events: number[]; - quota: number; - state: "OK" | "OVERUSE"; -}; - -export function MonthlyUsageChart(props: Props) { - const colors = useChartColors(); - - const config: ChartConfigurationCustomTypesPerDataset = { - data: { - labels: props.dates, - datasets: [ - { - type: "bar", - label: "Daily Users", - data: props.events, - backgroundColor: colors.primary, - hoverBackgroundColor: colors.primary, - }, - { - type: "line", - data: props.events.map(() => props.quota), - borderColor: props.state === "OK" ? colors.success : colors.destructive, - borderWidth: 2, - pointRadius: 0, - pointHoverRadius: 0, - }, - ], - }, - options: { - plugins: { - tooltip: { - enabled: false, - }, - }, - animation: false, - interaction: { - mode: "index", - intersect: false, - }, - maintainAspectRatio: false, - layout: { - padding: 0, - }, - scales: { - x: { - grid: { - display: false, - }, - border: { - display: false, - }, - }, - y: { - grid: { - color: colors.highlight, - tickWidth: 0, - }, - beginAtZero: true, - ticks: { - maxTicksLimit: 8, - }, - border: { - display: false, - }, - }, - }, - }, - }; - - return ; -} diff --git a/src/webapp/features/billing/SubscriptionStatusBadge.tsx b/src/webapp/features/billing/SubscriptionStatusBadge.tsx deleted file mode 100755 index de657d4..0000000 --- a/src/webapp/features/billing/SubscriptionStatusBadge.tsx +++ /dev/null @@ -1,23 +0,0 @@ -/* -Possible statuses: -- active -- cancelled -- expired -- paused -- past_due -- unpaid -*/ - -const statuses: Record = { - active: ["Active", "text-success"], - cancelled: ["Cancelled", "text-destructive"], - expired: ["Expired", "text-destructive"], - paused: ["Paused", "text-primary"], - past_due: ["Past Due", "text-destructive"], - unpaid: ["Unpaid", "text-destructive"], -}; - -export function SubscriptionStatusBadge(props: { status: string }) { - const [statusFormatted, color] = statuses[props.status] ?? [props.status, ""]; - return {statusFormatted}; -} diff --git a/src/webapp/features/billing/TrialReminder.tsx b/src/webapp/features/billing/TrialReminder.tsx deleted file mode 100755 index 1689d12..0000000 --- a/src/webapp/features/billing/TrialReminder.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { Link } from "react-router-dom"; -import { useBilling } from "./useBilling"; -import { Alert, AlertDescription } from "@components/Alert"; -import { isBillingEnabled } from "@features/env"; - -export function TrialReminder() { - const { data: billing } = useBilling(); - - if (!isBillingEnabled || !billing || !billing.plan.freeTrialEndsAt) return null; - - const endsAt = new Date(billing.plan.freeTrialEndsAt); - const differenceInMs = new Date(endsAt).getTime() - new Date().getTime(); - const days = Math.floor(differenceInMs / (1000 * 60 * 60 * 24)); - - if (days <= -1) return null; - - return ( - - - - Trial{" "} - {days === 1 ? `ends tomorrow` : days > 0 ? `ends in ${days} days` : days === 0 ? "ends today" : "expired"} - - - - ); -} diff --git a/src/webapp/features/billing/index.tsx b/src/webapp/features/billing/index.tsx deleted file mode 100755 index 33c9112..0000000 --- a/src/webapp/features/billing/index.tsx +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./useBilling"; -export * from "./TrialReminder"; diff --git a/src/webapp/features/billing/useBilling.tsx b/src/webapp/features/billing/useBilling.tsx deleted file mode 100755 index 878461b..0000000 --- a/src/webapp/features/billing/useBilling.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { UseQueryResult, useQuery } from "@tanstack/react-query"; -import { api } from "@fns/api"; -import { isBillingEnabled } from "@features/env"; - -export type BillingInfo = { - usage: number; - month: number; - year: number; - state: "OK" | "OVERUSE"; - subscription?: { - status: string; - endsAt: string; - }; - plan: { - name: string; - monthlyPrice: number; - monthlyEvents: number; - freeTrialEndsAt?: string; - }; -}; - -export type BillingHistoricalUsage = { - date: string; - events: number; -}; - -export function useBilling(): UseQueryResult { - return useQuery({ queryKey: ["billing"], queryFn: () => api.get(`/_billing`), refetchOnMount: true }); -} - -export function useHistoricalData(): UseQueryResult { - return useQuery({ - queryKey: ["billing-historical"], - queryFn: () => api.get(`/_billing/historical`), - }); -} - -export function useBillingState(): "OK" | "OVERUSE" { - if (!isBillingEnabled) return "OK"; - - const { data } = useBilling(); - return data?.state ?? "OK"; -} diff --git a/src/webapp/features/env/env.ts b/src/webapp/features/env/env.ts index 61f24ff..2ade437 100755 --- a/src/webapp/features/env/env.ts +++ b/src/webapp/features/env/env.ts @@ -1,6 +1,5 @@ -const regions: { [host: string]: "eu" | "us" } = { - "us.aptabase.com": "us", - "eu.aptabase.com": "eu", +const regions: { [host: string]: "Mars" } = { + "beta.events.sudovanilla.org": "Mars" }; function getUserHourCycle(): "h12" | "h24" { diff --git a/src/webapp/features/export/YearlyGrid.tsx b/src/webapp/features/export/YearlyGrid.tsx index 0077158..67c3378 100755 --- a/src/webapp/features/export/YearlyGrid.tsx +++ b/src/webapp/features/export/YearlyGrid.tsx @@ -1,4 +1,3 @@ -import { trackEvent } from "@aptabase/web"; import { Button } from "@components/Button"; import { Popover, PopoverContent, PopoverTrigger } from "@components/Popover"; import { Application, BuildMode } from "@features/apps"; @@ -36,9 +35,7 @@ export function YearlyGrid(props: Props) { const endDateUTC = new Date(endDate!.getTime() - endDate!.getTimezoneOffset() * 60000); params.set("startDate", startDateUTC.toISOString()); params.set("endDate", endDateUTC.toISOString()); - - trackEvent("export", { name: props.app.name }); - + location.href = `/api/_export/download?${params.toString()}`; }; diff --git a/src/webapp/features/navigation/NavMenu.tsx b/src/webapp/features/navigation/NavMenu.tsx index 56c85fd..99bf4dc 100755 --- a/src/webapp/features/navigation/NavMenu.tsx +++ b/src/webapp/features/navigation/NavMenu.tsx @@ -9,6 +9,7 @@ import { } from "@tabler/icons-react"; import { NavCategory } from "./NavCategory"; import { NavItem } from "./NavItem"; +import React from "react"; export function NavMenu(props: { onNavigation?: VoidFunction }) { const currentApp = useCurrentApp(); @@ -19,6 +20,9 @@ export function NavMenu(props: { onNavigation?: VoidFunction }) { + +

{!currentApp ? 'Select an app' : currentApp.appKey}

+
); -} +} \ No newline at end of file diff --git a/src/webapp/features/navigation/UserMenu.tsx b/src/webapp/features/navigation/UserMenu.tsx index 0dd6abb..6d88ae5 100755 --- a/src/webapp/features/navigation/UserMenu.tsx +++ b/src/webapp/features/navigation/UserMenu.tsx @@ -1,6 +1,4 @@ import { PingSignal } from "@components/PingSignal"; -import { useBillingState } from "@features/billing"; -import { isBillingEnabled } from "@features/env"; import { ThemeToggle } from "@features/theme"; import { Menu, Transition } from "@headlessui/react"; import { IconCreditCard, IconDoorExit } from "@tabler/icons-react"; @@ -39,7 +37,6 @@ const MenuItem = (props: { ); export function UserMenu(props: Props) { - const billing = useBillingState(); return ( @@ -48,7 +45,6 @@ export function UserMenu(props: Props) { <>
{props.user.name}
- {!open && billing === "OVERUSE" && } )} @@ -69,16 +65,11 @@ export function UserMenu(props: Props) {
- {isBillingEnabled && ( - <> - - - - Billing & Profile - {billing === "OVERUSE" && } - - - )} + + + + Profile + diff --git a/src/webapp/features/profile/Account.tsx b/src/webapp/features/profile/Account.tsx new file mode 100644 index 0000000..5e9e417 --- /dev/null +++ b/src/webapp/features/profile/Account.tsx @@ -0,0 +1,66 @@ +import { Button } from "@components/Button"; +import { PageHeading } from "@components/Page"; +import React from "react"; +import { useState } from "react"; +import { DeleteAccountModal } from "./DeleteAccountModal"; +import { Page } from "../../components/Page"; + +export function Component() { + return ( + + + + ); +} + +function Body() { + const [showDeleteModal, setShowDeleteModal] = useState(false); + const openDeleteModal = () => setShowDeleteModal(true); + const closeDeleteModal = () => setShowDeleteModal(false); + + return ( + <> +
+ +
+ +
+
+ + + + ); +} + +function DangerZoneItem({ + title, + description, + subDescription, + actionText, + onClick, +}: { + title: string; + description: string; + subDescription: string; + actionText: string; + onClick: () => void; +}) { + return ( +
+
+

{title}

+

{description}

+

{subDescription}

+
+ +
+ ); +} \ No newline at end of file diff --git a/src/webapp/features/billing/DeleteAccountModal.tsx b/src/webapp/features/profile/DeleteAccountModal.tsx old mode 100755 new mode 100644 similarity index 100% rename from src/webapp/features/billing/DeleteAccountModal.tsx rename to src/webapp/features/profile/DeleteAccountModal.tsx diff --git a/src/webapp/features/theme/useChartColors.ts b/src/webapp/features/theme/useChartColors.ts index 407eb96..ed05495 100755 --- a/src/webapp/features/theme/useChartColors.ts +++ b/src/webapp/features/theme/useChartColors.ts @@ -23,9 +23,9 @@ type ChartColors = { const getColors = (): ChartColors => { const root = getComputedStyle(document.body); return { - primary: "#60A5FA", + primary: "#498975", primaryBackground: (chart: Chart) => - createLinearGradient(chart, "rgba(96, 165, 250, 0.2)", "rgba(96, 165, 250, 0)"), + createLinearGradient(chart, "rgba(129, 250, 96, 0.2)", "rgba(142, 250, 96, 0)"), success: `hsl(${root.getPropertyValue("--success")})`, destructive: `hsl(${root.getPropertyValue("--destructive")})`, warning: `hsl(${root.getPropertyValue("--warning")})`, diff --git a/src/webapp/layout/ConsoleLayout.tsx b/src/webapp/layout/ConsoleLayout.tsx index 0e51fdb..65d4a26 100755 --- a/src/webapp/layout/ConsoleLayout.tsx +++ b/src/webapp/layout/ConsoleLayout.tsx @@ -1,4 +1,3 @@ -import { TrialReminder } from "@features/billing"; import { AppSelector } from "../features/apps"; import { useAuthState } from "../features/auth"; import { MobileSidebar, NavMenu, UserMenu } from "../features/navigation"; @@ -27,7 +26,6 @@ export function ConsoleLayout() {
-
diff --git a/src/webapp/main.tsx b/src/webapp/main.tsx index f4b103b..ae6965a 100755 --- a/src/webapp/main.tsx +++ b/src/webapp/main.tsx @@ -6,7 +6,6 @@ import { Provider } from "jotai"; import React from "react"; import ReactDOM from "react-dom/client"; import { RouterProvider } from "react-router-dom"; -import { initAnalytics } from "./analytics"; import router from "./router"; const queryClient = new QueryClient({ @@ -17,8 +16,6 @@ const queryClient = new QueryClient({ }, }); -initAnalytics(); - const root = document.getElementById("root") as HTMLElement; ReactDOM.createRoot(root).render( diff --git a/src/webapp/public/favicon-16x16.png b/src/webapp/public/favicon-16x16.png old mode 100755 new mode 100644 index 3174a45..476d311 Binary files a/src/webapp/public/favicon-16x16.png and b/src/webapp/public/favicon-16x16.png differ diff --git a/src/webapp/public/favicon-32x32.png b/src/webapp/public/favicon-32x32.png old mode 100755 new mode 100644 index de07b8a..903f617 Binary files a/src/webapp/public/favicon-32x32.png and b/src/webapp/public/favicon-32x32.png differ diff --git a/src/webapp/public/favicon.ico b/src/webapp/public/favicon.ico old mode 100755 new mode 100644 index 762ba7a..6b584aa Binary files a/src/webapp/public/favicon.ico and b/src/webapp/public/favicon.ico differ diff --git a/src/webapp/router.tsx b/src/webapp/router.tsx index f034449..b5fc228 100755 --- a/src/webapp/router.tsx +++ b/src/webapp/router.tsx @@ -62,8 +62,8 @@ const router = createBrowserRouter([ lazy: () => import("./features/apps/SettingsPage"), }, { - path: "/billing", - lazy: () => import("./features/billing/BillingPage"), + path: "/profile", + lazy: () => import("./features/profile/Account"), }, ], }, diff --git a/src/webapp/styles/index.css b/src/webapp/styles/index.css index bc78ef4..718c7a0 100755 --- a/src/webapp/styles/index.css +++ b/src/webapp/styles/index.css @@ -86,6 +86,13 @@ @apply bg-muted-foreground; } +.ap-sb-key { + background: #141414; + padding: 6px 12px 6px 36px; + border-radius: 4px; + font-size: 14px; +} + /* Login Page */ .login { position: fixed; @@ -102,7 +109,8 @@ transform: translate(-50%, -50%); width: 100%; height: 100%; - display: flex; + display: grid; + grid-template-columns: 40% 60%; background: black; border-radius: 12px; border: 2px #242424 solid; @@ -110,7 +118,6 @@ } .lb-start { width: 100%; - max-width: 524px; position: relative; } .lb-start img { @@ -142,7 +149,7 @@ display: flex; flex-direction: column; padding: 48px 24px; - text-align: center; + text-align: left; width: 100%; justify-content: center; align-items: center; @@ -164,7 +171,7 @@ } .lb-end form { display: flex; - flex-direction: column; + flex-direction: row; gap: 12px; } .lb-end hr { @@ -175,7 +182,74 @@ cursor: not-allowed; } .lb-end h2 { - text-align: center; font-size: 18px; margin-bottom: 14px; +} +.lb-end-footer { + position: absolute; + bottom: 0px; + right: 0px; + margin: 24px; +} +.lb-form { + display: flex !important; + flex-direction: row; + gap: 6px !important; + align-items: center; +} +.lb-form-button { + max-width: 40px; +} +.lb-form-button button { + max-width: 40px !important; + max-height: 40px; +} +.lb-form-button button svg { + transform: scale(2.4); +} +.lb-end #status { + margin-top: 12px; +} + +.server-area { + display: none; +} + +.lb-form-inputs { + display: flex; + gap: 6px; +} + +@media screen and (max-width: 800px) { + .lb-start { + display: none; + } + .login-box { + grid-template-columns: 100%; + } + .lb-form, .lb-form-inputs { + flex-direction: column !important; + } + .lb-form-button { + display: flex; + max-width: 100% !important; + justify-content: right; + } + .lb-end #status { + margin-top: -32px; + } +} +@media screen and (max-width: 440px) { + .lb-end #status { + margin-top: inherit !important; + } +} + +/* Change da colors */ + +.text-primary { + color: #498975 !important; +} +.bg-primary, .bg-primary-100 { + background: #498975 !important; } \ No newline at end of file