This repository was archived by the owner on Aug 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_overview.html
More file actions
104 lines (102 loc) · 4.08 KB
/
Copy pathcommand_overview.html
File metadata and controls
104 lines (102 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<title>Newt -- command_overview</title>
<link rel="stylesheet" href="https://caltechlibrary.github.io/css/site.css">
<base href="./">
</head>
<body>
<header>
<a href="https://library.caltech.edu"><img src="https://caltechlibrary.github.io/assets/liblogo.gif" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="./">README</a></li>
<li><a href="user_manual.html">User Manual</a></li>
<li><a href="LICENSE">LICENSE</a></li>
<li><a href="INSTALL.html">INSTALL</a></li>
<li><a href="about.html">About</a></li>
<li><a href="search.html">Search</a></li>
<li><a href="https://github.com/caltechlibrary/newt">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="newts-newt-command">Newt’s <code>newt</code> command</h1>
<p>The core of Newt is the command <code>newt</code> (or
<code>newt.exe</code> on Windows). It handles the following for your
Newt based project. The command first parameter is an “action” The
actions let you progress from configuration, to data modeling, check the
Newt YAML file, code generation and end with a running application.</p>
<ol type="1">
<li>Create a Newt YAML file through an interactive dialog using the
“config” action.</li>
<li>Generate and manage your models through an interactive dialog using
the “model” action.</li>
<li>Verify the YAML using the “check” action.</li>
<li>Generate code (e.g. postgrest.conf, setup.sql, models.sql, various
Handlebars templates) using “generate” action.</li>
<li>After setting up Postgres via the SQL files you can run your
application using the “run” action.</li>
</ol>
<p>The <code>newt</code> command is a development tool. It simplifies
standing up a Newt application built around the Newt Router, Newt’s
template engine and Postgres+PostgREST. A <code>newt</code> generated
application will provide the basic create, read, update, delete and list
operations you need for managing the metadata described by your
models.</p>
<p>When you are ready for production you can use <code>ndr</code>, the
Newt data router, and <code>nte</code> along ## Newt YAML file
structure</p>
<p>Newt command is a tool for managing your Newt YAML file. The top
level structure of a Newt application is as follows.</p>
<dl>
<dt>app_metadata</dt>
<dd>
Holds the general application metadata, logo info, header text/link,
copyright, license and contact info
</dd>
<dt>applications</dt>
<dd>
Holds configuration information for PostgREST, Newt Router and Newt’s
template engine
</dd>
<dt>models</dt>
<dd>
This holds the data models your application will implement, this
property is inspired by the <a href="">GitHub YAML issue template
syntax</a>
</dd>
<dt>routes</dt>
<dd>
These are the request Newt Router will manage they are descriptions of
HTTP method and path along with any data pipeline processing needed to
respond to HTTP request
</dd>
<dt>templates</dt>
<dd>
This holds the configuration for the Newt’s template engine. The
template engine accepts POST requests and associates Handlebars
templates with a given request path. Handlebars templates support the
concept of “partial” templates, these are also specified in relationship
to the request path and primary template association. Templates are read
in with Newt Handlebars starts and are not re-read until you restart
Newt Handlebars.
</dd>
</dl>
<p>The responsibility for managing these properties is split between two
Newt actions, “config” and “model”. In the next section we will cover
the <code>newt config</code> which is a tool for setting the first
property, applications.</p>
<p>Next see <a href="config_explained.html">newt config</a>.</p>
</section>
<footer>
<span><h1><A href="http://caltech.edu">Caltech</a></h1></span>
<span>© 2024 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
<span><a href="mailto:library@caltech.edu">Email Us</a></span>
<a class="cl-hide" href="sitemap.xml">Site Map</a>
</footer>
</body>
</html>