Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming project to 'FastWS' #195

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
---
name: Template CI/CD
name: CI/CD

"on":
pull_request:
Expand Down Expand Up @@ -98,8 +98,9 @@ jobs:
- name: Generate Javadoc
run: mvn -B clean javadoc:javadoc
- name: Move Javadoc into documentation directory
if: github.ref == 'refs/heads/master'
run: mv target/site/apidocs/ docs/build/apidocs/
- name: Load CNAME
run: echo fastws.qubitpi.org > docs/build/CNAME
- name: Deploy documentation (including Javadoc) to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
Expand Down Expand Up @@ -137,12 +138,20 @@ jobs:
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: jack20191124
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push image to DockerHub
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/jersey-webservice-template:latest
tags: jack20191124/fast-ws:latest
- name: Push image Description
if: github.ref == 'refs/heads/master'
uses: peter-evans/dockerhub-description@v4
with:
username: jack20191124
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: jack20191124/fast-ws
readme-filepath: README.md
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ https://uel.java.net/
https://www.openapis.org/
https://jcp.org/*
http://localhost:8080/*
https://github.com/QubitPi/fast-ws/blob/master/FastWS-Project-intellij-code-style.xml
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.
FROM maven:3.8.3-openjdk-17 as build

RUN mkdir /jersey-webservice-template
COPY . /jersey-webservice-template
RUN cd /jersey-webservice-template && mvn clean package -Dmaven.test.skip=true
RUN mkdir /fast-ws
COPY . /fast-ws
RUN cd /fast-ws && mvn clean package -Dmaven.test.skip=true

FROM ubuntu:22.04

Expand Down Expand Up @@ -47,7 +47,7 @@ RUN rm jetty-home-$JETTY_VERSION.tar.gz
RUN mkdir jetty-base
RUN cd jetty-base && java -jar $JETTY_HOME/start.jar --add-module=annotations,server,http,deploy,servlet,webapp,resources,jsp

COPY --from=build /jersey-webservice-template/target/jersey-webservice-template-$WS_VERSION.war $JETTY_WEBAPPS_DIR/ROOT.war
COPY --from=build /fast-ws/target/fast-ws-$WS_VERSION.war $JETTY_WEBAPPS_DIR/ROOT.war

COPY ./Dockerfile-startup.sh /Dockerfile-startup.sh
CMD [ "/Dockerfile-startup.sh" ]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<code_scheme name="jersey-webservice-template-Project">
<code_scheme name="fast-ws-Project">
<option name="GENERATE_FINAL_LOCALS" value="true" />
<option name="GENERATE_FINAL_PARAMETERS" value="true" />
<option name="USE_EXTERNAL_ANNOTATIONS" value="true" />
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Jersey Webservice Template
==========================
FastWS
======

![Java Version Badge][Java Version Badge]
[![GitHub Workflow Status][GitHub Workflow Status]](https://github.com/QubitPi/jersey-webservice-template/actions/workflows/ci-cd.yml)
[![GitHub Workflow Status][GitHub Workflow Status]](https://github.com/QubitPi/fast-ws/actions/workflows/ci-cd.yml)
[![Apache License Badge]][Apache License, Version 2.0]

__Jersey Webservice Template__ (__JWT__) is a [JSR 370] webservice template that lets us spin up Java webservice quickly
through [GitHub templates]. One can think of JWT as the Jersey/Jetty version of [Spring Initializr]. At the end of the
day, JWT helps organization to improve the velocity and quality of their teams' work
__FastWS__ is a [JSR 370] webservice template that lets us spin up Java webservice quickly through [GitHub templates].
One can think of FastWS as the Jersey/Jetty version of [Spring Initializr]. At the end of the day, FastWS helps
organization to improve the velocity and quality of their teams' work

✨ Features
-----------
Expand All @@ -26,7 +26,7 @@ Please make sure Docker is installed
commands:

```console
docker run --name=jersey-webservice-template -it -p 8080:8080 jack20191124/jersey-webservice-template
docker run --name=fast-ws -it -p 8080:8080 jack20191124/fast-ws
```

That's it. A healthcheck endpoint can be pinned with
Expand Down Expand Up @@ -61,18 +61,18 @@ for details.
License
-------

The use and distribution terms for [jersey-webservice-template] are covered by the [Apache License, Version 2.0].
The use and distribution terms for [fast-ws]() are covered by the [Apache License, Version 2.0].

[Apache License Badge]: https://img.shields.io/badge/Apache%202.0-F25910.svg?style=for-the-badge&logo=Apache&logoColor=white
[Apache License, Version 2.0]: https://www.apache.org/licenses/LICENSE-2.0

[Documentation]: https://qubitpi.github.io/jersey-webservice-template/
[Documentation]: https://fastws.qubitpi.org/

[GitHub templates]: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-template-repository#about-template-repositories
[GitHub Workflow Status]: https://img.shields.io/github/actions/workflow/status/QubitPi/jersey-webservice-template/ci-cd.yml?branch=master&logo=github&style=for-the-badge
[GitHub Workflow Status]: https://img.shields.io/github/actions/workflow/status/QubitPi/fast-ws/ci-cd.yml?branch=master&logo=github&style=for-the-badge

[Java Version Badge]: https://img.shields.io/badge/Java-17-brightgreen?style=for-the-badge&logo=OpenJDK&logoColor=white
[jersey-webservice-template]: https://qubitpi.github.io/jersey-webservice-template/
[fast-ws]: https://fastws.qubitpi.org/
[JSR 370]: https://jcp.org/en/jsr/detail?id=370

[Spring Initializr]: https://start.spring.io/
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Jersey Webservice Template Documentation
========================================
FastWS Documentation
====================

This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/authors.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jiaqi:
name: Jack
title: Maintainer of Jersey Webservice Template
title: Maintainer of FastWS
url: https://github.com/QubitPi
image_url: https://avatars.githubusercontent.com/u/16126939?v=4
2 changes: 1 addition & 1 deletion docs/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Configuration
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

JAX-RS Jersey doesn't specify how application configurations are to be loaded. jersey-webservice-template, however,
JAX-RS Jersey doesn't specify how application configurations are to be loaded. FastWS, however,
utilizes a library called [owner].

The configurations in this page can be set from several sources in the following order:
Expand Down
51 changes: 25 additions & 26 deletions docs/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Template.
Preparing for Local Development
-------------------------------

This section discusses the one-time setup in order to develop Jersey Webservice Template.
This section discusses the one-time setup in order to develop FastWS.

### Installing Java & Maven (on Mac)

Expand Down Expand Up @@ -38,7 +38,7 @@ Make sure to execute the `sudo ln -sfn`, `echo 'export PATH=...`, and the `expor

:::tip

JWT is built using maven. Maven uses a separate JDK version, which can be seen via `mvn -v`. If it's not JDK 17, we
FastWS is built using maven. Maven uses a separate JDK version, which can be seen via `mvn -v`. If it's not JDK 17, we
should have Maven point to our JDK 17 using [JAVA_HOME](https://stackoverflow.com/a/2503679):

```bash
Expand All @@ -61,25 +61,24 @@ OpenJDK 64-Bit Server VM (build 17.0.10+9, mixed mode)

### Installing Docker Engine

Jersey Webservice Template has [Docker-based integration tests]; it also supports
[running template webserivce in Docker][jersey-webservice-template Dockerfile]. Docker can be installed by following its
FastWS has [Docker-based integration tests]; it also supports
[running template webserivce in Docker][fast-ws Dockerfile]. Docker can be installed by following its
[official instructions](https://docs.docker.com/desktop/install/mac-install/)

Getting Source Code
-------------------

```bash
git clone git@github.com:QubitPi/jersey-webservice-template.git
cd jersey-webservice-template
git clone git@github.com:QubitPi/fast-ws.git
cd fast-ws
```

### Syncing up with jersey-webservice-template's Code Styles with IntelliJ
### Syncing up with FastWS's Code Styles with IntelliJ

For the moment, we have distilled the most important code style conventions with respect to
jersey-webservice-template's code as IntelliJ settings. If IntelliJ is used for IDE, we may import these code style
settings by importing the [jersey-webservice-template-Project-intellij-code-style.xml][style config] file in the root
of the repo. The setting for the project will appear as a new Scheme named "jersey-webservice-template-Project" under
IDE's __Editor__ -> __Code Style__ section.
For the moment, we have distilled the most important code style conventions with respect to FastWS's code as IntelliJ
settings. If IntelliJ is used for IDE, we may import these code style settings by importing the
[FastWS-Project-intellij-code-style.xml][style config] file in the root of the repo. The setting for the project will
appear as a new Scheme named "fast-ws-Project" under IDE's __Editor__ -> __Code Style__ section.

Please also enable "remove unused imports" by __Editor__ -> __General__ -> __Auto Import__ -> __Optimize Imports on the
Fly__, which will automatically remove unused imports.
Expand All @@ -106,7 +105,7 @@ For IT tests, we use [Testcontainers] instead of [jcabi-mysql] because the latte
Packaging
---------

A [WAR file](https://en.wikipedia.org/wiki/WAR_(file_format)) named __jersey-webservice-template-1.0-SNAPSHOT.war__ will
A [WAR file](https://en.wikipedia.org/wiki/WAR_(file_format)) named __fast-ws-1.0-SNAPSHOT.war__ will
be generated under _target_ directory for [running in Jetty](#running-webservice-in-standalone-jetty-production) with
the command below:

Expand All @@ -127,34 +126,34 @@ We can obtain the image in one of the 2 approaches below:

#### Docker Hub

We can pull the image from [my docker hub](https://hub.docker.com/r/jack20191124/jersey-webservice-template/):
We can pull the image from [my docker hub](https://hub.docker.com/r/jack20191124/fast-ws/):

```bash
docker pull jack20191124/jersey-webservice-template
docker pull jack20191124/fast-ws
```

#### GitHub

We could also build the image from [source][Docker]:

```bash
git clone https://github.com/QubitPi/jersey-webservice-template.git
cd jersey-webservice-template
docker build -t jack20191124/jersey-webservice-template .
git clone https://github.com/QubitPi/fast-ws.git
cd fast-ws
docker build -t jack20191124/fast-ws .
```

Please note that the `jack20191124/jersey-webservice-template` in the last command is the image name; we could replace
Please note that the `jack20191124/fast-ws` in the last command is the image name; we could replace
that value with anything preferred

### Standing up a Container

When image is built, we can spin up an instance with

```bash
docker run --name=jersey-webservice-template -it -p 8080:8080 jack20191124/jersey-webservice-template
docker run --name=fast-ws -it -p 8080:8080 jack20191124/fast-ws
```

- __name=jersey-webservice-template__: the container is named "jersey-webservice-template". We can change it
- __name=fast-ws__: the container is named "fast-ws". We can change it
accordingly.
- __-p 8080:8080__: 8080 is the port where webservice will listen on. With this port forwarding, we will be able to
access webservice from host machine web browser at `localhost:8080`
Expand All @@ -176,7 +175,7 @@ Running Webservice in Standalone Jetty

### Download Jetty

For JDK __17__, which is the version JWT runs on, it's been tested that Jetty _11.0.15_ worked. Hence, we will use
For JDK __17__, which is the version FastWS runs on, it's been tested that Jetty _11.0.15_ worked. Hence, we will use
["11.0.15" release](https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-home/11.0.15/jetty-home-11.0.15.tar.gz) as
an example:

Expand Down Expand Up @@ -253,12 +252,12 @@ If tabs still come out at 2 spaces when hitting TAB or Enter, not 4 spaces, try:
2. Do you have any .editorconfig files anywhere in the path of that file? Settings from .editorconfig
("Settings | Editor | Code Style") have priority (will overwrite) over your IDE settings.

[Docker]: https://github.com/QubitPi/jersey-webservice-template/blob/master/Dockerfile
[Docker-based integration tests]: https://github.com/QubitPi/jersey-webservice-template/blob/master/src/test/groovy/com/qubitpi/ws/jersey/template/DockerITSpec.groovy
[Docker]: https://github.com/QubitPi/fast-ws/blob/master/Dockerfile
[Docker-based integration tests]: https://github.com/QubitPi/fast-ws/blob/master/src/test/groovy/com/qubitpi/ws/jersey/template/DockerITSpec.groovy

[jcabi-mysql]: https://mysql.jcabi.com/
[jersey-webservice-template Dockerfile]: https://github.com/QubitPi/jersey-webservice-template/blob/master/Dockerfile
[fast-ws Dockerfile]: https://github.com/QubitPi/fast-ws/blob/master/Dockerfile

[style config]: https://github.com/QubitPi/jersey-webservice-template/blob/master/Jersey-Webservice-Template-Project-intellij-code-style.xml
[style config]: https://github.com/QubitPi/fast-ws/blob/master/FastWS-Project-intellij-code-style.xml

[Testcontainers]: https://qubitpi.github.io/testcontainers-java/
12 changes: 6 additions & 6 deletions docs/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Getting Started
:::caution

Before proceeding, it is important to note that __we DO NOT support Spring/Spring Boot paradigm__.
[Jersey Webservice Template] runs as a **[JAX-RS]** webservice backed by its reference implementation [Jersey] running
[FastWS] runs as a **[JAX-RS]** webservice backed by its reference implementation [Jersey] running
as a WAR inside [Jetty] container.

More info about difference between JAX-RS and Spring can be found in [this thread](https://stackoverflow.com/a/42955575)

:::

To use JWT as the basis for a webservice, we start by creating a repository using the template on GitHub.
To use FastWS as the basis for a webservice, we start by creating a repository using the template on GitHub.

Creating a Repository from GitHub Template
------------------------------------------

We can click on this link to generate a repository using the template: [Create a new repository](https://github.com/QubitPi/jersey-webservice-template/generate) from QubitPi/jersey-webservice-template. Alternatively, we can visit
the [jersey-webservice-template repository on GitHub](https://github.com/QubitPi/jersey-webservice-template) and click
We can click on this link to generate a repository using the template: [Create a new repository](https://github.com/QubitPi/fast-ws/generate) from QubitPi/fast-ws. Alternatively, we can visit
the [fast-ws repository on GitHub](https://github.com/QubitPi/fast-ws) and click
on the "Use this template" button on the top-right.

In both cases, the next steps are:
Expand All @@ -45,13 +45,13 @@ applies
After Creating the Repository
-----------------------------

At this point, JWT has generated a Java webservice project with just what we need to start quickly. Developer can now
At this point, FastWS has generated a Java webservice project with just what we need to start quickly. Developer can now
start adding business value and __get work done much faster in a standard way__. The following sections of this
documentation contain further details on how to proceed next.

- [Development](development)
- [Configuration](configuration)

[JAX-RS]: https://jcp.org/en/jsr/detail?id=370
[Jersey Webservice Template]: https://qubitpi.github.io/jersey-webservice-template/
[FastWS]: https://fastws.qubitpi.org/
[Jetty]: https://en.wikipedia.org/wiki/Jetty_(web_server)
Loading
Loading