Skip to content

Commit

Permalink
Deployed 01c92a3 with MkDocs version: 1.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Hallett committed Jul 19, 2023
1 parent c91e285 commit 84cf42f
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 81 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@

<li class="md-nav__item">
<a href="/." class="md-nav__link">
💫 Beckett framework
💫 Beckett Framework
</a>
</li>

Expand Down
2 changes: 1 addition & 1 deletion configuration/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

<li class="md-nav__item">
<a href=".." class="md-nav__link">
💫 Beckett framework
💫 Beckett Framework
</a>
</li>

Expand Down
56 changes: 26 additions & 30 deletions features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

<li class="md-nav__item">
<a href=".." class="md-nav__link">
💫 Beckett framework
💫 Beckett Framework
</a>
</li>

Expand Down Expand Up @@ -437,27 +437,23 @@ <h2 id="strongly-linked-types">Strongly-linked types</h2>
<span class="normal"><a href="#__codelineno-0-14">14</a></span>
<span class="normal"><a href="#__codelineno-0-15">15</a></span>
<span class="normal"><a href="#__codelineno-0-16">16</a></span>
<span class="normal"><a href="#__codelineno-0-17">17</a></span>
<span class="normal"><a href="#__codelineno-0-18">18</a></span>
<span class="normal"><a href="#__codelineno-0-19">19</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="kn">import</span> <span class="nn">attrs</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a><span class="kn">from</span> <span class="nn">src.app</span> <span class="kn">import</span> <span class="n">app</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a><span class="kn">from</span> <span class="nn">src.beckett.blueprint</span> <span class="kn">import</span> <span class="n">BeckettBlueprint</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a><span class="kn">from</span> <span class="nn">src.beckett.types</span> <span class="kn">import</span> <span class="n">APIResponse</span>
</span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5"></a>
</span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6"></a><span class="n">blueprint</span> <span class="o">=</span> <span class="n">BeckettBlueprint</span><span class="p">(</span><span class="s2">&quot;people&quot;</span><span class="p">,</span> <span class="vm">__name__</span><span class="p">,</span> <span class="n">url_prefix</span><span class="o">=</span><span class="s2">&quot;/people&quot;</span><span class="p">)</span>
</span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7"></a>
</span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8"></a><span class="nd">@attrs</span><span class="o">.</span><span class="n">define</span>
</span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9"></a><span class="k">class</span> <span class="nc">GetPeopleResponse</span><span class="p">(</span><span class="n">APIResponse</span><span class="p">):</span>
</span><span id="__span-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10"></a> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span>
</span><span id="__span-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11"></a>
</span><span id="__span-0-12"><a id="__codelineno-0-12" name="__codelineno-0-12"></a><span class="nd">@blueprint</span><span class="o">.</span><span class="n">api_get</span><span class="p">(</span><span class="s2">&quot;/get&quot;</span><span class="p">)</span>
</span><span id="__span-0-13"><a id="__codelineno-0-13" name="__codelineno-0-13"></a><span class="k">def</span> <span class="nf">get_people</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">GetPeopleResponse</span><span class="p">:</span>
</span><span id="__span-0-14"><a id="__codelineno-0-14" name="__codelineno-0-14"></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="__span-0-15"><a id="__codelineno-0-15" name="__codelineno-0-15"></a><span class="sd"> This is an example API GET route.</span>
</span><span id="__span-0-16"><a id="__codelineno-0-16" name="__codelineno-0-16"></a><span class="sd"> &quot;&quot;&quot;</span>
</span><span id="__span-0-17"><a id="__codelineno-0-17" name="__codelineno-0-17"></a> <span class="k">return</span> <span class="n">GetPeopleResponse</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;Paul&quot;</span><span class="p">)</span>
</span><span id="__span-0-18"><a id="__codelineno-0-18" name="__codelineno-0-18"></a>
</span><span id="__span-0-19"><a id="__codelineno-0-19" name="__codelineno-0-19"></a><span class="n">app</span><span class="o">.</span><span class="n">register_blueprint</span><span class="p">(</span><span class="n">blueprint</span><span class="p">)</span>
<span class="normal"><a href="#__codelineno-0-17">17</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a><span class="kn">from</span> <span class="nn">src.app</span> <span class="kn">import</span> <span class="n">app</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2"></a><span class="kn">from</span> <span class="nn">src.beckett.blueprint</span> <span class="kn">import</span> <span class="n">BeckettBlueprint</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3"></a><span class="kn">from</span> <span class="nn">src.beckett.types</span> <span class="kn">import</span> <span class="n">APIResponse</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4"></a>
</span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5"></a><span class="n">blueprint</span> <span class="o">=</span> <span class="n">BeckettBlueprint</span><span class="p">(</span><span class="s2">&quot;people&quot;</span><span class="p">,</span> <span class="vm">__name__</span><span class="p">,</span> <span class="n">url_prefix</span><span class="o">=</span><span class="s2">&quot;/people&quot;</span><span class="p">)</span>
</span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6"></a>
</span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7"></a><span class="k">class</span> <span class="nc">GetPeopleResponse</span><span class="p">(</span><span class="n">APIResponse</span><span class="p">):</span>
</span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8"></a> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span>
</span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9"></a>
</span><span id="__span-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10"></a><span class="nd">@blueprint</span><span class="o">.</span><span class="n">api_get</span><span class="p">(</span><span class="s2">&quot;/get&quot;</span><span class="p">)</span>
</span><span id="__span-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11"></a><span class="k">def</span> <span class="nf">get_people</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="n">GetPeopleResponse</span><span class="p">:</span>
</span><span id="__span-0-12"><a id="__codelineno-0-12" name="__codelineno-0-12"></a><span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
</span><span id="__span-0-13"><a id="__codelineno-0-13" name="__codelineno-0-13"></a><span class="sd"> This is an example API GET route.</span>
</span><span id="__span-0-14"><a id="__codelineno-0-14" name="__codelineno-0-14"></a><span class="sd"> &quot;&quot;&quot;</span>
</span><span id="__span-0-15"><a id="__codelineno-0-15" name="__codelineno-0-15"></a> <span class="k">return</span> <span class="n">GetPeopleResponse</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s2">&quot;Paul&quot;</span><span class="p">)</span>
</span><span id="__span-0-16"><a id="__codelineno-0-16" name="__codelineno-0-16"></a>
</span><span id="__span-0-17"><a id="__codelineno-0-17" name="__codelineno-0-17"></a><span class="n">app</span><span class="o">.</span><span class="n">register_blueprint</span><span class="p">(</span><span class="n">blueprint</span><span class="p">)</span>
</span></code></pre></div></td></tr></table></div>
<p>When the Beckett flask server is running, this will autogenerate the following TypeScript interface:</p>
<div class="language-ts highlight"><table class="highlighttable"><tr><th colspan="2" class="filename"><span class="filename">js/api/types.ts</span></th></tr><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-1-1"> 1</a></span>
Expand Down Expand Up @@ -511,14 +507,14 @@ <h2 id="react-pages">React pages</h2>
</span><span id="__span-2-2"><a id="__codelineno-2-2" name="__codelineno-2-2"></a>
</span><span id="__span-2-3"><a id="__codelineno-2-3" name="__codelineno-2-3"></a><span class="kn">from</span> <span class="nn">src.app</span> <span class="kn">import</span> <span class="n">app</span>
</span><span id="__span-2-4"><a id="__codelineno-2-4" name="__codelineno-2-4"></a><span class="kn">from</span> <span class="nn">src.beckett.blueprint</span> <span class="kn">import</span> <span class="n">BeckettBlueprint</span>
</span><span id="__span-2-5"><a id="__codelineno-2-5" name="__codelineno-2-5"></a>
</span><span id="__span-2-6"><a id="__codelineno-2-6" name="__codelineno-2-6"></a><span class="n">beckett</span> <span class="o">=</span> <span class="n">BeckettBlueprint</span><span class="p">(</span><span class="s2">&quot;people&quot;</span><span class="p">,</span> <span class="vm">__name__</span><span class="p">,</span> <span class="n">url_prefix</span><span class="o">=</span><span class="s2">&quot;/people&quot;</span><span class="p">)</span>
</span><span id="__span-2-7"><a id="__codelineno-2-7" name="__codelineno-2-7"></a>
</span><span id="__span-2-8"><a id="__codelineno-2-8" name="__codelineno-2-8"></a><span class="c1"># Hiding other endpoints for clarity</span>
</span><span id="__span-2-9"><a id="__codelineno-2-9" name="__codelineno-2-9"></a><span class="o">...</span>
</span><span id="__span-2-10"><a id="__codelineno-2-10" name="__codelineno-2-10"></a>
</span><span id="__span-2-11"><a id="__codelineno-2-11" name="__codelineno-2-11"></a><span class="nd">@attrs</span><span class="o">.</span><span class="n">define</span>
</span><span id="__span-2-12"><a id="__codelineno-2-12" name="__codelineno-2-12"></a><span class="k">class</span> <span class="nc">ExamplePageProps</span><span class="p">:</span>
</span><span id="__span-2-5"><a id="__codelineno-2-5" name="__codelineno-2-5"></a><span class="kn">from</span> <span class="nn">src.beckett.types</span> <span class="kn">import</span> <span class="n">PageProps</span>
</span><span id="__span-2-6"><a id="__codelineno-2-6" name="__codelineno-2-6"></a>
</span><span id="__span-2-7"><a id="__codelineno-2-7" name="__codelineno-2-7"></a><span class="n">beckett</span> <span class="o">=</span> <span class="n">BeckettBlueprint</span><span class="p">(</span><span class="s2">&quot;people&quot;</span><span class="p">,</span> <span class="vm">__name__</span><span class="p">,</span> <span class="n">url_prefix</span><span class="o">=</span><span class="s2">&quot;/people&quot;</span><span class="p">)</span>
</span><span id="__span-2-8"><a id="__codelineno-2-8" name="__codelineno-2-8"></a>
</span><span id="__span-2-9"><a id="__codelineno-2-9" name="__codelineno-2-9"></a><span class="c1"># Hiding other endpoints for clarity</span>
</span><span id="__span-2-10"><a id="__codelineno-2-10" name="__codelineno-2-10"></a><span class="o">...</span>
</span><span id="__span-2-11"><a id="__codelineno-2-11" name="__codelineno-2-11"></a>
</span><span id="__span-2-12"><a id="__codelineno-2-12" name="__codelineno-2-12"></a><span class="k">class</span> <span class="nc">ExamplePageProps</span><span class="p">(</span><span class="n">PageProps</span><span class="p">):</span>
</span><span id="__span-2-13"><a id="__codelineno-2-13" name="__codelineno-2-13"></a> <span class="n">hello</span><span class="p">:</span> <span class="nb">str</span>
</span><span id="__span-2-14"><a id="__codelineno-2-14" name="__codelineno-2-14"></a>
</span><span id="__span-2-15"><a id="__codelineno-2-15" name="__codelineno-2-15"></a><span class="nd">@beckett</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/&quot;</span><span class="p">)</span>
Expand Down
52 changes: 16 additions & 36 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">

💫 Beckett framework
💫 Beckett Framework

</span>
</div>
Expand Down Expand Up @@ -198,12 +198,12 @@


<label class="md-nav__link md-nav__link--active" for="__toc">
💫 Beckett framework
💫 Beckett Framework
<span class="md-nav__icon md-icon"></span>
</label>

<a href="." class="md-nav__link md-nav__link--active">
💫 Beckett framework
💫 Beckett Framework
</a>


Expand All @@ -222,15 +222,8 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#harnessing-powerful-tools-becketts-foundation" class="md-nav__link">
Harnessing Powerful Tools: Beckett's Foundation
</a>

</li>

<li class="md-nav__item">
<a href="#unleasing-their-individual-potential" class="md-nav__link">
Unleasing Their Individual Potential
<a href="#built-on-popular-tools" class="md-nav__link">
Built on popular tools
</a>

</li>
Expand Down Expand Up @@ -330,15 +323,8 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#harnessing-powerful-tools-becketts-foundation" class="md-nav__link">
Harnessing Powerful Tools: Beckett's Foundation
</a>

</li>

<li class="md-nav__item">
<a href="#unleasing-their-individual-potential" class="md-nav__link">
Unleasing Their Individual Potential
<a href="#built-on-popular-tools" class="md-nav__link">
Built on popular tools
</a>

</li>
Expand All @@ -358,23 +344,17 @@



<h1 id="beckett-framework">💫 Beckett framework</h1>
<p><em>The Efficient Framework for Building Type-Safe Python Web Servers and React TypeScript Websites</em></p>
<p><img alt="beckett logo" src="banner.jpg" /></p>
<p>Welcome to Beckett, a solution for rapidly constructing type-safe Python web servers and React TypeScript websites while ensuring consistent typing interfaces across both languages.</p>
<p>Beckett seamlessly combines the power of <a href="https://flask.palletsprojects.com/en/2.3.x/">Flask</a>, a popular Python web framework, with a robust <a href="https://www.typescriptlang.org/docs/handbook/react.html">React TypeScript</a> web server, providing a comprehensive full stack framework. Unlike traditional project set ups, Beckett eliminates the need for an intermediary domain language because it tightly couples the Typed API interface, resulting in a more streamlined development process.</p>
<p>At its core, Beckett features a sophisticated types manager that automatically synchronizes <a href="https://docs.python.org/3/library/typing.html">Python Type hints</a> and <a href="https://www.typescriptlang.org/docs/handbook/interfaces.html">TypeScript interfaces</a>. This means that as you make changes to your code, Beckett diligently keeps the API interface definitions in both languages in perfect harmony. Gone are the worries about compatibility issues when deploying changes—the Beckett framework ensures seamless deployments.</p>
<h1 id="beckett-framework">💫 Beckett Framework</h1>
<p><em>The Framework for Building strictly-typed Python and React TypeScript Websites</em></p>
<p><img alt="Beckett maze" src="banner.jpg" /></p>
<p>Welcome to Beckett, a strictly-typed Flask and React TypeScript application template.</p>
<p>Beckett combines a <a href="https://flask.palletsprojects.com/en/2.3.x/">Flask</a> server, with a robust <a href="https://www.typescriptlang.org/docs/handbook/react.html">React TypeScript</a> UI, to provide a comprehensive full stack framework.</p>
<p>Beckett features a sophisticated types manager that automatically synchronizes <a href="https://docs.python.org/3/library/typing.html">Python Type hints</a> and <a href="https://www.typescriptlang.org/docs/handbook/interfaces.html">TypeScript interfaces</a>. This means that as you make changes to your code, Beckett diligently keeps the API interface in perfect harmony.</p>
<p>While Beckett is strongly opinionated, favoring specific design choices, it significantly enhances productivity by providing a cohesive development experience and reducing the time spent on manual synchronization.</p>
<p><img alt="beckett features" src="diagram.jpg" /></p>
<h2 id="harnessing-powerful-tools-becketts-foundation">Harnessing Powerful Tools: Beckett's Foundation</h2>
<p>Beckett harnesses the power of industry-leding tools by seamlessly integratin a <a href="https://flask.palletsprojects.com/en/2.3.x/">Flask web server</a> and a <a href="https://react.dev/">React</a> <a href="https://www.typescriptlang.org/">TypeScript</a> frontend into a unified framework.</p>
<p>Both TypeScript and Python hold their positions as two of the <a href="https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/">most widely used programming languages globally</a>. As a result, they are frequently combined in various projects.
However, setting up a smooth and efficient development environment that harmoniously integrates these languages can be a cumbersome and time-consuming process, often leading to a subpar developer experience.</p>
<p>Thankfully, Beckett steps in to solve this challenge by tightly coupling TypeScript and Python, uniting them as a cohesive framework.</p>
<h2 id="unleasing-their-individual-potential">Unleasing Their Individual Potential</h2>
<p>Beckett recognizes that each language excels in different domains and allows you to leverage their strengths as needed. You can continue to write Flask views just as you would in a typical Flask application, benefiting from the extensive ecosystem of Python libraries that seamlessly integrate with Flask.</p>
<p>Simultaneously, you can harness the power of React TypeScript for your frontend development, providing an optimal solution. Write your React components and TypeScript code as you would in any other React application, and effortlessly incorporate any JavaScript library you desire by using <code>yarn add</code> to meet the specific requirements of your project.</p>
<p>Beckett empowers you to continue utilizing these languages individually, allowing you to take advantage of their distinctive capabilities while enjoying the enhanced development experience offered by the unified framework.</p>
<h2 id="built-on-popular-tools">Built on popular tools</h2>
<p>Both TypeScript and Python hold their positions as two of the <a href="https://www.statista.com/statistics/793628/worldwide-developer-survey-most-used-languages/">most widely used programming languages globally</a>. As a result, they are frequently combined in various projects.</p>
<p>However, setting up a smooth and efficient development environment that harmoniously integrates these languages can be a cumbersome and time-consuming process, often leading to a subpar developer experience. Thankfully, Beckett steps in to solve this challenge by tightly coupling TypeScript and Python into one cohesive framework.</p>
<p>Wanna learn more? Start with the <a href="/features/">features</a> to learn what Beckett brings to the table.</p>


Expand Down
2 changes: 1 addition & 1 deletion install/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

<li class="md-nav__item">
<a href=".." class="md-nav__link">
💫 Beckett framework
💫 Beckett Framework
</a>
</li>

Expand Down
Loading

0 comments on commit 84cf42f

Please sign in to comment.