Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bunx --no-install commitlint --edit "$1"
Comment thread
IvanGodinez21 marked this conversation as resolved.
7 changes: 7 additions & 0 deletions .husky/install.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import husky from 'husky';

if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0);
}

console.log(husky());
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lint-staged
Comment thread
IvanGodinez21 marked this conversation as resolved.
Empty file added .husky/pre-push
Empty file.
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"plugins": ["prettier-plugin-tailwindcss"],
"printWidth": 120
}
18 changes: 18 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"recommendations": [
// Required
"DavidAnson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"github.vscode-github-actions",
// Optional
"bradlc.vscode-tailwindcss",
"csstools.postcss",
"ms-azuretools.vscode-containers",
"ms-azuretools.vscode-docker",
"ms-edgedevtools.vscode-edge-devtools",
"ms-vscode-remote.remote-containers",
"usernamehw.errorlens",
"yoavbls.pretty-ts-errors"
]
}
33 changes: 24 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
"cwd": "${workspaceFolder}",
"name": "Server",
"request": "launch",
"runtimeArgs": ["run", "dev"],
"runtimeExecutable": "npm",
"skipFiles": ["<node_internals>/**"],
"runtimeArgs": [
"run",
"dev"
],
"runtimeExecutable": "bun",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
{
Expand All @@ -21,16 +26,21 @@
},
"name": "Full stack (Edge client)",
"request": "launch",
"runtimeArgs": ["run", "dev"],
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"dev"
],
"runtimeExecutable": "bun",
"serverReadyAction": {
"action": "debugWithEdge",
"killOnServerStop": true,
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"webRoot": "${workspaceFolder}"
},
"skipFiles": ["<node_internals>/**"],
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
},
{
Expand All @@ -42,16 +52,21 @@
},
"name": "Full stack (Chrome client)",
"request": "launch",
"runtimeArgs": ["run", "dev"],
"runtimeExecutable": "npm",
"runtimeArgs": [
"run",
"dev"
],
"runtimeExecutable": "bun",
"serverReadyAction": {
"action": "debugWithChrome",
"killOnServerStop": true,
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
"webRoot": "${workspaceFolder}"
},
"skipFiles": ["<node_internals>/**"],
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
}
]
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"npm.packageManager": "bun"
}
420 changes: 332 additions & 88 deletions bun.lock

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[test]
root = "."
coverage = true
coverageDir = "coverage"
coverageReporter = ["text", "lcov"]
coverageThreshold = { line = 0.8, statement = 0.8, function = 0.8 }
pathIgnorePatterns = ["docs/**", "**/__mocks__/**"]
coveragePathIgnorePatterns = [
"docs/**",
"**/__mocks__/**",
"tests/**",
"**/*.test.*",
"**/*.spec.*",
"src/**/*.tsx"
]

[test.reporter]
junit = "junit.xml"
1 change: 1 addition & 0 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default { extends: ['@commitlint/config-conventional'] };
25 changes: 0 additions & 25 deletions eslint.config.mjs

This file was deleted.

26 changes: 26 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig, globalIgnores } from 'eslint/config';
import nextVitals from 'eslint-config-next/core-web-vitals';
import nextTs from 'eslint-config-next/typescript';

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Temporarily fix, check: https://github.com/vercel/next.js/issues/89764#issuecomment-3928272828
{
settings: {
react: {
version: '19',
},
},
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
'.next/**',
'out/**',
'build/**',
'next-env.d.ts',
]),
]);

export default eslintConfig;
File renamed without changes.
7 changes: 7 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const lintStagedConfig = {
'*.{ts,tsx}': ['eslint --fix .', 'prettier --write'],
'*.test.{ts,tsx}': ['bun test'],
'*.{json,css,md}': ['prettier --write'],
};

export default lintStagedConfig;
3 changes: 2 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { NextConfig } from "next";
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {
/* config options here */
reactCompiler: true,
};

export default nextConfig;
66 changes: 54 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
{
"name": "zero-day-app",
"version": "0.1.0",
"private": true,
"name": "zeroday",
"version": "1.0.0",
"description": "ZeroDay is a web app that tracks the number of days since the last incident, accident, or failure, helping teams maintain safety and encourage responsible habits.",
"keywords": [],
"author": {
"name": "Jesús Iván Godínez Martínez",
"email": "ivano.godinez@gmail.com"
},
"contributors": [
{
"name": "Juan Pablo Jiménez Covarrubias",
"email": "pablo.jimenezdev@gmail.com"
},
{
"name": "Cristian C. Giraldo",
"email": "cc.giraldo11@gmail.com"
}
],
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint",
"commit": "commit",
"dev": "next dev",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"lint-staged": "lint-staged",
"prepare": "bun .husky/install.ts",
"prettier": "prettier ./src --write",
"prisma:generate": "prisma generate",
"prisma:migrate": "prisma migrate dev"
"prisma:migrate": "prisma migrate dev",
"start": "next start",
"test": "bun test",
"test:cov": "bun test --coverage"
},
"engineStrict": true,
"engines": {
"bun": "1.x"
},
"dependencies": {
"@emotion/react": "^11.14.0",
Expand All @@ -17,21 +43,37 @@
"@mui/icons-material": "^7.3.9",
"@mui/material": "^7.3.9",
"@prisma/client": "^7.6.0",
"next": "16.2.2",
"next": "^16.2.2",
"prettier-plugin-tailwindcss": "^0.7.2",
"prisma": "^7.6.0",
"react": "19.2.4",
"react-dom": "19.2.4"
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@commitlint/cli": "^20.5.0",
"@commitlint/config-conventional": "^20.5.0",
"@commitlint/prompt-cli": "^20.5.0",
"@eslint/eslintrc": "^3.3.5",
"@tailwindcss/postcss": "^4.2.2",
"@types/bun": "^1.3.11",
"@types/node": "^25.5.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"babel-plugin-react-compiler": "1.0.0",
"eslint": "^10.2.0",
"eslint-config-next": "16.2.2",
"eslint-config-next": "^16.2.2",
"husky": "^9.1.7",
"lint-staged": "^16.4.0",
Comment thread
IvanGodinez21 marked this conversation as resolved.
"prettier": "^3.8.1",
"tailwindcss": "^4.2.2",
"typescript": "^6.0.2"
}
},
"ignoreScripts": [
"sharp",
"unrs-resolver"
],
"trustedDependencies": [
"sharp",
"unrs-resolver"
]
}
5 changes: 0 additions & 5 deletions postcss.config.mjs

This file was deleted.

7 changes: 7 additions & 0 deletions postcss.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = {
plugins: {
'@tailwindcss/postcss': {},
},
};

export default config;
Comment thread
IvanGodinez21 marked this conversation as resolved.
20 changes: 7 additions & 13 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import "./globals.css";
import './globals.css';

export const metadata = {
title: "ZeroDay - Incident Tracker",
description: "Track incidents and count days without issues.",
title: 'ZeroDay - Incident Tracker',
description: 'Track incidents and count days without issues.',
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body className="bg-gray-100 text-gray-900 min-h-screen flex flex-col">
<header className="bg-blue-600 text-white p-4 flex justify-between items-center shadow">
<body className="flex min-h-screen flex-col bg-gray-100 text-gray-900">
<header className="flex items-center justify-between bg-blue-600 p-4 text-white shadow">
<h1 className="text-xl font-bold">Incident Tracker</h1>
</header>
<main className="flex-1 p-6">{children}</main>
<footer className="p-4 text-center text-sm text-gray-500">
ZeroDay - Incident Tracker ©
</footer>
<footer className="p-4 text-center text-sm text-gray-500">ZeroDay - Incident Tracker ©</footer>
</body>
</html>
);
Expand Down
8 changes: 4 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export default function HomePage() {
};

return (
<div className='max-w-2xl mx-auto'>
<div className="mx-auto max-w-2xl">
<IncidentForm onAddIncident={handleAddIncident} />
<h2 className='text-lg font-semibold mt-8 mb-4 text-white'>Incident History</h2>
<div className='space-y-3'>
<h2 className="mt-8 mb-4 text-lg font-semibold text-white">Incident History</h2>
<div className="space-y-3">
{incidents.length === 0 ? (
<p className='text-gray-500'>No incidents recorded.</p>
<p className="text-gray-500">No incidents recorded.</p>
) : (
incidents.map((incident) => <Counter key={incident.id} props={incident} />)
)}
Expand Down
Loading
Loading