Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

Commit 2d33214

Browse files
release: v0.0.0 (#3)
* ci: Create integration and tagging pipelines * build: Create build pipeline * chore: Create base react project with all deps * chore: Integrate session related files * feat(ui): Create responsive and reactive navbar * feat: Integrate login form * feat: Integrate register form * test: Add tests to the login and register forms * ci: Use separated cache for chromium and firefox browsers binaries * feat: Integrate Authentication Middleware component
1 parent e8eb7c3 commit 2d33214

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4514
-0
lines changed

.eslintrc.cjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true },
4+
extends: [
5+
"eslint:recommended",
6+
"plugin:@typescript-eslint/recommended",
7+
"plugin:react-hooks/recommended",
8+
"prettier"
9+
],
10+
ignorePatterns: ["dist", ".eslintrc.cjs"],
11+
parser: "@typescript-eslint/parser",
12+
plugins: ["react-refresh"],
13+
rules: {
14+
"react-refresh/only-export-components": [
15+
"warn",
16+
{ allowConstantExport: true }
17+
],
18+
"@typescript-eslint/no-unused-vars": [
19+
"error",
20+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" }
21+
],
22+
"react-hooks/exhaustive-deps": "off",
23+
}
24+
};

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Includes 📋
2+
3+
<!-- What does this PR includes? Use bulleted list. -->
4+
5+
## Related Issues 🔎
6+
7+
<!-- What issues does this PR fix or reference? You may use "Closes #<issue number>" to automatically close the issue when this PR is merged. -->
8+
9+
<!-- ## Notes 📝 -->
10+
<!-- Additional notes or implementation details. -->
11+
12+
<!-- ## Screenshots 📸 -->
13+
<!-- Use the following table template to add mobile screenshots. -->
14+
<!--
15+
| | |
16+
| --- | --- |
17+
-->

.github/workflows/integration.yaml

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-22.04
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v2
17+
with:
18+
version: 8.7.4
19+
run_install: false
20+
21+
- name: Get pnpm store directory
22+
shell: bash
23+
run: |
24+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
25+
26+
- uses: actions/cache@v3
27+
name: Setup pnpm cache
28+
with:
29+
path: ${{ env.STORE_PATH }}
30+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
restore-keys: |
32+
${{ runner.os }}-pnpm-store-
33+
34+
- name: Install dependencies
35+
run: pnpm install
36+
37+
- name: Build
38+
run: pnpm build
39+
40+
lint:
41+
runs-on: ubuntu-22.04
42+
43+
steps:
44+
- uses: actions/checkout@v3
45+
46+
- name: Setup pnpm
47+
uses: pnpm/action-setup@v2
48+
with:
49+
version: 8.7.4
50+
run_install: false
51+
52+
- name: Get pnpm store directory
53+
shell: bash
54+
run: |
55+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
56+
57+
- uses: actions/cache@v3
58+
name: Setup pnpm cache
59+
with:
60+
path: ${{ env.STORE_PATH }}
61+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
62+
restore-keys: |
63+
${{ runner.os }}-pnpm-store-
64+
65+
- name: Install dependencies
66+
run: pnpm install
67+
68+
- name: Linter
69+
run: pnpm lint:check
70+
71+
- name: Format
72+
run: pnpm format:check
73+
74+
chromium-tests:
75+
runs-on: ubuntu-22.04
76+
77+
steps:
78+
- uses: actions/checkout@v3
79+
80+
- name: Setup docker environment
81+
run: docker-compose up -d
82+
83+
- name: Setup pnpm
84+
uses: pnpm/action-setup@v2
85+
with:
86+
version: 8.7.4
87+
run_install: false
88+
89+
- name: Get pnpm store directory
90+
shell: bash
91+
run: |
92+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
93+
94+
- uses: actions/cache@v3
95+
name: Setup pnpm cache
96+
with:
97+
path: ${{ env.STORE_PATH }}
98+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
99+
restore-keys: |
100+
${{ runner.os }}-pnpm-store-
101+
102+
- name: Get installed playwright version
103+
id: playwright-version
104+
run: |
105+
echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
106+
107+
- name: Cache playwright browsers binaries
108+
uses: actions/cache@v3
109+
id: playwright-cache
110+
with:
111+
path: |
112+
~/.cache/ms-playwright/chromium-*
113+
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-chromium
114+
115+
- name: Install Playwright browser
116+
run: pnpx playwright install --with-deps chromium
117+
if: steps.playwright-cache.outputs.cache-hit != 'true'
118+
119+
- name: Install dependencies
120+
run: pnpm install
121+
122+
- name: Run tests
123+
run:
124+
pnpm test:run-chromium
125+
126+
firefox-tests:
127+
runs-on: ubuntu-22.04
128+
129+
steps:
130+
- uses: actions/checkout@v3
131+
132+
- name: Setup docker environment
133+
run: docker-compose up -d
134+
135+
- name: Setup pnpm
136+
uses: pnpm/action-setup@v2
137+
with:
138+
version: 8.7.4
139+
run_install: false
140+
141+
- name: Get pnpm store directory
142+
shell: bash
143+
run: |
144+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
145+
146+
- uses: actions/cache@v3
147+
name: Setup pnpm cache
148+
with:
149+
path: ${{ env.STORE_PATH }}
150+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
151+
restore-keys: |
152+
${{ runner.os }}-pnpm-store-
153+
154+
- name: Get installed playwright version
155+
id: playwright-version
156+
run: |
157+
echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
158+
159+
- name: Cache playwright browsers binaries
160+
uses: actions/cache@v3
161+
id: playwright-cache
162+
with:
163+
path: |
164+
~/.cache/ms-playwright/firefox-*
165+
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-firefox
166+
167+
- name: Install Playwright browser
168+
run: pnpx playwright install --with-deps firefox
169+
if: steps.playwright-cache.outputs.cache-hit != 'true'
170+
171+
- name: Install dependencies
172+
run: pnpm install
173+
174+
- name: Run tests
175+
run:
176+
pnpm test:run-firefox

.github/workflows/release.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version:
10+
runs-on: ubuntu-22.04
11+
outputs:
12+
version: ${{ steps.version.outputs.version }}
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Get latest version
17+
id: version
18+
run: |
19+
chmod u+x ./version.sh
20+
./version.sh >> $GITHUB_OUTPUT
21+
22+
release:
23+
runs-on: ubuntu-22.04
24+
permissions:
25+
contents: write
26+
packages: write
27+
needs:
28+
- version
29+
outputs:
30+
upload_url: ${{ steps.release.outputs.upload_url }}
31+
steps:
32+
- name: Create release
33+
id: release
34+
uses: actions/create-release@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tag_name: ${{ needs.version.outputs.version }}
39+
release_name: Release v${{ needs.version.outputs.version }}
40+
draft: false
41+
prerelease: false
42+
43+
docker:
44+
runs-on: ubuntu-22.04
45+
permissions:
46+
contents: read
47+
packages: write
48+
needs:
49+
- version
50+
- release
51+
steps:
52+
- uses: actions/checkout@v3
53+
54+
- name: Login
55+
uses: docker/login-action@v2
56+
with:
57+
registry: ghcr.io
58+
username: ${{ github.actor }}
59+
password: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Downcase repository name
62+
run: |
63+
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
64+
65+
- name: Build and push
66+
uses: docker/build-push-action@v3
67+
with:
68+
context: .
69+
push: true
70+
tags: ghcr.io/${{ env.REPOSITORY }}:latest,ghcr.io/${{ env.REPOSITORY }}:${{ needs.version.outputs.version }}

.github/workflows/tagging.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Tagging
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
tagging:
10+
permissions:
11+
contents: write
12+
13+
runs-on: ubuntu-22.04
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: TriPSs/conventional-changelog-action@v3
19+
name: Changelog
20+
id: changelog
21+
with:
22+
git-user-nane: "Pedro Andrés Chaparro Quintero"
23+
git-user-email: "pedro.chaparro.2020@upb.edu.co"
24+
git-message: "chore(release): {version}"

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
/test-results/
26+
/playwright-report/
27+
/playwright/.cache/

.prettierrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSameLine": false,
4+
"bracketSpacing": true,
5+
"semi": true,
6+
"singleQuote": false,
7+
"jsxSingleQuote": false,
8+
"quoteProps": "consistent",
9+
"trailingComma": "none",
10+
"singleAttributePerLine": false,
11+
"printWidth": 80,
12+
"useTabs": false,
13+
"tabWidth": 2,
14+
"importOrder": [
15+
"^@context/(.*)$",
16+
"^@hooks/(.*)$",
17+
"^@screens/(.*)$",
18+
"^@components/(.*)$",
19+
"^[./]"
20+
],
21+
"importOrderSeparation": true,
22+
"importOrderSortSpecifiers": true,
23+
"plugins": [
24+
"@trivago/prettier-plugin-sort-imports",
25+
"prettier-plugin-tailwindcss"
26+
]
27+
}

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# --- Build stage ---
2+
FROM node:20.5.1-alpine3.18 AS builder
3+
WORKDIR /app
4+
5+
RUN npm install -g pnpm
6+
7+
COPY package.json pnpm-lock.yaml ./
8+
RUN pnpm install
9+
10+
COPY . .
11+
RUN pnpm build
12+
13+
# --- Run stage ---
14+
FROM nginx:1-alpine3.18-slim AS runner
15+
16+
COPY ./config/nginx.conf /etc/nginx/conf.d/default.conf
17+
COPY --from=builder /app/dist /var/www/capyfile/html
18+
19+
EXPOSE 80
20+
CMD ["nginx", "-g", "daemon off;"]

0 commit comments

Comments
 (0)