Skip to content

Commit

Permalink
documentation: new section "why i wrote this library"
Browse files Browse the repository at this point in the history
  • Loading branch information
stratdev3 committed Feb 3, 2024
1 parent 487e36a commit 334d3dd
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ It provides a cross-plateform framework for building web applications on top of

SimpleW is lightweight, easy to integrate, fast, minimal footprint, and only one dependency _(Newtonsoft.Json, will be remove in futur release)_.

If you wonder [why i wrote this library](#why-i-wrote-this-library) and what are [my needs](#so-my-needs).

Then, jump to the summary and see if it could fit yours.

# Summary

- [Installation](#installation)
Expand Down Expand Up @@ -1853,6 +1857,44 @@ namespace Sample {
}
```

License
---
## Why i wrote this library ?

To my opinion, modern web application architecture is based on a REST API which acts as a contract between 2 parts :
- backend (only one) : developer feels free to use/change the technology he wants (C#, Go, Rust, PHP...) but must provide and follow the REST API.
- frontend (one or many) : developer feels free to use/change the technology he wants (SPA/Vue, SPA/React, Mobile/Android...) but must consume and follow the REST API.

### So, my needs

#### Frontend

I prefer [SPA](https://en.wikipedia.org/wiki/Single-page_application) using [Vite](https://vitejs.dev/), [Vue](https://vuejs.org) and [Vuetify](https://vuetifyjs.com).

#### Backend

- written in C#, the language i 😍.
- must be easy to integrate, lightweight with a minimal footprint.
- must support Routing, GET/POST, Websocket, CORS.
- don't need to have template engine as i write frontend in a separated project.
- must serve static files (static files are the result of my `npm run build` vite project)


### The existings projects
- [ASP.NET Core](https://learn.microsoft.com/fr-fr/aspnet/core/?view=aspnetcore-8.0) :
- too many features i don't need, i don't want _(Razor, Blazor...)_.
- overcomplicated when i want to customize some behaviour
- too heavy, sometimes i have a very small API.
- [IIS](https://iis.net/) an old _« usine à gaz »_ on Windows, Kestrel and SignalR the same on Linux/Mac.
- [EmbedIO](https://github.com/unosquare/embedio) : long time v2 user, i don't like the rewrite of the v3. Moreover, it uses the old Microsoft `HttpListener` and the `websocket-sharp` alternative was not perfect.
- [GenHtt](https://genhttp.org) : feels promising but i was in the process of writting my own.
- __[NetCoreServer](https://github.com/chronoxor/NetCoreServer)__ : WHOA 😮 ! Fast, simple, extremly well design, extendable BUT no RESTAPI... Wait, what if i use the whole `OnReceivedRequest()` event to do exactly what i want 🤔

### SimpleW

SimpleW is born after adding basic RESTAPI features to the `OnReceivedRequest()` of [NetCoreServer](https://github.com/chronoxor/NetCoreServer).

After 2 years grade production, SimpleW serves many APIs, gains some cool features but still always lightweight and easy to integrate.

Feel free to report issue.

# License
This library is under the MIT License.

0 comments on commit 334d3dd

Please sign in to comment.