Skip to content

Commit

Permalink
Merge branch 'main' into ci/create-continuous-integration-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
idmarjr committed Apr 25, 2024
2 parents b98e3f1 + fc59ebc commit 1c12d0b
Show file tree
Hide file tree
Showing 58 changed files with 6,534 additions and 5,701 deletions.
14 changes: 13 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,24 @@
"contributions": [
"test"
]
},
{
"login": "Tarliton",
"name": "Tárliton Basso de Godoy",
"avatar_url": "https://avatars.githubusercontent.com/u/7471617?v=4",
"profile": "https://github.com/Tarliton",
"contributions": [
"code",
"infra"
]
}
],
"contributorsPerLine": 7,
"projectName": "brmodelo-app",
"projectOwner": "brmodeloweb",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
"skipCi": true,
"commitType": "docs",
"commitConvention": "angular"
}
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
node_modules/
.git/
data/
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: brmodeloweb # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM node:16-alpine
RUN mkdir -p /usr/src/app
ENV APP_PATH /usr/src/app
COPY package.json $APP_PATH
WORKDIR $APP_PATH
RUN yarn install
COPY . $APP_PATH

WORKDIR /usr/src/app

COPY yarn.lock package.json .

RUN --mount=type=cache,target=/root/.yarn --mount=type=cache,target=/root/.cache YARN_CACHE_FOLDER=/root/.yarn yarn install

COPY . .

# expose port 3000 for server and 9000 for webpack-dev-server
EXPOSE 3000 9000

# run start:frontend and start:dev in parallel
CMD ["yarn", "start:frontend", "start:dev"]
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [app.brmodeloweb.com](https://app.brmodeloweb.com)
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

## Web application for database modeling and teaching
Expand All @@ -21,7 +21,7 @@ To run this application you'll need:

1. Install dependencies: `yarn install`
1. Duplicate `.env.example` and rename it to `.env`
1. Make sure you have MongoDB running (To know more: [MacOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#run-mongodb-community-edition), [Windows](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#run-mongodb-community-edition-as-a-windows-service), [CentOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/#run-mongodb-community-edition), [Ubuntu](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition) or [Debian](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/#run-mongodb-community-edition))
1. Make sure you have MongoDB running (To know more: [MacOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#run-mongodb-community-edition), [Windows](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#run-mongodb-community-edition-as-a-windows-service), [CentOS](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/#run-mongodb-community-edition), [Ubuntu](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#run-mongodb-community-edition) or [Debian](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/#run-mongodb-community-edition))
1. Start frontend: `yarn start:frontend`
1. Start server: `yarn start:dev`
1. Access it: [http://localhost:9000/](http://localhost:9000/)
Expand All @@ -30,29 +30,37 @@ To run this application you'll need:

> **Note:** Docker setup is still a work in progress and does not offer a good developer experience. For now we recommend you to run the project locally following the instructions listed above. If you still want to use docker, here's how:
1. Make sure you have [Docker Desktop](https://www.docker.com/get-started) running
1. Make sure you have [Docker Desktop](https://www.docker.com/get-started) running
1. Start docker: `docker-compose up` or `docker-compose up -d`
1. Access it: [http://localhost:9000/](http://localhost:9000/)
1. Once your done, finish docker: `docker-compose down`

## Tests

### Setup tests

1. Duplicate `cypress.env.example.json` and rename it to `cypress.env.json`
1. Update `cypress.env.json` with valid user credentials (Username and password)

> [!WARNING]
> The data from the accound you set in `cypress.env.json` will be wiped out after the tests run.
> So, don't use your real account here!
### E2E tests

To run E2E tests you have two options:

1. Run headless mode in your terminal window: `yarn test:cy`
1. Run interactive mode: `yarn cy:open`


### Unit Tests

To run the unit tests you have two options:

- `yarn test` to run all the tests and collect the coverage report. Or;
- `yarn test` to run all the tests and collect the coverage report. Or;
- Execute in a `watch` mode by running `yarn test:watch`

### E2E Tests
First, make sure you have the project up and running with database, backend, and frontend.

1. Duplicate `cypress.env.example.json` and rename it to `cypress.env.json`
1. Edit `cypress.env.json` adding valid user credentials (Username and password)
> **Note:** Tests will delete all models from your user. To avoid lost your work we recommend you to create a different user to run the tests
1. To run the tests you have two options:
1. Run headless mode in your terminal window: `yarn test:cy`
1. Run interactive mode: `yarn cy:open`

## Production environments

Expand All @@ -67,18 +75,21 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/miltonbsn"><img src="https://avatars2.githubusercontent.com/u/881231?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Milton Bittencourt de Souza Neto</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=miltonbsn" title="Code">💻</a> <a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=miltonbsn" title="Tests">⚠️</a> <a href="https://github.com/brmodeloweb/brmodelo-app/issues?q=author%3Amiltonbsn" title="Bug reports">🐛</a> <a href="#maintenance-miltonbsn" title="Maintenance">🚧</a></td>
<td align="center"><a href="http://id.etc.br"><img src="https://avatars3.githubusercontent.com/u/301545?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Idmar Ramos Junior (Id)</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=idmarjr" title="Code">💻</a> <a href="#design-idmarjr" title="Design">🎨</a> <a href="#projectManagement-idmarjr" title="Project Management">📆</a> <a href="#maintenance-idmarjr" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://about.me/feekosta"><img src="https://avatars3.githubusercontent.com/u/13004903?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Felipe de Souza da Costa</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=feekosta" title="Code">💻</a> <a href="#infra-feekosta" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/brmodeloweb/brmodelo-app/pulls?q=is%3Apr+reviewed-by%3Afeekosta" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/oicramps"><img src="https://avatars.githubusercontent.com/u/7519115?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Márcio Santos</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=oicramps" title="Code">💻</a> <a href="https://github.com/brmodeloweb/brmodelo-app/pulls?q=is%3Apr+reviewed-by%3Aoicramps" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://www.linkedin.com/in/telmo-trooper/"><img src="https://avatars.githubusercontent.com/u/9438853?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Telmo "Trooper"</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=telmotrooper" title="Code">💻</a></td>
<td align="center"><a href="https://www.linkedin.com/in/arthurmota/"><img src="https://avatars.githubusercontent.com/u/25749372?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Arthur Mota</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=ArthurMota9" title="Code">💻</a> <a href="https://github.com/brmodeloweb/brmodelo-app/pulls?q=is%3Apr+reviewed-by%3AArthurMota9" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/joaomfiumari"><img src="https://avatars.githubusercontent.com/u/7141759?v=4?s=100" width="100px;" alt=""/><br /><sub><b>joaomfiumari</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=joaomfiumari" title="Code">💻</a> <a href="#infra-joaomfiumari" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center"><a href="https://walmyr.dev"><img src="https://avatars.githubusercontent.com/u/2768415?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Walmyr</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=wlsf82" title="Tests">⚠️</a></td>
</tr>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/miltonbsn"><img src="https://avatars2.githubusercontent.com/u/881231?v=4?s=100" width="100px;" alt="Milton Bittencourt de Souza Neto"/><br /><sub><b>Milton Bittencourt de Souza Neto</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=miltonbsn" title="Code">💻</a> <a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=miltonbsn" title="Tests">⚠️</a> <a href="https://github.com/brmodeloweb/brmodelo-app/issues?q=author%3Amiltonbsn" title="Bug reports">🐛</a> <a href="#maintenance-miltonbsn" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://id.etc.br"><img src="https://avatars3.githubusercontent.com/u/301545?v=4?s=100" width="100px;" alt="Idmar Ramos Junior (Id)"/><br /><sub><b>Idmar Ramos Junior (Id)</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=idmarjr" title="Code">💻</a> <a href="#design-idmarjr" title="Design">🎨</a> <a href="#projectManagement-idmarjr" title="Project Management">📆</a> <a href="#maintenance-idmarjr" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://about.me/feekosta"><img src="https://avatars3.githubusercontent.com/u/13004903?v=4?s=100" width="100px;" alt="Felipe de Souza da Costa"/><br /><sub><b>Felipe de Souza da Costa</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=feekosta" title="Code">💻</a> <a href="#infra-feekosta" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/brmodeloweb/brmodelo-app/pulls?q=is%3Apr+reviewed-by%3Afeekosta" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/oicramps"><img src="https://avatars.githubusercontent.com/u/7519115?v=4?s=100" width="100px;" alt="Márcio Santos"/><br /><sub><b>Márcio Santos</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=oicramps" title="Code">💻</a> <a href="https://github.com/brmodeloweb/brmodelo-app/pulls?q=is%3Apr+reviewed-by%3Aoicramps" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/telmo-trooper/"><img src="https://avatars.githubusercontent.com/u/9438853?v=4?s=100" width="100px;" alt="Telmo "Trooper""/><br /><sub><b>Telmo "Trooper"</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=telmotrooper" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/arthurmota/"><img src="https://avatars.githubusercontent.com/u/25749372?v=4?s=100" width="100px;" alt="Arthur Mota"/><br /><sub><b>Arthur Mota</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=ArthurMota9" title="Code">💻</a> <a href="https://github.com/brmodeloweb/brmodelo-app/pulls?q=is%3Apr+reviewed-by%3AArthurMota9" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/joaomfiumari"><img src="https://avatars.githubusercontent.com/u/7141759?v=4?s=100" width="100px;" alt="joaomfiumari"/><br /><sub><b>joaomfiumari</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=joaomfiumari" title="Code">💻</a> <a href="#infra-joaomfiumari" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://walmyr.dev"><img src="https://avatars.githubusercontent.com/u/2768415?v=4?s=100" width="100px;" alt="Walmyr"/><br /><sub><b>Walmyr</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=wlsf82" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Tarliton"><img src="https://avatars.githubusercontent.com/u/7471617?v=4?s=100" width="100px;" alt="Tárliton Basso de Godoy"/><br /><sub><b>Tárliton Basso de Godoy</b></sub></a><br /><a href="https://github.com/brmodeloweb/brmodelo-app/commits?author=Tarliton" title="Code">💻</a> <a href="#infra-Tarliton" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
Expand Down
19 changes: 14 additions & 5 deletions app/angular/components/duplicateModelModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ import template from "./duplicateModelModal.html";

const app = angular.module("app.duplicateModelModalController", []);

const Controller = function () {
const Controller = function(ModelAPI) {
const $ctrl = this;
$ctrl.submitted = false;

$ctrl.$onInit = () => {
$ctrl.name = $ctrl.suggestedName;
};

$ctrl.save = function (modelname) {
$ctrl.save = function (newName) {
$ctrl.submitted = true;
if (modelname != null && modelname != "") {
$ctrl.close({
result: modelname,
if (newName != null && newName != "") {
ModelAPI.duplicate($ctrl.modelId, $ctrl.userId, newName).then((newModelResponse) => {
$ctrl.close({
result: newModelResponse.data,
});
}).catch(error => {
$ctrl.dismiss({
result: "error",
reason: error
});
});
}
};
Expand All @@ -33,6 +40,8 @@ export default app.component("duplicateModelModal", {
close: "&",
dismiss: "&",
suggestedName: "<",
userId: "<",
modelId: "<",
},
controller: Controller,
}).name;
9 changes: 9 additions & 0 deletions app/angular/components/githubSponsorBanner/index.html

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions app/angular/components/githubSponsorBanner/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import angular from "angular";
import template from "./index.html";
import "./index.scss";

const githubSponsorBanner = function () {};

export default angular.module("app.githubSponsorBanner", []).component("githubSponsorBanner", {
template,
controller: githubSponsorBanner,
}).name;
13 changes: 13 additions & 0 deletions app/angular/components/githubSponsorBanner/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
////////////////////////////////////////////////////////////////////////////////
// .alert-sponsor
////////////////////////////////////////////////////////////////////////////////
.github-sponsor-banner {
display: flex;
gap: 10px;
border: 1px solid #ddd;
margin-top: 24px;
}

.github-sponsor-banner .github-sponsor-img {
width: 128px;
}
1 change: 1 addition & 0 deletions app/angular/components/icons/conceptual/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960"><path d="M479.995-95.463q-59.995 0-102.033-42.042-42.038-42.042-42.038-102.034 0-53.265 33.615-93.171 33.616-39.906 84.462-48.888v-84.403h-206v-111.922H141.925v-264.152h264.152v264.152H300v59.924h372v-62.386q-50.846-8.538-84.461-48.444-33.616-39.906-33.616-93.17 0-59.992 42.044-102.034 42.043-42.042 102.038-42.042 59.994 0 102.032 42.042t42.038 102.034q0 53.264-33.615 93.17t-84.461 48.444v114.384h-218v84.403q50.846 8.982 84.462 48.888 33.615 39.906 33.615 93.171 0 59.992-42.044 102.034-42.043 42.042-102.037 42.042Zm218.227-534.459q38.239 0 65.047-27.031t26.808-65.269q0-38.239-27.031-65.047t-65.27-26.808q-38.239 0-65.046 27.031-26.808 27.031-26.808 65.27t27.031 65.046q27.031 26.808 65.269 26.808Zm-504.299 0h160.155v-160.155H193.923v160.155Zm286.3 482.46q38.239 0 65.047-27.031t26.808-65.269q0-38.239-27.031-65.047t-65.27-26.808q-38.239 0-65.047 27.031t-26.808 65.27q0 38.238 27.031 65.046 27.031 26.808 65.27 26.808ZM274.001-709.999Zm423.998-12ZM480-239.539Z"/></svg>
10 changes: 10 additions & 0 deletions app/angular/components/icons/conceptual/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import angular from "angular";
import template from "./index.html";
import "./index.scss";

const iconConceptual = function () {};

export default angular.module("app.iconConceptual", []).component("iconConceptual", {
template,
controller: iconConceptual
}).name;
10 changes: 10 additions & 0 deletions app/angular/components/icons/conceptual/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
icon-conceptual {
position: relative;
display: inline-block;
}

icon-conceptual svg {
display: block;
position: relative;
top: 5px;
}
1 change: 1 addition & 0 deletions app/angular/components/icons/logic/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960"><path d="M228.309-164.001q-26.308 0-45.308-19t-19-45.308v-503.382q0-27.008 19-45.658 19-18.65 45.308-18.65h503.382q27.008 0 45.658 18.65 18.65 18.65 18.65 45.658v503.382q0 26.308-18.65 45.308t-45.658 19H228.309ZM216-602.537h528v-129.154q0-4.616-3.846-8.463-3.847-3.846-8.463-3.846H228.309q-4.616 0-8.463 3.846-3.846 3.847-3.846 8.463v129.154Zm0 193.076h528v-141.078H216v141.078ZM228.309-216h503.382q4.616 0 8.463-3.846 3.846-3.847 3.846-8.463v-129.154H216v129.154q0 4.616 3.846 8.463 3.847 3.846 8.463 3.846Zm51.077-424.923v-64.307h64.307v64.307h-64.307Zm0 193.077v-64.308h64.307v64.308h-64.307Zm0 193.076v-64.307h64.307v64.307h-64.307Z"/></svg>
10 changes: 10 additions & 0 deletions app/angular/components/icons/logic/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import angular from "angular";
import template from "./index.html";
import "./index.scss";

const iconLogic = function () {};

export default angular.module("app.iconLogic", []).component("iconLogic", {
template,
controller: iconLogic
}).name;
10 changes: 10 additions & 0 deletions app/angular/components/icons/logic/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
icon-logic {
position: relative;
display: inline-block;
}

icon-logic svg {
display: block;
position: relative;
top: 5px;
}
Loading

0 comments on commit 1c12d0b

Please sign in to comment.