Skip to content

Commit a4a7a81

Browse files
committed
Merge branch 'release-0.2.0'
2 parents 1012c4f + cad1a52 commit a4a7a81

File tree

10 files changed

+409
-41
lines changed

10 files changed

+409
-41
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{md, markdown}]
12+
trim_trailing_whitespace = false

README.md

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Scribes were an elite in ancient societies, highly regarded and holding special
44

55
The motivation to create the Elixir Scribe tool was to encourage developers to write **Clean Code** in a **Clean Software Architecture**, to enable them to know in seconds all domains, resources, and actions used in a project, while reducing complexity and contributing for less technical debt.
66

7-
The Elixir Scribe tool enables developers craftsmanship and professionalism to reach new levels never imagined before or thought to not be easy to achieve.
7+
The Elixir Scribe tool enables developers to go from zero to hero in no time, while empowering their craftsmanship and professionalism to reach new levels never imagined before or thought to not be easy to achieve.
88

99
Don't just be a Developer or Engineer, become a Scribe Developer and Engineer 🚀
1010

@@ -22,6 +22,8 @@ Don't just be a Developer or Engineer, become a Scribe Developer and Engineer
2222
* [Documentation](#documentation)
2323
* [Contributing](#contributing)
2424
* [Roadmap](#roadmap)
25+
+ [Generators](#elixir-scribe-generators)
26+
+ [Marketplace](#elixir-scribe-marketplace)
2527

2628

2729
## Reduced Complexity Equals to Less Technical Debt
@@ -142,6 +144,7 @@ The main benefits of using the Elixir Scribe Tool to create and maintain Elixir
142144
* Quickly find and start debugging a bug because actions aren't entangled in a huge module with several resources for a domain (context). For example, if the bug is about creating a resource on a given domain, it's straightforward to know where to start due to the folder structure.
143145
* Each resource on a domain has a public API to avoid direct access to the underlying implementation of each resource. This removes cross-domain boundary calls into the internals of each resource implementation, preventing the coupling of domains, which is a significant source of technical debt and complexity in a codebase. The Resource public API MUST be used not only from other domains but also from within the domain itself. This will allow the internals of a resource in a domain to change as needed, provided that we do not affect the public API for it.
144146
* The folder structure is documentation that never lies about what domains (contexts), resources, and actions are available in your project, whether huge or small.
147+
* Enables easier migration from a monolithic to a micro-services architecture when the need arises.
145148

146149
[TOC](#toc)
147150

@@ -164,6 +167,8 @@ end
164167

165168
## Quickstart
166169

170+
> **IMPORTANT:** Not merged yet to the main branch.
171+
167172
Let's create a fictitious Online Shop to exemplify how to use the Elixir Scribe tool:
168173

169174
```
@@ -212,20 +217,33 @@ The Elixir Scribe tool is highly opinionated, therefore I ask you to first [open
212217

213218
## Roadmap
214219

215-
The roadmap is extensive and due to the continuous high efforts and commitments to develop and maintain everything I may only provide some of the generators to Sponsors and/or as Pro versions that will require a paid license.
220+
The roadmap is extensive and due to the continuous high efforts and commitments to develop and maintain everything I may only provide some of the features to Sponsors and/or as Pro versions that will require a paid license.
216221

217222
### Elixir Scribe Generators
218223

219-
- [ ] Mix task: `scribe.gen.domain`
220-
- [ ] Mix task: `scribe.gen.html`
221-
- [ ] Mix task: `scribe.gen.live`
222-
- [ ] Mix task: `scribe.gen.home`
224+
This generators provide developers with the tools to go from zero to hero in no time, while following a Clean Software Architecture that encourages Clean Code when building their Apps or APIs.
225+
226+
#### Typed Contracts
227+
228+
- [x] - Typed Contract is a struct with type specs to guarantee data shape correctness at runtime.
229+
230+
231+
#### Mix Tasks
232+
233+
- [ ] `scribe.gen.domain`
234+
- [ ] `scribe.gen.html`
235+
- [ ] `scribe.gen.live`
236+
- [ ] `scribe.gen.template`
237+
* Generates a template to be customized for the project.
238+
+ The template includes the code generated by all Elixir Scribe generators, e.g. `scribe.gen.*`.
239+
* The customized template can also be uploaded to the marketplace as freebie or one to be sold under a paid license.
240+
- [ ] `scribe.gen.home`
223241
* Removes current default Home page.
224242
* Adds new Home page with links to each Domain and Resource.
225243
* Optimizes default HTMl layout and components for a more clean and usable UI:
226244
+ Table headers in Bold
227245
+ Highlight links in blue, not in bold (black).
228-
- [ ] Mix task: `scribe.gen.ci`
246+
- [ ] `scribe.gen.ci`
229247
* Generates a CI file for Github or Gitlab with at least the following:
230248
+ `mix format --dry-run --check-formatted`
231249
+ `mix deps.unlock --check-unused`
@@ -235,9 +253,9 @@ The roadmap is extensive and due to the continuous high efforts and commitments
235253
+ `mix credo`
236254
+ `mix doctor`
237255
+ `mix test --cover`
238-
- [ ] Mix task: `scribe.gen.project`
256+
- [ ] `scribe.gen.project`
239257
* Generates all Domains, Resources and Actions from an Elixir Scribe spec module `%ElixirScribe.ProjectSpecs{}`.
240-
- [ ] Mix task: `scribe.gen.api`
258+
- [ ] `scribe.gen.api`
241259
* Adds a dynamic API key (only valid for one request).
242260
* Adds support for fingerprinting the mobile and web app.
243261
* Adds support to collect metrics.
@@ -247,22 +265,29 @@ The roadmap is extensive and due to the continuous high efforts and commitments
247265
+ To control feature flags.
248266
+ To enable a kill-switch to force upgrade to a new version.
249267
+ To dynamically conduct experiments with user experience, A/B testing.
250-
- [ ] Mix task: `scribe.gen.auth`
268+
- [ ] `scribe.gen.auth`
251269
* Adds enhanced User Authentication:
252270
+ fingerprinting of the client enabled by default
253271
+ enabled by default to all pages, except Home page.
254-
- [ ] Mix task: `scribe.gen.oauth`
272+
- [ ] `scribe.gen.oauth`
255273
* Adds enhanced OAuth for popular providers:
256274
+ fingerprinting of the client enabled by default
257275
+ enabled by default to all pages, except Home page.
258-
- [ ] Mix task: `scribe.gen.native`
276+
- [ ] `scribe.gen.native`
259277
* Enables the project to be built for Desktop, Android and Apple.
260278
* Elixir libraries to build for native targets:
261279
+ [LiveView Native](https://github.com/liveview-native)
262280
+ [Elixir Desktop](https://github.com/elixir-desktop/desktop)
263281
+ [ExTauri](https://github.com/Exadra37/ex_tauri)
264-
- [ ] Mix task: `scribe.gen.static`
282+
- [ ] `scribe.gen.static`
265283
* Generates a static website from a current project.
266-
- [ ] Mix task: `scribe.gen.deploy`
284+
- [ ] `scribe.gen.deploy`
267285
* Adds easy deployment to popular hosting providers.
268-
- [ ] Mix task: `scribe.gen.admin`
286+
- [ ] `scribe.gen.admin`
287+
288+
289+
### Elixir Scribe Marketplace
290+
291+
- [ ] Website to sell free and paid licenses for Elixir Scribe templates.
292+
* The marketplace will support as vendors anyone that builds quality templates with the Elixir Scribe tool.
293+
* Vendors of paid licenses will pay a fee for each sale, plus payment fees. It will be all very transparent, no hidden fees.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
defmodule Persona do
2+
@moduledoc false
3+
4+
require PersonaValidator
5+
6+
@keys %{
7+
required: [:name, :email],
8+
optional: [role: nil]
9+
}
10+
11+
use ElixirScribe.Behaviour.TypedContract, keys: @keys
12+
13+
@impl true
14+
def type_spec() do
15+
schema(%__MODULE__{
16+
name: is_binary() |> spec(),
17+
email: PersonaValidator.corporate_email?() |> spec(),
18+
role: PersonaValidator.role?() |> spec()
19+
})
20+
end
21+
end
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
defmodule PersonaValidator do
2+
@moduledoc false
3+
4+
# A very simplistic set o validations used by the docs usage examples.
5+
6+
@email_providers ["gmail.com", "yahoo.com", "hotmail.com"]
7+
def corporate_email?(email) when is_binary(email) do
8+
case String.split(email, "@", trim: true) do
9+
[_one_part] ->
10+
false
11+
12+
[_, email_provider] when email_provider not in @email_providers ->
13+
true
14+
15+
_ ->
16+
false
17+
end
18+
end
19+
20+
def corporate_email?(_email), do: false
21+
22+
# The role is optional, thus we return true
23+
def role?(role) when is_nil(role), do: true
24+
25+
def role?(role) when is_binary(role) do
26+
role = role |> String.trim()
27+
String.length(role) >= 3
28+
end
29+
30+
def role?(_age), do: false
31+
end

lib/elixir_scribe.ex

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
11
defmodule ElixirScribe do
2-
@moduledoc """
3-
Documentation for `ElixirScribe`.
4-
"""
5-
6-
@doc """
7-
Hello world.
8-
9-
## Examples
10-
11-
iex> ElixirScribe.hello()
12-
:world
13-
14-
"""
15-
def hello do
16-
:world
17-
end
2+
@moduledoc false
183
end

0 commit comments

Comments
 (0)