Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
837e0b7
✨ A new beginning
jareddantis Apr 21, 2024
bb62154
Install Tailwind
jareddantis Apr 21, 2024
bd9008a
Add pre-commit lint and format hooks
jareddantis Apr 21, 2024
f6bc480
Install Material Symbols
jareddantis Apr 21, 2024
b2108ce
public: Add Inter font
jareddantis Apr 21, 2024
a464b1b
HomeView: Begin calc design impl
jareddantis Apr 21, 2024
31f94b3
ActionButton: Use dynamic component
jareddantis Apr 21, 2024
ac8feec
ActionButton: Don't string concat size class
jareddantis Apr 21, 2024
ee12a34
src: Generate client
jareddantis Apr 21, 2024
7bc153c
.gitignore: Don't commit .DS_Store
jareddantis Apr 21, 2024
805906a
utils: Add PSHS curriculum
jareddantis Apr 21, 2024
51a992a
src: Implement base calc functionality
jareddantis Apr 21, 2024
24a53ae
assets: Disable double-tap to zoom on buttons
jareddantis Apr 21, 2024
cfd37c6
stores: Persist calc state in new gradesStore
jareddantis May 4, 2024
d2d0dd8
feat: Implement a toast system
jareddantis May 4, 2024
3928d94
ResultDisplay: Remove rounded corners on scroll
jareddantis May 4, 2024
49bccfe
Home: Responsive styles
jareddantis May 4, 2024
a13231b
tsconfig: Fix missing NodeJS namespace
jareddantis May 4, 2024
38a82df
chore: Regenerate client
jareddantis May 4, 2024
441fc5b
components: Begin work on login form
jareddantis May 4, 2024
57015bf
common: Create regular button component
jareddantis May 5, 2024
e671d43
Implement login/logout
jareddantis May 5, 2024
76bbad2
LoginForm: Focus email input on show
jareddantis May 5, 2024
35a0094
LoginForm: Submit details on enter
jareddantis May 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .browserslistrc

This file was deleted.

33 changes: 33 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo

test-results/
playwright-report/
25 changes: 25 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
overrides: [
{
files: [
'e2e/**/*.{test,spec}.{js,ts,jsx,tsx}'
],
'extends': [
'plugin:playwright/recommended'
]
}
],
parserOptions: {
ecmaVersion: 'latest'
}
}
33 changes: 21 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
**/.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Dev server certificates
ssl/
*.tsbuildinfo

test-results/
playwright-report/
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
repos:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v8.56.0' # Use the sha / tag you want to point at
hooks:
- id: eslint
types: [file]
args: ['.', '--fix', '--config', '.eslintrc.cjs']
files: \.([jt]sx?|vue|[cm][jt]s)$
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.1.0'
hooks:
- id: prettier
args: ['--write', 'src/']
files: \.([jt]sx?|vue)$
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": true,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "es5"
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"Vue.volar",
"ms-playwright.playwright",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: install client dev build precommit

install:
npm install
pre-commit install

client:
src/api/generate.sh

dev:
npm run dev

build:
npm run build

precommit:
pre-commit run --all-files
90 changes: 37 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,64 @@
# [gwa-calc](https://calc.dantis.me/)
# gwa-calc

[![Netlify Status](https://api.netlify.com/api/v1/badges/73b0ee1f-01f1-4660-a201-54e2b5c1efe1/deploy-status)](https://app.netlify.com/sites/gwa-calc/deploys) [![dependencies](https://david-dm.org/jareddantis/gwa-calc/status.svg)](https://david-dm.org/jareddantis/gwa-calc) [![devDependencies](https://david-dm.org/jareddantis/gwa-calc/dev-status.svg)](https://david-dm.org/jareddantis/gwa-calc?type=dev) [![GitHub license](https://img.shields.io/github/license/jareddantis/gwa-calc.svg)](https://github.com/jareddantis/gwa-calc/blob/master/LICENSE.md)
This template should help get you started developing with Vue 3 in Vite.

A quick, responsive general weighted average calculator for the modern web.
Built with Vue.js and Typescript, by a student, for students.
## Recommended IDE Setup

## Features
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).

* GWA calculation
* Support for up to 5 sets of 20 subjects
* Grade transmutation and preset subjects for Philippine Science High School students
* Share subject sets and calculate with your friends through in-app QR codes
* Progressive Web App (can be installed offline)
## Type Support for `.vue` Imports in TS

## Building
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.

To build the calculator on your machine, you will need a working installation of [Node.js](https://nodejs.org/en/download/).
## Customize configuration

Once you have Node.js installed, clone the repository locally and install the required Node.js modules (the following steps are for Linux/macOS):
See [Vite Configuration Reference](https://vitejs.dev/config/).

```bash
git clone https://github.com/jareddantis/gwa-calc.git
cd gwa-calc
npm install -g @vue/cli
## Project Setup

```sh
npm install
```

You are now ready to make your changes to the files inside `src/`. Preview your changes in your browser:
### Compile and Hot-Reload for Development

```bash
npm run serve
```sh
npm run dev
```

When you're done, build the calculator:
### Type-Check, Compile and Minify for Production

```bash
```sh
npm run build
```

Then serve the resulting `dist` directory in your [SPA](https://en.wikipedia.org/wiki/Single-page_application) compliant web server of choice.

## Contributing

The calculator is automatically built and deployed with Netlify to make updating and testing easier.
### Run Unit Tests with [Vitest](https://vitest.dev/)

If you have a suggestion for the calculator, you can open an issue from the tab above or make a pull request on this repository if you have some code to share!
```sh
npm run test:unit
```

## Credits
### Run End-to-End Tests with [Playwright](https://playwright.dev)

- [@eligrey/FileSaver.js](https://github.com/eligrey/FileSaver.js/)
- [@FortAwesome/Font-Awesome](https://github.com/FortAwesome/Font-Awesome)
- [@google/material-design-icons,](https://material.io) [/workbox](https://github.com/googlechrome/workbox)
- [@localForage](https://github.com/localForage/localForage)
- [@nimiq/qr-scanner](https://github.com/nimiq/qr-scanner)
- [@pieroxy/lz-string](https://github.com/pieroxy/lz-string)
- [@soldair/node-qrcode](https://github.com/soldair/node-qrcode)
- [@SortableJS](https://github.com/SortableJS/Sortable)
- [@vuejs](https://vuejs.org/)
- [@vuetifyjs](https://vuetifyjs.com)
```sh
# Install browsers for the first run
npx playwright install

## License
# When testing on CI, must build the project first
npm run build

# Runs the end-to-end tests
npm run test:e2e
# Runs the tests only on Chromium
npm run test:e2e -- --project=chromium
# Runs the tests of a specific file
npm run test:e2e -- tests/example.spec.ts
# Runs the tests in debug mode
npm run test:e2e -- --debug
```
gwa-calc: The quick, responsive GWA calculator for PSHS and college students.
Copyright (C) 2019-2020 Aurel Jared Dantis

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
### Lint with [ESLint](https://eslint.org/)

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
```sh
npm run lint
```
14 changes: 0 additions & 14 deletions babel.config.js

This file was deleted.

50 changes: 0 additions & 50 deletions config/vue.dev.js

This file was deleted.

Loading