diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index 25a5288..461d049 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -43,6 +43,10 @@ export default defineConfig({ { text: "Router", link: "/experimental/router" }, ], }, + { + text: "Showcase", + items: [{ text: "Spentoday", link: "/showcase/spentoday" }], + }, ], socialLinks: [ diff --git a/docs/media/spentoday/architecture.png b/docs/media/spentoday/architecture.png new file mode 100644 index 0000000..287f007 Binary files /dev/null and b/docs/media/spentoday/architecture.png differ diff --git a/docs/showcase/spentoday.md b/docs/showcase/spentoday.md new file mode 100644 index 0000000..73b87ae --- /dev/null +++ b/docs/showcase/spentoday.md @@ -0,0 +1,19 @@ +--- +outline: deep +--- + +# Spentoday + +Unator as a library was born during development of [Spentoday](https://www.spentoday.com/). + +Spentoday is E-commerce platform for Ukrainian market. User is able to create a shop with free domain or custom one. All shops are separated from each other, so it's more like Shopify rather than marketplace. + +## Architecture + +![Diagram](../media/spentoday/architecture.png) + +In our case Spentoday had a C# ASP.NET Core backend and 2 SvelteKit frontends. +And because we needed to start without spending as little as possible, I designed switches: + +- [Email switch](../switches/email.md) to use several email services +- [Storage switch](../switches/storage.md) to use several storages in future diff --git a/src/Web/Email.cs b/src/Web/Email.cs index d3c1399..93c99ee 100644 --- a/src/Web/Email.cs +++ b/src/Web/Email.cs @@ -68,7 +68,7 @@ public void RenderText(StringBuilder sb) sb.Append('\n'); foreach (var child in children) { - child.RenderHtml(sb); + child.RenderText(sb); } sb.Append('\n'); } @@ -79,7 +79,7 @@ public struct HtmlElement(IElement[] children) : IElement public void RenderHtml(StringBuilder sb) { sb.Append(""); - sb.Append(""); + sb.Append(""); foreach (var child in children) { child.RenderHtml(sb); @@ -91,7 +91,7 @@ public void RenderText(StringBuilder sb) { foreach (var child in children) { - child.RenderHtml(sb); + child.RenderText(sb); } } } diff --git a/src/Web/Program.cs b/src/Web/Program.cs index eb7413f..2d70f72 100644 --- a/src/Web/Program.cs +++ b/src/Web/Program.cs @@ -4,23 +4,26 @@ string? preheader = "Showing Jooble Unator library"; -var email = Email.Html( - preheader is not null ? Email.Preview(preheader) : Email.Empty(), +//var email = Email.Html("lang='uk' style='display:none;'", - Email.H1("Hi Jooble"), +// ("style", "display:none;"), ("lang", "uk"), ("disabled") - Email.Link(href: "https://roman-koshchei.github.io/unator", "Best C# utilities") -); +// preheader is not null ? Email.Preview(preheader) : Email.Empty(), -var text = new StringBuilder(); -email.RenderText(text); -Console.WriteLine(text.ToString()); -Console.WriteLine(); +// Email.H1("Hi Jooble"), -var html = new StringBuilder(); -email.RenderHtml(html); -Console.WriteLine(html.ToString()); -Console.WriteLine(); +// Email.Link(href: "https://roman-koshchei.github.io/unator", "Best C# utilities") +//).Style("display:none;").Lang("uk").Attribute("dlr", "blablabla").Flag("disabled"); + +//var text = new StringBuilder(); +//email.RenderText(text); +//Console.WriteLine(text.ToString()); +//Console.WriteLine(); + +//var html = new StringBuilder(); +//email.RenderHtml(html); +//Console.WriteLine(html.ToString()); +//Console.WriteLine(); //var db = UmbeddedDb.Open("./umbedded"); //if (!db.HasVal) diff --git a/tmp.html b/tmp.html deleted file mode 100644 index d2909dc..0000000 --- a/tmp.html +++ /dev/null @@ -1,1467 +0,0 @@ -@using SubscribeMailSender.Entities @using SubscribeMailSender.Extensions -@inherits -SubscribeMailSender.Templates.BaseHtmlTemplate - @inject SubscribeMailSender.Tools.UrlGeneration.IUrlGenerator UrlGenerator - - - - - - - - - @Localized("newJobsMailing") - - - - - - -
- - - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- Jooble -
-
-
-
- - - - -
- - - - -
- - - - -
- - - - -
-

- @Model.HeaderTitle -

-
-
-
-
- @foreach (var job in Model.Jobs) { - - - - -
- - - - -
- - - - -
- - - - - @if (!string.IsNullOrEmpty(job.Salary)) { - - - - } - - - - @if (!string.IsNullOrEmpty(job.Snippet) && - !Model.HideJobSnippetOnDesktop) { - - - - - } @if (job?.Tags?.Any() == true) { - - - - } -
-

- @job.Title -

-
-

- @job.Salary -

-
-

- @if - (!string.IsNullOrEmpty(job.Company)) { - @job.Company - @job.City } else { - @job.City } -

-
-

- @job.Snippet -

-
-

- @foreach (var tag in job.Tags.Take(5)) - { - @(tag.Icon) @(new - Microsoft.AspNetCore.Html.HtmlString(tag.Text.Replace(" - ", " ").FirstToUpper())) - } -

-
-
-
-
- - - - -
- - - - -
- - - - -
- - - - -
-
-
-
- } - - - - -
- - - - - - - -
- - - - -
- - - - -
-
-
- - - - -
- - - - -
- - @Localized("mwjSeeAllJobs") - -
-
-
-
- - - - - -
-
- -