{"id":24797264,"url":"https://github.com/aallali/todo-app-tdd","last_synced_at":"2025-07-15T22:05:15.171Z","repository":{"id":240231218,"uuid":"801040262","full_name":"aallali/TODO-APP-TDD","owner":"aallali","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-17T11:21:53.000Z","size":6489,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T20:45:11.826Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aallali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-15T13:30:29.000Z","updated_at":"2024-05-22T23:32:58.000Z","dependencies_parsed_at":"2024-05-17T13:49:52.422Z","dependency_job_id":null,"html_url":"https://github.com/aallali/TODO-APP-TDD","commit_stats":null,"previous_names":["aallali/technical-test-c4","aallali/todo-app-tdd"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aallali/TODO-APP-TDD","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aallali%2FTODO-APP-TDD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aallali%2FTODO-APP-TDD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aallali%2FTODO-APP-TDD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aallali%2FTODO-APP-TDD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aallali","download_url":"https://codeload.github.com/aallali/TODO-APP-TDD/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aallali%2FTODO-APP-TDD/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265463903,"owners_count":23770315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T01:19:04.761Z","updated_at":"2025-07-15T22:05:14.546Z","avatar_url":"https://github.com/aallali.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# technical-test-c4\n\n## Objective\nCreate a CRUD application for task management that includes user authentication and offers a visually\nappealing user interface. Each task should have attributes like title, description, and status (e.g., pending,\ncompleted).\n\n## Installation:\n- it is recommended to use latest nodejs stable version\n- during the development of this app, i used `node v20.13.1`\n- use the frozen lockfile to install the exact version\n```shell\ngit clone https://github.com/aallali/technical-test-c4\ncd technical-test-c4\n## install and run api\ncd server \nyarn ci\nyarn start\n## install and run ui\ncd ../ui\nyarn ci\nyarn start\n```\n## Tech Stack\n- **Ui** : `React.Js`, `TypeScript`, `Tailwind`, `Zustand`\n- **Server**: `Node.Js`, `TypeScript`, `Express.Js`, `Mongoose`\n- **Db**: `MongoDb`\n---\n\n## Screenshots:\n\u003cimg src=\"./ressources/login.png\" width=\"600\"/\u003e\n\u003cimg src=\"./ressources/register.png\" width=\"600\"/\u003e\n\u003cimg src=\"./ressources/emptyTasks.png\" width=\"600\"/\u003e\n\u003cimg src=\"./ressources/createTaskError.png\" width=\"600\"/\u003e\n\u003cimg src=\"./ressources/tasks.png\" width=\"600\"/\u003e\n\n- Api unit tests\n\n\u003cimg src=\"./ressources/test.png\" width=\"600\"/\u003e\n\n\n## UI\n### Folder structure\n```\nsrc\n├── App.tsx\n├── index.css\n├── index.tsx\n├── modules\n│   ├── auth\n│   │   ├── assets\n│   │   │   └── lock.png\n│   │   ├── auth.api.ts\n│   │   ├── auth.config.ts\n│   │   ├── auth.store.ts\n│   │   ├── auth.validator.ts\n│   │   └── Index.tsx\n│   └── tasks\n│       ├── index.tsx\n│       ├── task.api.ts\n│       └── task.validator.ts\n├── react-app-env.d.ts\n├── setupTests.ts\n└── utils\n    └── axios.ts\n\n5 directories, 15 files\n```\n### Test :\n- **command: `yarn test`**\n\n\u003cimg src=\"./ressources/test-auth-ui.png\"  /\u003e\n\n### Todo:\n- [x] : setup skeleton\n- [x] : wait until server is done...\n- [x] : create login\n- [x] : test login component\n- [x] : create new task input component\n- [x] : update task [title, description, status] functionlity\n- [x] : delete task \n- [x] : fetch all tasks\n- [x] : tasks filter on browser\n- [ ] : write tests for remaining components\n- [x] : add some screenshots to readme\n---\n## Server\n### Test Coverage:\n- **command: `yarn test:coverage`**\n\n\u003cimg src=\"./ressources/test-coverage.png\"  /\u003e\n\n### Models:\n- **User Model**:\n```js\nconst UserSchema: Schema = new Schema({\n  username: { type: String, required: true, unique: true },\n  password: { type: String, required: true },\n});\n```\n- **Task Model**:\n```js\nconst TaskSchema: Schema = new Schema({\n    title: { type: String, required: true },\n    description: { type: String },\n    status: {\n        type: String,\n        enum: ['pending', 'done'],\n        default: 'pending'\n    },\n    userId: { type: Types.ObjectId, ref: 'User', required: true },\n\n}, {\n    timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' }\n});\n```\n### Routes:\n```txt\nPOST    : /api/v1/auth/signin   : login\nPOST    : /api/v1/auth/signup   : register\nGET     : /api/v1/auth/whoami   : fetch info of current authorized user\n\nPOST    : /api/v1/task/         : create new task\nPATCH   : /api/v1/task/         : update task\nDELETE  : /api/v1/task/{taskId} : delete a task\nGET     : /api/v1/task/         : fetch all tasks\n```\n\n### Api Testing Collection\n\n- please use [this collection](./postmanCollection/requestsTests.postman_collection.json)\n\n### Folder structure\n```\n├── nodemon.json\n├── package.json\n├── src\n│   ├── controllers\n│   │   ├── auth.controller.ts\n│   │   └── task.controller.ts\n│   ├── database\n│   │   ├── config.ts\n│   │   └── drivers\n│   │       ├── task.driver.ts\n│   │       └── user.driver.ts\n│   ├── index.ts\n│   ├── middleware\n│   │   ├── authentication.middelware.ts\n│   │   ├── index.ts\n│   │   └── validateRequest.middleware.ts\n│   ├── models\n│   │   ├── task.ts\n│   │   └── user.ts\n│   ├── routes\n│   │   ├── auth.route.ts\n│   │   ├── index.ts\n│   │   └── task.route.ts\n│   ├── types\n│   │   └── index.ts\n│   └── validators\n│       ├── task.validator.ts\n│       └── user.validator.ts\n├── tests\n│   ├── auth.middelware.test.ts\n│   ├── auth.signin.controller.test.ts\n│   ├── auth.signup.controller.test.ts\n│   ├── health.test.ts\n│   ├── task.add.controller.test.ts\n│   ├── task.delete.controller.test.ts\n│   ├── task.read.controller.test.ts\n│   └── task.update.controller.test.ts\n├── tsconfig.json\n└── yarn.lock\n```\n### Todo:\n- [x] : setup skeleton\n- [x] : setup jest for Unite test\n- [x] : integrate mongoose\n- [x] : setup DB drivers\n- [x] : setup jwt auth system (user+pass, **`no email`**)\n- [x] : setup auth middleware and test it\n- [x] : create units tests for the auth flow\n- follow TDD approach\n- [x] service: **add task**\n    - [x] create unit test\n    - [x] create the service\n- [x] - service: **update task** \n    - [x] create unit test\n    - [x] create the service\n- [x] - service: **delete task**\n    - [x] create unit test\n    - [x] create the service\n- [x] - service: **read tasks** \n    - [x] create unit test\n    - [x] create the service\n- [x] - document the roadmap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faallali%2Ftodo-app-tdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faallali%2Ftodo-app-tdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faallali%2Ftodo-app-tdd/lists"}