Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
williamsimionatto authored May 9, 2024
0 parents commit dfd1819
Show file tree
Hide file tree
Showing 323 changed files with 39,923 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
build
coverage
.git
.gitignore
npm-debug.log
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_BASE_URL=http://localhost:3000
REACT_APP_GOOGLE_MAPS_KEY=API_KEY_HERE
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.js
node_modules
build
31 changes: 31 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"react-app",
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"plugin:prettier/recommended"
],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "prettier"],
"rules": {
// overrides
"testing-library/no-container": "off",

// custom
"testing-library/no-await-sync-events": "error",
"testing-library/no-manual-cleanup": "error",
"testing-library/prefer-explicit-assert": "error",
"testing-library/prefer-wait-for": "error",
"testing-library/no-node-access": ["off"],
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"sort-imports": ["warn", { "ignoreDeclarationSort": true }]
}
}
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "npm"
open-pull-requests-limit: 0
directory: "/"
rebase-strategy: "disabled"
schedule:
interval: "weekly"
55 changes: 55 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Description

<!--
Please do not leave this blank
This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
-->

## Type of change (check all applicable)

- [ ] 🍕 Feature
- [ ] 🐛 Bug Fix
- [ ] 📝 Documentation Update
- [ ] 🧑‍💻 Code Refactor
- [ ] 🔥 Performance Improvements
- [ ] ✅ Test


## Related Tickets & Documents
<!--
Please use this format link issue numbers: Fixes #123
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->

## Proof of completion, QA Instructions, Screenshots, Recordings

_Use this section as a proof of completion, creating an evidence that is working properly. Replace this line with instructions on how to test your changes, a note
on the devices and browsers this has been tested on, as well as any relevant images for UI changes._


## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] Any dependent changes have been merged and published in downstream modules


<!-- note: PRs with deleted sections will be marked invalid -->

<!--
For Work In Progress Pull Requests, please use the Draft PR feature,
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details.
For a timely review/response, please avoid force-pushing additional
commits if your PR already received reviews or comments.
Before submitting a Pull Request, please ensure you've done the following:
- 👷‍♀️ Create small PRs. In most cases, this will be possible.
- ✅ Provide tests for your changes.
- 📝 Use descriptive but atomic commit messages.
- 📗 Update any related documentation and include any relevant screenshots.
-->
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
push:
branches:
- master

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# If you wish to fail your job when the Quality Gate is red, uncomment the
# following lines. This would typically be used to fail a deployment.
# - uses: sonarsource/sonarqube-quality-gate-action@master
# timeout-minutes: 5
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Pull Requests CI

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
install:
name: Install dependencies
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 19.6.0

- uses: actions/cache@v2
id: npm-cache
with:
path: |
node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm install

build:
needs: install
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 19.6.0

- uses: actions/cache@v2
with:
path: |
node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Build package
run: npm run build

lint:
needs: install
name: Lint
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 19.6.0

- uses: actions/cache@v2
with:
path: |
node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: lint
run: npm run lint
env:
SKIP_PREFLIGHT_CHECK: true

prettier:
needs: install
name: Prettier
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 19.6.0

- uses: actions/cache@v2
with:
path: |
node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: prettier
run: npm run prettier:check

test:
needs: install
name: Test Application
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jest-total-partitions: [4]
jest-partition: [1, 2, 3, 4]
steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 19.6.0

- uses: actions/cache@v2
with:
path: |
node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: test
run: npm run test:ci
env:
JEST_TOTAL_PARTITIONS: ${{ matrix.jest-total-partitions }}
JEST_PARTITION: ${{ matrix.jest-partition }}
SKIP_PREFLIGHT_CHECK: true
NODE_ENV: test
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# environment
.env

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v19.6.0
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"endOfLine": "lf",
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
}
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 19.6.0
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
}
27 changes: 27 additions & 0 deletions Dockerfile.azure
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:16.14-alpine

WORKDIR /app

COPY . .

RUN npm cache clean --force
RUN npm install
RUN npm run build
ENV PORT 4000
ENV NODE_ENV production

ARG REACT_APP_GOOGLE_MAPS_KEY

COPY sshd_config /etc/ssh/
COPY entrypoint.sh ./

# Start and enable SSH (Azure)
RUN apk add openssh \
&& echo "root:Docker!" | chpasswd \
&& chmod +x ./entrypoint.sh \
&& cd /etc/ssh/ \
&& ssh-keygen -A

EXPOSE 4000 2222

ENTRYPOINT [ "./entrypoint.sh" ]
10 changes: 10 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:16.14-alpine

WORKDIR /app

COPY . .

RUN npm cache clean --force
RUN npm install

EXPOSE 4000
Loading

0 comments on commit dfd1819

Please sign in to comment.