+ {{$ctrl.model.name}}
+ {{$ctrl.model.name}}
{{ $ctrl.feedback.message }}
+diff --git a/.all-contributorsrc b/.all-contributorsrc index b19eda86..fd879541 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -87,6 +87,16 @@ "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, @@ -94,5 +104,7 @@ "projectOwner": "brmodeloweb", "repoType": "github", "repoHost": "https://github.com", - "skipCi": true + "skipCi": true, + "commitType": "docs", + "commitConvention": "angular" } diff --git a/.dockerignore b/.dockerignore index 40b878db..56f4d4bb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,3 @@ -node_modules/ \ No newline at end of file +node_modules/ +.git/ +data/ diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..a73491bb --- /dev/null +++ b/.github/FUNDING.yml @@ -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'] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d6eec81d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: ci + +on: + push: + branches: + - main + pull_request: + +jobs: + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: yarn install + - name: Run unit tests π§ͺ + run: yarn test + end-to-end-tests-chrome: + needs: unit-tests + runs-on: ubuntu-latest + container: cypress/base:16.5.0 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dependencies + uses: cypress-io/github-action@v2 + with: + install-command: yarn install + runTests: false + - name: Run end-to-end tests on Chrome π§ͺ + uses: cypress-io/github-action@v2 + env: + API_URL: ${{ secrets.API_URL }} + PORT: ${{ secrets.PORT }} + MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }} + CYPRESS_user: ${{ secrets.CYPRESS_user }} + CYPRESS_password: ${{ secrets.CYPRESS_password }} + with: + install: false + start: yarn start:dev, yarn start:frontend + command: yarn test:cy + end-to-end-tests-firefox: + needs: unit-tests + runs-on: ubuntu-latest + container: cypress/base:16.5.0 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dependencies + uses: cypress-io/github-action@v2 + with: + install-command: yarn install + runTests: false + - name: Run end-to-end tests on Firefox π§ͺ + uses: cypress-io/github-action@v2 + env: + API_URL: ${{ secrets.API_URL }} + PORT: ${{ secrets.PORT }} + MONGODB_LOCAL_URL: ${{ secrets.MONGODB_LOCAL_URL }} + CYPRESS_user: ${{ secrets.CYPRESS_user }} + CYPRESS_password: ${{ secrets.CYPRESS_password }} + with: + install: false + start: yarn start:dev, yarn start:frontend + command: yarn test:cy:firefox diff --git a/Dockerfile b/Dockerfile index 6c1998af..8579402c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index 7da99636..cdfcd517 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [app.brmodeloweb.com](https://app.brmodeloweb.com) -[![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-) ## Web application for database modeling and teaching @@ -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/) @@ -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 @@ -67,18 +75,21 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
{{ 'BRMW is maintained by a small team working in their spare time, doing their best to make it available for free!' | translate }}
{{ 'Still, the server and database to keep the project live cost money.' | translate }}
{{ 'If you can, please considere a one time only or even monthly contribution via Github Sponsor.' | translate }}
+ {{ 'Go to Github Sponsors' | translate }} +{{ $ctrl.feedback.message }}
{{ 'Looks like this model does not exist or you don\'t have access to it.' | translate }}
+ {{ 'Back to models list' | translate }} +{{ $ctrl.feedback.message }}
+{{ $ctrl.feedback.message }}
+