Skip to content
Open
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,11 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.

![mainpage](./docs/screenshots/homepage.png)

![edit](./docs/screenshots/edit.png)

![add](./docs/screenshots/addtask.png)

![delete](./docs/screenshots/delete.png)
9 changes: 9 additions & 0 deletions api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ITask } from "./types/tasks";

const baseUrl = "http://localhost:3001/tasks";

export const getAllTodos = async (): Promise<ITask[]> => {
const res = await fetch(baseUrl, { cache: "no-store" });
if (!res.ok) throw new Error(`Failed to fetch: ${res.status}`);
return (await res.json()) as ITask[];
};
26 changes: 0 additions & 26 deletions app/globals.css

This file was deleted.

65 changes: 0 additions & 65 deletions app/page.tsx

This file was deleted.

22 changes: 22 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/app/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"iconLibrary": "lucide",
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {}
}
24 changes: 24 additions & 0 deletions data/todos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"tasks": [
{
"id": "5786",
"text": "go to gym",
"completed": false
},
{
"id": "43c1",
"text": "buy lunch",
"completed": false
},
{
"id": "662d1bae-4480-4981-9c06-1459908fca97",
"text": "go to school",
"completed": false
},
{
"id": "37d19d5f-0aed-4e23-aa73-e111ab96ddd1",
"text": "ea",
"completed": false
}
]
}
1 change: 1 addition & 0 deletions docs/screenshots/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added docs/screenshots/addtask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/edit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/homepage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 22 additions & 15 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
]),
]);
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
ignores: [
"node_modules/**",
".next/**",
"out/**",
"build/**",
"next-env.d.ts",
],
},
];

export default eslintConfig;
Loading