Skip to content

Commit dadb787

Browse files
committed
Update docs
1 parent 6883019 commit dadb787

7 files changed

+206
-177
lines changed

.sdkmanrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
java=11.0.11.hs-adpt
1+
java=11.0.16-tem

README.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
![wiringbits](https://github.com/wiringbits/scala-webapp-template/workflows/Build%20the%20server%20app/badge.svg)
44
[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.6.0.svg)](https://www.scala-js.org)
55

6-
This is the skeleton used by Wiringbits when creating new web applications fully in Scala/Scala.js, so far, we have created ~10 projects from this template, back-porting useful details to improve our template.
6+
This is the skeleton used by Wiringbits when creating new web applications in Scala/Scala.js, so far, we have created ~10 projects from this template, back-porting useful details to improve it.
7+
8+
If you require building a Web Application in Scala while you do not have the time to do many technical choices, this template could be a reasonable choice.
79

810

911
## Why?
1012

11-
Scala has a common misconception, many people believe that it is hard to get productive with, at Wiringbits, we have proven the contrary with this template. Engineers with no previous Scala experience tend to start contributing simple bug fixes at their first week (including undergrad interns).
13+
Scala has a common misconception, many people believe that it is hard to get productive with it, at Wiringbits, we have proven the contrary with this template. Engineers with no previous Scala experience tend to start contributing simple bug fixes at their first week (including undergrad interns).
1214

1315
Our template provides all the necessary boilerplate to get started fast when building a traditional web application.
1416

15-
Don't waste your time evaluating every library required to build your web app, pick this template and go from there as a base and move from there.
16-
17-
When creating web apps for our customers, we usually pick this template to save time, you can do same.
17+
Don't waste your time evaluating every library required to build your web app, pick this template and go from there.
1818

1919
Using Scala.js not only save us considerable time, it also allows us to avoid many common issues, for example, all frontend/backend validations are in sync just because the code is the same.
2020

@@ -24,7 +24,7 @@ Using Scala.js not only save us considerable time, it also allows us to avoid ma
2424
We have a live demo so that you can get a taste on what our template provides.
2525

2626
- [Web App](https://template-demo.wiringbits.net) showcases the web application intended for the general user, explore it and create an account to get an idea on what your users will experience.
27-
- [Admin App](https://template-demo-admin.wiringbits.net) (username = `demo`, password = `wiringbits`) showcases the web application intended for administrators, this exposes a way to manage the application's data in a nice UI, mostly autogenerated by [react-admin/](https://marmelab.com/react-admin/).
27+
- [Admin App](https://template-demo-admin.wiringbits.net) (username = `demo`, password = `wiringbits`) showcases the web application intended for administrators, this exposes a way to manage the application's data in a nice UI, mostly autogenerated by [react-admin](https://marmelab.com/react-admin/).
2828
- [API Docs](https://template-demo.wiringbits.net/api/docs/index.html) showcases the [Swagger UI](https://swagger.io/tools/swagger-ui/) which can help to explore the API directly.
2929

3030
### Short videos
@@ -37,14 +37,14 @@ Admin app 30s demo:
3737

3838
[![Admin app 30s demo](https://img.youtube.com/vi/78rxfdPOGqk/0.jpg)](https://youtu.be/78rxfdPOGqk "Admin app 30s demo")
3939

40-
Deployment 4m demo:
40+
Deployment 2m demo:
4141

42-
[![Deployment 4m demo](https://img.youtube.com/vi/cN599dMa9EA/0.jpg)](https://youtu.be/cN599dMa9EA "Deployment 4m demo")
42+
[![Deployment 2m demo](https://img.youtube.com/vi/cN599dMa9EA/0.jpg)](https://youtu.be/cN599dMa9EA "Deployment 2m demo")
4343

4444

4545
## What's included?
4646

47-
1. User registration and authentication; Including email verification, profile updates, password recovery, and, Captchas (for spam prevention).
47+
1. User registration and authentication; Including email verification, profile updates, password recovery, and, captcha for spam prevention.
4848
2. Integration with the React ecosystem, most libraries/components will work right away, while we use [Material UI](https://v3.mui.com/), you can switch to your preferred component library.
4949
3. PostgreSQL as the data store layer, which is a reasonable choice for most web applications.
5050
4. Practical components for testing your server-side code, writing tests for the Data/Api layer is real simple, no excuses accepted.
@@ -54,3 +54,7 @@ Deployment 4m demo:
5454
8. Admin usually have super-powers, which is why you can export most of your Postgres database to an autogenerated UI (https://marmelab.com/react-admin/), just define which tables/columns must be exported.
5555
9. A simple to follow architecture, including short-guides for doing common tasks.
5656
10. Deployment scripts to cloud instances, we believe in simplicity and most projects are fine with simple managed servers instead of containers/K8s/etc.
57+
58+
## Get started
59+
60+
Checkout the [docs](./docs/README.md)

docs/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Wiringbits Scala WebApp template - Docs
2+
3+
- [Setup development environment](./setup-dev-environment.md)
4+
- [Design desicions](./design-decisions.md)

docs/design-docs.md renamed to docs/design-decisions.md

+21-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1-
# Design docs
2-
This document explains why we took certain decisions on how the project is built/structured.
1+
# Design decisions
2+
This document explains why we took certain design decisions on how the project is built/structured.
3+
4+
## 2022/Aug - Avoid default parameter in most cases
5+
We commonly deal with models that are similar but belong to a different domain, [chimney](https://scalalandio.github.io/chimney) help us to transform those models from one domain to another, while this tool is handy, it does not play well with default values in arguments.
6+
7+
Take this snippet as an example:
8+
9+
```scala
10+
case class CreateUserApiRequest(name: String, age: Option[Int])
11+
12+
case class CreateUserData(name: String, yearsOld: Option[Int] = None)
13+
14+
def transform(request: CreateUserApiRequest): CreateUserData = request.into[CreateUserData].transform
15+
```
16+
17+
While the `transform` function would succeed, the `age` value will never become the `yearsOld` value, if there wasn't a default value, we'd get a compile error which would give us a chance to fix the problem (`request.into[CreateUserData].withFieldRenamed(_.age, _.yearsOld).transform`).
18+
19+
Still, there can be exceptions:
20+
- The http API layer usually gets default values when adding a new parameter to an API method, this way, we keep backwards compatibility to support old API clients.
21+
322

423
## 2022/Apr - Naming conventions for api/data models
524

docs/postgres.md

-102
This file was deleted.

docs/sdkman-java-sbt.md

-63
This file was deleted.

0 commit comments

Comments
 (0)