Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1291268
fix: fixes filter conditions
wescosta Apr 10, 2025
cf048cc
fix: fixes task deletions
wescosta Apr 10, 2025
eea8ef7
refactor: improved overall styling and structure
wescosta Apr 10, 2025
2659ec6
refactor: add TypeScript types
wescosta Apr 10, 2025
fc0470b
refactor: refactored code structure for bertter readability
wescosta Apr 10, 2025
96c86eb
refactor: implements basic tasks state management with zustand
wescosta Apr 10, 2025
c3b28c9
refactor: update imports to use 'import type' for TypeScript types
wescosta Apr 10, 2025
5d93d6d
feat: adds database persistence
wescosta Apr 10, 2025
8394ef9
feat: implement confirmation dialog for delete confirmation
wescosta Apr 10, 2025
3e191e7
feat: added toast notifications for task deletion
wescosta Apr 10, 2025
6661332
feat: enhanced UI better responsiveness
wescosta Apr 10, 2025
7e45432
feat: makes form controls stick and always visibile while scrolling
wescosta Apr 10, 2025
daedb19
feat(Button): added submit button disabled state
wescosta Apr 11, 2025
61fa9f0
feat: update tasks list order to descending
wescosta Apr 11, 2025
9b1e84d
chore: configures and adds unit tests
wescosta Apr 11, 2025
4e989e6
refactor: structures it as a monorepo, adds more tests, configures gi…
wescosta Apr 12, 2025
ebaf211
chore: fixes vercel deployment
wescosta Apr 12, 2025
53197a1
chore: add playwright browser installation
wescosta Apr 12, 2025
eff9f7f
chore: fixes github action
wescosta Apr 12, 2025
91c0847
chore: splits github action build and test jobs into smaller ones to …
wescosta Apr 13, 2025
e4861d1
chore: fixes branch name
wescosta Apr 13, 2025
ee5f065
chore: temporarily disables vitest
wescosta Apr 13, 2025
df6f74c
chore: adds vercel config
wescosta Apr 13, 2025
dc69ec2
chore: updates vercel config
wescosta Apr 13, 2025
9bb4a9d
chore: updates readme
wescosta Apr 13, 2025
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
53 changes: 53 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react",
"react-hooks",
"@typescript-eslint",
"import",
"prettier"
],
"rules": {
"react/react-in-jsx-scope": "off",
"prettier/prettier": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"newlines-between": "always",
"alphabetize": { "order": "asc", "caseInsensitive": true }
}
]
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
},
"ignorePatterns": ["dist", "node_modules", "**/*.d.ts"]
}
78 changes: 78 additions & 0 deletions .github/workflows/deploy-to-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Deploy to Vercel

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps chromium

- name: Run linting
run: pnpm lint

- name: Build Design System package
if: ${{ success() }}
run: pnpm build:ds

- name: Run Design System tests
if: ${{ success() }}
run: pnpm --filter "@lateral/design-system" test

- name: Build Task Manager app
if: ${{ success() }}
run: pnpm --filter "@lateral/task-manager" build

- name: Run Task Manager tests
# if: ${{ success() }}
# Temporarily disabled due to Error: Vitest failed to find the runner. This is a bug in Vitest. Please, open an issue with reproduction.
if: false
run: pnpm --filter "@lateral/task-manager" test

- name: Deploy to Vercel
# if: ${{ success() }}
# Temporarily disabled because this project is configured to use the Vercel GitHub integration for deployment
if: false
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./packages/task-manager
vercel-args: '--prod'
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
dist
dist
.env
coverage
**/__screenshots__
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 100,
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,43 +57,44 @@ The Task Manager app includes the following core features:
- **Deleting Tasks:** Remove tasks from the list.
- **Filtering Tasks:** Filter tasks by status (All, Completed, Pending).

### Issues to Address
### Issues to Addressed

While reviewing the project, please identify and resolve the following issues:
While reviewing the project, I have identified and resolved the following issues:

1. **Task Filter Bug:**

- The filter functionality is not working as expected. Changing the filter does not update the task list correctly.
- The filter functionality is now working as expected. Changing the filter updates the task list correctly.

2. **Task Deletion Issue:**

- Deleting a task does not immediately update the UI, causing a delay or inconsistency in the displayed task list.
- Deleting a task immediately updates the UI. A confirmation dialog has been added as well.

3. **Styling Inconsistencies:**

- Some UI elements are not using Tailwind CSS classes consistently. Ensure the layout, spacing, and colors align with the provided design guidelines.
- UI elements are using Tailwind CSS classes consistently. Layout, spacing, and colors have been updated to align with the provided design guidelines.

4. **TypeScript Warnings/Errors:**

- Several components may have missing or incorrect type definitions. Address all TypeScript warnings to ensure robust type safety.
- Type definitions have been added. All TypeScript warnings have been addressed to ensure robust type safety.

5. **Code Refactoring:**
- The current code structure has redundant logic and lacks modularity. Refactor the code to improve readability and maintainability.
- The code structure has been refactored using a monorepo to improve readability and maintainability.

### Optional Enhancements

If time permits, consider implementing one or more of the following:

- **Persistence:**
- Implement functionality to save and retrieve tasks from local storage or a remote API, ensuring that the task list persists across page reloads.
- Implemented functionality to save and retrieve tasks from a remote API using Supabse, ensuring that the task list persists across page reloads.
- **Improved UI/UX:**
- Enhance the user interface with additional styling improvements or animations to improve user experience.
- Implement a confirmation dialog when deleting a task.
- Enhanced the user interface with additional styling improvements improve user experience, like a sticky form. So while the user scrolls down, he/she can still see the add form. This is specially usefeull on mobile.
- Implemented a confirmation dialog when deleting a task.
- A mobile first, responsive design has been implemented to improve user experience on mobile
- **Improved UI/UX:**
- Deploy the app
- Create a CI/CD pipeline that will automatically deploy/release the app when changes were made.
- The app has been depoyed to Vercel. You can access it on this link: https://react-simple-task-manager.vercel.app/
- A CI/CD pipeline has been created to automatically deploy/release the app when changes were made. (minor issues have to be address later)
- **Unit Testing:**
- Write tests for key components using your preferred testing framework (e.g., Jest, React Testing Library).
- Unit tests for key components have been added using Vitest

## Submission Instructions

Expand Down
80 changes: 80 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';

export default [
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.{js,jsx,ts,tsx}'],
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...reactPlugin.configs.recommended.rules,
'react/react-in-jsx-scope': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
},
{
files: ['**/*.{ts,tsx}'],
ignores: ['**/*.config.ts', '**/vitest.setup.js', '**/*.spec.ts', '**/*.spec.tsx'],
languageOptions: {
ecmaVersion: 2021,
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
project: ['./packages/*/tsconfig.json'],
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
'react': reactPlugin,
'react-hooks': reactHooksPlugin,
'import': importPlugin,
'prettier': prettierPlugin,
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'react/react-in-jsx-scope': 'off',
'prettier/prettier': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
},
},
prettierConfig,
{
ignores: ['**/dist/**', '**/node_modules/**', '**/*.d.ts'],
},
];
51 changes: 35 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,43 @@
{
"name": "task-manager",
"version": "0.0.1",
"name": "lateral-monorepo",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"dev": "pnpm --filter @lateral/task-manager dev",
"build": "pnpm --filter \"*\" build",
"build:ds": "pnpm --filter @lateral/design-system build",
"build:app": "pnpm --filter @lateral/task-manager build",
"preview": "pnpm --filter @lateral/task-manager preview",
"test": "pnpm --filter \"*\" test",
"test:watch": "pnpm --filter \"*\" test:watch",
"lint": "eslint \"packages/**/*.{ts,tsx}\" --max-warnings=0",
"lint:fix": "eslint \"packages/**/*.{ts,tsx}\" --fix",
"format": "prettier --write \"packages/**/*.{ts,tsx,json}\""
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@eslint/js": "^9.24.0",
"@typescript-eslint/eslint-plugin": "^8.29.1",
"@typescript-eslint/parser": "^8.29.1",
"@vitejs/plugin-react": "^3.1.0",
"@vitest/browser": "^3.1.1",
"eslint": "^9.24.0",
"eslint-config-prettier": "^10.1.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.6",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"jsdom": "^24.0.0",
"path": "^0.12.7",
"playwright": "^1.51.1",
"playwright-core": "^1.51.1",
"prettier": "^3.5.3",
"typescript": "^4.6.0",
"vite": "^4.0.0",
"@vitejs/plugin-react": "^3.0.0",
"tailwindcss": "^3.0.0",
"postcss": "^8.0.0",
"autoprefixer": "^10.0.0"
"typescript-eslint": "^8.29.1",
"vite": "^4.5.0",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.1.1",
"vitest-browser-react": "^0.1.1",
"vitest-dom": "^0.1.1"
}
}
34 changes: 34 additions & 0 deletions packages/design-system/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Design System

Atomic design components that can be reused accross multiple projects.

## Build

To build it simply run `pnpm build` *from the root folder* which will build alls packages or `pnpm build:ds` to build this package only.

## Test
You can run the test from the root folder using the following command:

```bash
pnpm --filter @lateral/design-system test
```

You can also watch for changes:

```bash
pnpm --filter @lateral/design-system test:watch
```

Alternativelly, you can also `cd` into this folder and run `pnpm test` or `pnpm test:watch`:

```bash
cd packages/design-system
```

```bash
pnpm test
```

```bash
pnpm test:watch
```
Loading