-
Notifications
You must be signed in to change notification settings - Fork 55
Developing Applications with Portofino 5
In the getting started page we've seen how to create a simple application using Portofino 5, in a way that is accessible also to people without a development background. However, any real-world application will soon need more than what Portofino's UI can configure, and will most likely require custom developments to fulfill its requirements.
In this tutorial, we'll learn how to develop a real-world Portofino application. Some coding experience is necessary to follow along.
The easiest way to start with the development of a Portofino application is with a Maven archetype. Maven is a popular build tool for JVM applications. An archetype is a special type of Maven project that acts as a "blueprint" to create other projects.
If you don't already have Maven installed, see its official website.
So, let's create our new project. We'll show instructions for the command line, but your development environment may also have a new project wizard that understands Maven archetypes.
mvn archetype:generate
This will print lots of information and ask to choose a number or apply a filter at the end. Let's type portofino
and press Enter, we should see something like:
Choose archetype:
1: remote -> com.manydesigns:portofino-groovy-service-archetype (-)
2: remote -> com.manydesigns:portofino-java-service-archetype (-)
3: remote -> com.manydesigns:portofino-war-archetype (-)
As we can see, Portofino provides several archetypes. We're interested in the portofino-war-archetype
that will generate a full-stack application with backend REST services and an Angular frontend. The other archetypes are outside of the scope of this tutorial. So, in this case, we'll type "3" (on your system, that could be a different number).
Then, Maven will ask for a version number:
Choose com.manydesigns:portofino-war-archetype version:
1: 4.1.beta5
2: 4.1.beta6
3: 4.1
...
We'll want the latest 5.x version, which is 5.3.3 at the time of writing:
...
31: 5.3.1
32: 5.3.2
33: 5.3.3
So, we'll type "33" and Enter.
Then we'll have to provide a "groupId" for our project. That identifies our organization and, conventionally, is a reversed domain name, such as "com.manydesigns" for manydesigns.com. But you can just make up your own.
Similarly Maven will ask for an "artifactId", that's the name of our project, e.g. "portofino-demo".
The other properties (version and package) come with defaults that we can accept by just pressing Enter without typing anything. Finally, we get a summary of the values we've entered and we can proceed by typing Enter one more time. Maven will output something like
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: portofino-war-archetype:5.3.3
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: it.alessiostalla
[INFO] Parameter: artifactId, Value: portofino-demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: it.alessiostalla
[INFO] Parameter: packageInPathFormat, Value: it/alessiostalla
[INFO] Parameter: portofinoVersion, Value: 5.3.3
[INFO] Parameter: package, Value: it.alessiostalla
[INFO] Parameter: groupId, Value: it.alessiostalla
[INFO] Parameter: artifactId, Value: portofino-demo
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Project created from Archetype in dir: /Users/alessio/projects/portofino-demo
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:42 min
[INFO] Finished at: 2022-11-22T18:01:28+01:00
[INFO] ------------------------------------------------------------------------
After that, we'll find the project in the specified directory (i.e. a directory named like the "artifactId").
TODO
.gitignore
TODO
TODO
TODO