Skip to content

Commit

Permalink
Merge pull request #51 from fsereno/dev
Browse files Browse the repository at this point in the history
Latest release
  • Loading branch information
fsereno authored May 5, 2024
2 parents b13b556 + 9eb9ba2 commit eff1241
Show file tree
Hide file tree
Showing 77 changed files with 27,232 additions and 18,729 deletions.
131 changes: 84 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a href="http://fswebsitesolutions.com/"><img src="https://raw.githubusercontent.com/fsereno/portfolio/master/docs/images/FSLogo.jpeg" width="100px" title="FS Website Solutions" alt="FS Website Solutions" target="_blank"></a>

# **Fabio Sereno** - Software Developer
# **Fabio Sereno** - Software Engineer
Highly experienced Full Stack Software Engineer with over 15 years of experience (6+ years in the FinTech sector). Self-motivated, enthusiastic, and professional team player with strong analytical and problem-solving skills. Demonstrates proficiency in coding and a proven ability to successfully complete projects with innovation and creativity.

Passionate about software development and constantly eager to learn and adopt the latest technologies. Keen interest in FinTech, HealthTech, Commerce, ML/AI, Blockchain, XR (VR/AR), and IoT.
Expand Down Expand Up @@ -39,130 +39,167 @@ Some of the technology used in this project and related projects:
- SOLID principles
- TDD - Test driven development
- DDD - Domain driven development
---

## Contents

- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Usage](#usage)
- [Licence](#licence)
---

## Prerequisites

- Docker (https://www.docker.com/)
---
- NodeJS (https://nodejs.org/en/)

## Installation

- Follow these steps to install this repo locally.
---

### Clone

- Clone this repo to your local machine using `https://github.com/fsereno/portfolio`
---

### Run inside a Container using Docker
### Compose

- Please ensure you have Docker installed and running.
- Open your preferred command line:

Launch the production environment
Docker compose files are dynamically built, depending on command line arguments.

```shell
$ npm run compose -- <options>
```
Passing no arguments will result in adding all available services to the production compose file.

Alternatively, passing --mode dev, will build the development compose file.

```shell
$ npm run compose -- --mode dev
```
However, once again, this will include all available services in the compose file.

To include only specific services in the compose file, use the --include argument:

```shell
$ npm run compose -- --include dataStructures --mode dev
```
##### This will:
- Compose the development version of the file.
- Simply exclude --mode dev if building for production.
- Include only the dataStructures service.
- The necessary Nginx service will also be included.

### Start/Stop

- Please ensure you have Docker installed and running.
- Open your preferred command line:

```shell
$ docker compose up
$ npm run start -- <options>
```
Passing no arguments will result in the production environment being started.

##### This will:
- Pull all images from Docker Hub.
- Spin up all services in containers.
- The application will be available at: http://localhost/
- The application will be available at: http://localhost

To run one of the following specific Docker tasks
- analysis
- create
- dev
- rel
- test
- test-e2e
To stop one of the above tasks, excluding those which destroy themselves:

```shell
$ sh start <task>
$ npm run stop -- <options>
```
To stop one of the above tasks, excluding those which destroy themselves (create, test)

Passing --name will start a particular container.

```shell
$ sh stop <task>
$ npm run start -- --name <application_name>
```
---

### Tasks
##### This will:
- Start only the container for the given application.
- The application will be available at: http://localhost

To stop a particular container:

```shell
$ npm run stop -- --name <application_name>
```

#### Serve a specific application via the development server
To start the development environment:

```shell
$ sh start dev <application>
$ npm run start -- --mode dev --context dataStructures
```
##### This will:
- Start the development server.
- Watch for any changes on development resources.
- Hot-reload any changes straight to the browser.
- The default application is the root application - home
- Open your browser and navigate to http://localhost:8080.
---
- Start the webpack development server.
- Start the necessary backend services.
- Watch for any changes on dataStructures development resources.
- Hot-reload any changes straight to the browser for the dataStructures application.
- The default application is the root application - home.
- Open your browser and navigate to http://localhost

#### Run analysis on a specific application
#### Run dependency analysis on a specific application

```shell
$ sh start analysis <application>
$ npm run start -- --context dataStructures --mode analysis
```
##### This will:
- Start the analysis server.
- Perform a dependency analysis of the application.
- Open your browser and navigate to http://localhost:8080.
---
- Start the webpack analysis server.
- Perform a dependency analysis of the dataStructures application frontend.
- The default application is the root application - home.
- Open your browser and navigate to http://localhost

### Tasks

- Please ensure you have Docker installed and running.
- Open your preferred command line:

Tasks create ephemeral containers. Containers which are destroyed after a task has completed.

#### Build for release

```shell
$ sh start rel
$ npm run task -- --name build
```
##### This will:
- Build the production static assets directory.
---
- Create an ephemeral container to run the task.
- Build the production static assets directory (dist or docs, depending on the configuration).
- The container is automatically destroyed after use.

#### Run all unit tests
#### Run all frontend unit tests

```shell
$ sh start test
$ npm run task -- --name test
```
##### This will:
- Create an ephemeral container to run the task.
- Run all application specific and global unit tests.
---

#### Run all functional end-to-end tests

Ensure the application is already running first.

```shell
$ sh start test-e2e
$ npm run test-apps-e2e
```
##### This will:
- Run all functional tests from the ./app/tests/functional directory
- Currently this feature is a work in progress (WIP) and will not work on ARM architecture
---

#### Create a new application

```shell
$ sh create
$ npm run task -- --name create
```
##### This will:
- Create an ephemeral container to run the task.
- Build applications based on the config.json file.
- New applications are built based on the 'masterTemplateDir' property.
- If an application already exists, nothing will be overwritten.
---

## Licence

- **[MIT licence](https://fsereno.github.io/portfolio/app_licence/index.html)**
- Copyright 2021 © Fabio Sereno.
- Copyright 2024 © Fabio Sereno.
11 changes: 1 addition & 10 deletions app/app_UniqueDataEntry/tests/e2e/taiko.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { openBrowser, goto, write, click, closeBrowser, $, into, textBox, button, waitFor, evaluate, text } from 'taiko';
import { ConfigUtil } from '../../../js/modules/utils/configUtil';

const APPLICATION = "app_AzureDotNetCoreUniqueDataEntryApi";
const APPLICATION = "app_uniqueDataEntry";
const CONFIG = ConfigUtil.get();
const URL = `http://${CONFIG.dockerHost}/${APPLICATION}/index.html`;

Expand All @@ -20,9 +20,6 @@ beforeAll(async () => {
describe(APPLICATION, () => {
test('Should add an item to the table', async () => {
await goto(URL);
await write('14', into(textBox({ id: 'answerInput' }), { force: true }));
await click(button({ id: 'submitPuzzle' }));
await waitFor(2000);
await write('James', into(textBox({ id: 'firstNameInput' })));
await write('Brown', into(textBox({ id: 'secondNameInput' })));
await write('(000) 111 222', into(textBox({ id: 'contactInput' })));
Expand All @@ -34,9 +31,6 @@ describe(APPLICATION, () => {
}, 100000);
test('Should not add a duplicate item to the table', async () => {
await goto(URL);
await write('14', into(textBox({ id: 'answerInput' }), { force: true }));
await click(button({ id: 'submitPuzzle' }));
await waitFor(2000);
await write('John', into(textBox({ id: 'firstNameInput' })));
await write('Doe', into(textBox({ id: 'secondNameInput' })));
await write('000000000', into(textBox({ id: 'contactInput' })));
Expand All @@ -52,9 +46,6 @@ describe(APPLICATION, () => {
}, 100000);
test('Should remove an item to the table', async () => {
await goto(URL);
await write('14', into(textBox({ id: 'answerInput' }), { force: true }));
await click(button({ id: 'submitPuzzle' }));
await waitFor(2000);
await click($('a.delete[data-index="0"]'));
const result = await evaluate($('#itemTable'), (element) => element.innerText);
expect(result).toBe('First name\tSecond name\tContact\tPostcode\tAction');
Expand Down
8 changes: 7 additions & 1 deletion app/app_nodeToDo/backend/api/services/userService.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ const { v4: uuidv4 } = require('uuid');
/**
* The registered users.
*/
const users = [];
const users = [
{
id: '1792aef2-2842-40ba-92a7-e7c6288f4595',
username: 'tester',
password: 'b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86'
}
];

// private members
/**
Expand Down
Loading

0 comments on commit eff1241

Please sign in to comment.