Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
["@babel/preset-react", { "runtime": "automatic" }]
]
}
96 changes: 96 additions & 0 deletions .eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:cypress/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["prettier", "react", "react-hooks", "import"],
"rules": {
"no-restricted-globals": "off",
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"jsx-quotes": ["error", "prefer-double"],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"object-shorthand": ["warn", "always"],
"react/display-name": "warn",
"react/jsx-no-useless-fragment": [
"warn",
{
"allowExpressions": true
}
],
"react/prop-types": "warn",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/self-closing-comp": "warn",
"react/jsx-curly-brace-presence": [
"warn",
{
"props": "never",
"children": "ignore",
"propElementValues": "always"
}
],
"react-hooks/rules-of-hooks": "warn",
"react-hooks/exhaustive-deps": "warn",
"sort-imports": [
"error",
{
"ignoreCase": false,
"ignoreDeclarationSort": true
}
],
"import/order": [
1,
{
"groups": [
"external",
"builtin",
"internal",
"sibling",
"parent",
"index"
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"import/no-duplicates": "warn"
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"paths": ["**/src"],
"extensions": [".js", ".jsx"]
}
}
}
}
20 changes: 20 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: 'monthly'
groups:
jest:
patterns:
- 'jest*'
eslint:
patterns:
- 'eslint*'

- package-ecosystem: github-actions
directory: /
schedule:
interval: 'monthly'
groups:
artifact-actions:
patterns:
- 'actions/*-artifact*' # Upload/Download usually need to be updated together
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches: [master]
paths: 'src/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: './package-lock.json'
- run: npm ci
- run: npm run build --if-present
- name: Deploy
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 changes: 25 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
push:
branches: [master]
paths: 'src/**'
pull_request:
branches: [master]
paths: 'src/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
cache-dependency-path: './package-lock.json'
- run: npm ci
- run: npm run build --if-present
- run: npm run test
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
.idea/
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/dist

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

npm-debug.log*
yarn-debug.log*
yarn-error.log*
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"diffEditor.codeLens": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"editor.formatOnSave": true,
"eslint.format.enable": true,
"eslint.validate": ["javascript"],
"files.trimTrailingWhitespace": true,
"html.format.wrapAttributes": "force-aligned",
"html.format.indentInnerHtml": true,
"search.exclude": {
"**/node_modules": true,
"package-lock.json": true
}
}
104 changes: 95 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,104 @@
Read Me For Community Boards
=================
# Timer

This is a simple timer that counts UP!
A web-based timer application built with React and Vite. This timer counts UP and is designed for community boards, toastmaster speeches, and other timing needs.

## Features

- Simple countdown/count-up timer
- Clean, modern interface using Bootstrap
- DSEG digital font for authentic timer display
- Responsive design

## For Developers

Original Read Me Toastmaster Timer
=================
### Prerequisites

A web based timer for toastmaster speeches.
- Node.js (v16 or higher recommended)
- npm or yarn package manager

This is running live at [Toastmaster Timer](http://www.toastmastertimer.com) if you're interested in using it.
### Getting Started

If you want to improve it then feel free to fork and make pull requests.
1. **Clone the repository**

https://github.com/guyellis/toastmaster-timer
```bash
git clone https://github.com/mimiflynn/timer.git
cd timer
```

2. **Install dependencies**

```bash
npm install
```

3. **Start the development server**

```bash
npm run dev
# or
npm start
```

The app will be available at `http://localhost:5173`

4. **Build for production**

```bash
npm run build
```

The production-ready files will be in the `dist` directory.

5. **Preview the production build**

```bash
npm run preview
```

6. **Run tests**

```bash
npm test
```

7. **Lint the code**
```bash
npm run lint
```

### Project Structure

```
timer/
├── public/ # Static assets
├── src/
│ ├── components/ # React components
│ ├── lib/ # Utility functions
│ ├── styles/ # CSS files
│ ├── App.jsx # Main app component
│ └── main.jsx # Entry point
├── vite.config.js # Vite configuration
└── package.json # Project dependencies
```

### Technologies Used

- **React 18** - UI framework
- **Vite** - Build tool and dev server
- **Bootstrap 5** - CSS framework
- **Jest** - Testing framework
- **DSEG Font** - Digital display font

### Contributing

Feel free to fork this project and make pull requests. Contributions are welcome!

## Credits

Font: [DSEG](https://github.com/keshikan/DSEG)

Original project: [Toastmaster Timer](https://github.com/guyellis/toastmaster-timer) by Guy Ellis

## License

See [LICENSE](LICENSE) file for details.
Loading