├── .Prettierrc ├── .eslintrc.json ├── .gitignore ├── README.md ├── app ├── (routes) │ └── about │ │ └── page.tsx ├── Components │ ├── Course │ │ ├── CourseItem │ │ │ └── index.tsx │ │ ├── CourseList │ │ │ └── index.tsx │ │ └── index.tsx │ └── Header │ │ └── index.tsx ├── Hook │ └── useGetCourse │ │ └── index.tsx ├── Model │ └── Coures.tsx ├── StateManagement │ ├── Base │ │ └── index.tsx │ ├── Provider │ │ └── index.tsx │ └── Service │ │ └── Coures.tsx ├── favicon.ico ├── globals.css ├── layout.tsx └── page.tsx ├── db.json ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── next.svg └── vercel.svg ├── tailwind.config.ts └── tsconfig.json /.Prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "always", 3 | "singleQuote": true, 4 | "trailingComma": "es5" 5 | } 6 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # local env files 28 | .env*.local 29 | 30 | # vercel 31 | .vercel 32 | 33 | # typescript 34 | *.tsbuildinfo 35 | next-env.d.ts 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### 1.npm install 2 | ### 2.npm run db 3 | ### 3.npm run dev 4 | 5 | 6 | # Note : Cache Data With React Query Pages 7 | -------------------------------------------------------------------------------- /app/(routes)/about/page.tsx: -------------------------------------------------------------------------------- 1 | const Page = () => { 2 | return <>About Page; 3 | }; 4 | 5 | export default Page; 6 | -------------------------------------------------------------------------------- /app/Components/Course/CourseItem/index.tsx: -------------------------------------------------------------------------------- 1 | import { CourseState } from '@/app/Model/Coures'; 2 | 3 | interface CourseItemProps { 4 | course: CourseState; 5 | } 6 | const CourseItem: React.FC = ({ course }) => { 7 | return ( 8 |
9 |

{course.course_name}

10 |

{course.instructor}

11 |

{course.description.slice(0, 30)}

12 |

Duration: {course.duration}

13 |

${course.price}

14 | 17 |
18 | ); 19 | }; 20 | 21 | export default CourseItem; 22 | -------------------------------------------------------------------------------- /app/Components/Course/CourseList/index.tsx: -------------------------------------------------------------------------------- 1 | import { CourseState } from '@/app/Model/Coures'; 2 | import CourseItem from '../CourseItem'; 3 | 4 | interface CourseListProps { 5 | courses: CourseState[]; 6 | } 7 | 8 | const CourseList: React.FC = ({ courses }) => { 9 | const renderCourseItems = () => { 10 | return courses.map((course) => { 11 | return ; 12 | }); 13 | }; 14 | return ( 15 |
16 | {renderCourseItems()} 17 |
18 | ); 19 | }; 20 | 21 | export default CourseList; 22 | -------------------------------------------------------------------------------- /app/Components/Course/index.tsx: -------------------------------------------------------------------------------- 1 | import { CourseState } from '@/app/Model/Coures'; 2 | import CourseList from './CourseList'; 3 | import React from 'react'; 4 | 5 | // Define the props interface for the Course component 6 | interface CourseProps { 7 | courses: CourseState[]; 8 | } 9 | 10 | // Course component is a functional component receiving 'courses' as a prop 11 | const Course: React.FC = ({ courses }) => { 12 | return ( 13 |
14 | {/* Title for the list of available courses */} 15 |

Available courses

16 | 17 | {/* Render the CourseList component and pass the 'courses' prop */} 18 | 19 |
20 | ); 21 | }; 22 | 23 | export default Course; 24 | -------------------------------------------------------------------------------- /app/Components/Header/index.tsx: -------------------------------------------------------------------------------- 1 | import Link from 'next/link'; 2 | 3 | const Header = () => { 4 | return ( 5 |
6 |
7 | 8 | home 9 | 10 | 14 | about 15 | 16 |
17 |
18 | ); 19 | }; 20 | 21 | export default Header; 22 | -------------------------------------------------------------------------------- /app/Hook/useGetCourse/index.tsx: -------------------------------------------------------------------------------- 1 | import { asyncGetCourse } from '@/app/StateManagement/Service/Coures'; 2 | import { useQuery } from '@tanstack/react-query'; 3 | 4 | const useGetProduct = () => { 5 | const queryKey = ['course']; 6 | const { data, isLoading, isError } = useQuery(queryKey, asyncGetCourse); 7 | return { data, isError, isLoading }; 8 | }; 9 | 10 | export default useGetProduct; 11 | -------------------------------------------------------------------------------- /app/Model/Coures.tsx: -------------------------------------------------------------------------------- 1 | export interface CourseState { 2 | course_id: number; 3 | course_name: string; 4 | instructor: string; 5 | description: string; 6 | duration: string; 7 | price: number; 8 | } 9 | -------------------------------------------------------------------------------- /app/StateManagement/Base/index.tsx: -------------------------------------------------------------------------------- 1 | import axios from 'axios'; 2 | 3 | const BaseApi = axios.create({ 4 | baseURL: 'http://localhost:5007', 5 | }); 6 | 7 | export default BaseApi; 8 | -------------------------------------------------------------------------------- /app/StateManagement/Provider/index.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | import { QueryClientProvider } from '@tanstack/react-query'; 3 | import { PropsWithChildren } from 'react'; 4 | import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; 5 | import { QueryClient } from '@tanstack/react-query'; 6 | import { useState } from 'react'; 7 | 8 | // Options 9 | const queryClientOptions = { 10 | defaultOptions: { 11 | // 5 * 1000 12 | queries: { 13 | staleTime: 60000, 14 | }, 15 | }, 16 | }; 17 | 18 | const ReactQueryPvorider: React.FC = ({ children }) => { 19 | // State 20 | const [queryClientStore] = useState( 21 | () => new QueryClient(queryClientOptions) 22 | ); 23 | // Return Provider 24 | return ( 25 | 26 | {children} 27 | 28 | 29 | ); 30 | }; 31 | 32 | export default ReactQueryPvorider; 33 | -------------------------------------------------------------------------------- /app/StateManagement/Service/Coures.tsx: -------------------------------------------------------------------------------- 1 | import BaseApi from '../Base'; 2 | import { CourseState } from '@/app/Model/Coures'; 3 | const asyncGetCourse = async () => { 4 | try { 5 | const response = await BaseApi.get('/course'); 6 | return response.data; 7 | } catch (error: any) { 8 | throw new Error(error.message); 9 | } 10 | }; 11 | 12 | export { asyncGetCourse }; 13 | -------------------------------------------------------------------------------- /app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alireza-WebDeveloper/nextjs14-reactquery/1118b96ad45f2d1c48a682ca04467baf6d0f0acb/app/favicon.ico -------------------------------------------------------------------------------- /app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer base { 6 | a { 7 | text-decoration: none !important; 8 | color: inherit !important; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/layout.tsx: -------------------------------------------------------------------------------- 1 | import './globals.css'; 2 | import type { Metadata } from 'next'; 3 | import { Inter } from 'next/font/google'; 4 | import ReactQueryPvorider from './StateManagement/Provider'; 5 | import Header from './Components/Header'; 6 | 7 | const inter = Inter({ subsets: ['latin'] }); 8 | 9 | export const metadata: Metadata = { 10 | title: 'Create Next App', 11 | description: 'Generated by create next app', 12 | }; 13 | 14 | export default function RootLayout({ 15 | children, 16 | }: { 17 | children: React.ReactNode; 18 | }) { 19 | return ( 20 | 21 | 22 | 23 |
24 | {children} 25 | 26 | 27 | 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /app/page.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import useGetProduct from './Hook/useGetCourse'; 4 | import Course from './Components/Course'; 5 | 6 | const Home = () => { 7 | const { data: courses, isError, isLoading } = useGetProduct(); 8 | if (isLoading) return <>loading...; 9 | return <>{courses && }; 10 | }; 11 | 12 | export default Home; 13 | -------------------------------------------------------------------------------- /db.json: -------------------------------------------------------------------------------- 1 | { 2 | "course": [ 3 | { 4 | "course_id": 1, 5 | "course_name": "Introduction to Programming", 6 | "instructor": "John Smith", 7 | "description": "Learn the fundamentals of programming with this introductory course.", 8 | "duration": "8 weeks", 9 | "price": 49.99 10 | }, 11 | { 12 | "course_id": 2, 13 | "course_name": "Web Development Bootcamp", 14 | "instructor": "Sarah Johnson", 15 | "description": "Become a full-stack web developer in this intensive bootcamp.", 16 | "duration": "12 weeks", 17 | "price": 199.99 18 | }, 19 | { 20 | "course_id": 3, 21 | "course_name": "Data Science Essentials", 22 | "instructor": "David Miller", 23 | "description": "Explore the world of data science and machine learning.", 24 | "duration": "10 weeks", 25 | "price": 79.99 26 | }, 27 | { 28 | "course_id": 4, 29 | "course_name": "Graphic Design Fundamentals", 30 | "instructor": "Emily Brown", 31 | "description": "Master the basics of graphic design and create stunning visuals.", 32 | "duration": "6 weeks", 33 | "price": 59.99 34 | }, 35 | { 36 | "course_id": 5, 37 | "course_name": "Digital Marketing Mastery", 38 | "instructor": "Michael Davis", 39 | "description": "Learn how to market products and services online effectively.", 40 | "duration": "8 weeks", 41 | "price": 69.99 42 | }, 43 | { 44 | "course_id": 6, 45 | "course_name": "Introduction to Artificial Intelligence", 46 | "instructor": "Linda White", 47 | "description": "Discover the principles of AI and its applications.", 48 | "duration": "9 weeks", 49 | "price": 89.99 50 | }, 51 | { 52 | "course_id": 7, 53 | "course_name": "Mobile App Development", 54 | "instructor": "Kevin Turner", 55 | "description": "Build mobile apps for iOS and Android platforms.", 56 | "duration": "10 weeks", 57 | "price": 119.99 58 | }, 59 | { 60 | "course_id": 8, 61 | "course_name": "Business Finance for Beginners", 62 | "instructor": "Amy Lee", 63 | "description": "Learn the basics of finance and financial management.", 64 | "duration": "7 weeks", 65 | "price": 49.99 66 | }, 67 | { 68 | "course_id": 9, 69 | "course_name": "Photography Fundamentals", 70 | "instructor": "Mark Anderson", 71 | "description": "Capture stunning photos with your camera or smartphone.", 72 | "duration": "6 weeks", 73 | "price": 59.99 74 | }, 75 | { 76 | "course_id": 10, 77 | "course_name": "Entrepreneurship 101", 78 | "instructor": "Jennifer Carter", 79 | "description": "Start and grow your own business with expert guidance.", 80 | "duration": "8 weeks", 81 | "price": 79.99 82 | }, 83 | { 84 | "course_id": 11, 85 | "course_name": "Advanced Excel Techniques", 86 | "instructor": "Robert Green", 87 | "description": "Master advanced Excel functions and data analysis.", 88 | "duration": "6 weeks", 89 | "price": 69.99 90 | }, 91 | { 92 | "course_id": 12, 93 | "course_name": "Java Programming for Beginners", 94 | "instructor": "Daniel Wilson", 95 | "description": "Learn Java programming from scratch.", 96 | "duration": "9 weeks", 97 | "price": 79.99 98 | }, 99 | { 100 | "course_id": 13, 101 | "course_name": "Creative Writing Workshop", 102 | "instructor": "Samantha Clark", 103 | "description": "Unlock your writing potential with creative writing exercises.", 104 | "duration": "8 weeks", 105 | "price": 49.99 106 | }, 107 | { 108 | "course_id": 14, 109 | "course_name": "UX/UI Design Principles", 110 | "instructor": "Alex Martinez", 111 | "description": "Design user-friendly interfaces and enhance user experiences.", 112 | "duration": "7 weeks", 113 | "price": 69.99 114 | }, 115 | { 116 | "course_id": 15, 117 | "course_name": "Python for Data Analysis", 118 | "instructor": "Karen Brown", 119 | "description": "Use Python for data manipulation and analysis.", 120 | "duration": "10 weeks", 121 | "price": 89.99 122 | }, 123 | { 124 | "course_id": 16, 125 | "course_name": "Video Editing Essentials", 126 | "instructor": "Matthew Hall", 127 | "description": "Edit and enhance videos for various platforms.", 128 | "duration": "7 weeks", 129 | "price": 59.99 130 | }, 131 | { 132 | "course_id": 17, 133 | "course_name": "Social Media Marketing Strategies", 134 | "instructor": "Jessica Adams", 135 | "description": "Promote businesses on social media effectively.", 136 | "duration": "8 weeks", 137 | "price": 69.99 138 | }, 139 | { 140 | "course_id": 18, 141 | "course_name": "C++ Programming Fundamentals", 142 | "instructor": "Richard Turner", 143 | "description": "Learn the basics of C++ programming language.", 144 | "duration": "9 weeks", 145 | "price": 79.99 146 | }, 147 | { 148 | "course_id": 19, 149 | "course_name": "Art History and Appreciation", 150 | "instructor": "Olivia Parker", 151 | "description": "Explore the history of art and its significance.", 152 | "duration": "6 weeks", 153 | "price": 49.99 154 | }, 155 | { 156 | "course_id": 20, 157 | "course_name": "Introduction to Cybersecurity", 158 | "instructor": "Andrew Scott", 159 | "description": "Learn about cybersecurity threats and protection measures.", 160 | "duration": "8 weeks", 161 | "price": 69.99 162 | }, 163 | { 164 | "course_id": 21, 165 | "course_name": "Course 21", 166 | "instructor": "Instructor Name 21", 167 | "description": "Course 21 description goes here.", 168 | "duration": "8 weeks", 169 | "price": 69.99 170 | }, 171 | { 172 | "course_id": 22, 173 | "course_name": "Course 22", 174 | "instructor": "Instructor Name 22", 175 | "description": "Course 22 description goes here.", 176 | "duration": "8 weeks", 177 | "price": 69.99 178 | }, 179 | { 180 | "course_id": 23, 181 | "course_name": "Course 23", 182 | "instructor": "Instructor Name 23", 183 | "description": "Course 23 description goes here.", 184 | "duration": "8 weeks", 185 | "price": 69.99 186 | }, 187 | { 188 | "course_id": 24, 189 | "course_name": "Course 24", 190 | "instructor": "Instructor Name 24", 191 | "description": "Course 24 description goes here.", 192 | "duration": "8 weeks", 193 | "price": 69.99 194 | }, 195 | { 196 | "course_id": 25, 197 | "course_name": "Course 25", 198 | "instructor": "Instructor Name 25", 199 | "description": "Course 25 description goes here.", 200 | "duration": "8 weeks", 201 | "price": 69.99 202 | }, 203 | { 204 | "course_id": 26, 205 | "course_name": "Course 26", 206 | "instructor": "Instructor Name 26", 207 | "description": "Course 26 description goes here.", 208 | "duration": "8 weeks", 209 | "price": 69.99 210 | }, 211 | { 212 | "course_id": 27, 213 | "course_name": "Course 27", 214 | "instructor": "Instructor Name 27", 215 | "description": "Course 27 description goes here.", 216 | "duration": "8 weeks", 217 | "price": 69.99 218 | }, 219 | { 220 | "course_id": 28, 221 | "course_name": "Course 28", 222 | "instructor": "Instructor Name 28", 223 | "description": "Course 28 description goes here.", 224 | "duration": "8 weeks", 225 | "price": 69.99 226 | }, 227 | { 228 | "course_id": 29, 229 | "course_name": "Course 29", 230 | "instructor": "Instructor Name 29", 231 | "description": "Course 29 description goes here.", 232 | "duration": "8 weeks", 233 | "price": 69.99 234 | }, 235 | { 236 | "course_id": 30, 237 | "course_name": "Course 30", 238 | "instructor": "Instructor Name 30", 239 | "description": "Course 30 description goes here.", 240 | "duration": "8 weeks", 241 | "price": 69.99 242 | }, 243 | { 244 | "course_id": 31, 245 | "course_name": "Course 31", 246 | "instructor": "Instructor Name 31", 247 | "description": "Course 31 description goes here.", 248 | "duration": "8 weeks", 249 | "price": 69.99 250 | }, 251 | { 252 | "course_id": 32, 253 | "course_name": "Course 32", 254 | "instructor": "Instructor Name 32", 255 | "description": "Course 32 description goes here.", 256 | "duration": "8 weeks", 257 | "price": 69.99 258 | }, 259 | { 260 | "course_id": 33, 261 | "course_name": "Course 33", 262 | "instructor": "Instructor Name 33", 263 | "description": "Course 33 description goes here.", 264 | "duration": "8 weeks", 265 | "price": 69.99 266 | }, 267 | { 268 | "course_id": 34, 269 | "course_name": "Course 34", 270 | "instructor": "Instructor Name 34", 271 | "description": "Course 34 description goes here.", 272 | "duration": "8 weeks", 273 | "price": 69.99 274 | }, 275 | { 276 | "course_id": 35, 277 | "course_name": "Course 35", 278 | "instructor": "Instructor Name 35", 279 | "description": "Course 35 description goes here.", 280 | "duration": "8 weeks", 281 | "price": 69.99 282 | }, 283 | { 284 | "course_id": 36, 285 | "course_name": "Course 36", 286 | "instructor": "Instructor Name 36", 287 | "description": "Course 36 description goes here.", 288 | "duration": "8 weeks", 289 | "price": 69.99 290 | }, 291 | { 292 | "course_id": 37, 293 | "course_name": "Course 37", 294 | "instructor": "Instructor Name 37", 295 | "description": "Course 37 description goes here.", 296 | "duration": "8 weeks", 297 | "price": 69.99 298 | }, 299 | { 300 | "course_id": 38, 301 | "course_name": "Course 38", 302 | "instructor": "Instructor Name 38", 303 | "description": "Course 38 description goes here.", 304 | "duration": "8 weeks", 305 | "price": 69.99 306 | }, 307 | { 308 | "course_id": 39, 309 | "course_name": "Course 39", 310 | "instructor": "Instructor Name 39", 311 | "description": "Course 39 description goes here.", 312 | "duration": "8 weeks", 313 | "price": 69.99 314 | }, 315 | { 316 | "course_id": 40, 317 | "course_name": "Course 40", 318 | "instructor": "Instructor Name 40", 319 | "description": "Course 40 description goes here.", 320 | "duration": "8 weeks", 321 | "price": 69.99 322 | }, 323 | { 324 | "course_id": 41, 325 | "course_name": "Course 41", 326 | "instructor": "Instructor Name 41", 327 | "description": "Course 41 description goes here.", 328 | "duration": "8 weeks", 329 | "price": 69.99 330 | }, 331 | { 332 | "course_id": 42, 333 | "course_name": "Course 42", 334 | "instructor": "Instructor Name 42", 335 | "description": "Course 42 description goes here.", 336 | "duration": "8 weeks", 337 | "price": 69.99 338 | }, 339 | { 340 | "course_id": 43, 341 | "course_name": "Course 43", 342 | "instructor": "Instructor Name 43", 343 | "description": "Course 43 description goes here.", 344 | "duration": "8 weeks", 345 | "price": 69.99 346 | }, 347 | { 348 | "course_id": 44, 349 | "course_name": "Course 44", 350 | "instructor": "Instructor Name 44", 351 | "description": "Course 44 description goes here.", 352 | "duration": "8 weeks", 353 | "price": 69.99 354 | }, 355 | { 356 | "course_id": 45, 357 | "course_name": "Course 45", 358 | "instructor": "Instructor Name 45", 359 | "description": "Course 45 description goes here.", 360 | "duration": "8 weeks", 361 | "price": 69.99 362 | }, 363 | { 364 | "course_id": 46, 365 | "course_name": "Course 46", 366 | "instructor": "Instructor Name 46", 367 | "description": "Course 46 description goes here.", 368 | "duration": "8 weeks", 369 | "price": 69.99 370 | }, 371 | { 372 | "course_id": 47, 373 | "course_name": "Course 47", 374 | "instructor": "Instructor Name 47", 375 | "description": "Course 47 description goes here.", 376 | "duration": "8 weeks", 377 | "price": 69.99 378 | }, 379 | { 380 | "course_id": 48, 381 | "course_name": "Course 48", 382 | "instructor": "Instructor Name 48", 383 | "description": "Course 48 description goes here.", 384 | "duration": "8 weeks", 385 | "price": 69.99 386 | }, 387 | { 388 | "course_id": 49, 389 | "course_name": "Course 49", 390 | "instructor": "Instructor Name 49", 391 | "description": "Course 49 description goes here.", 392 | "duration": "8 weeks", 393 | "price": 69.99 394 | }, 395 | { 396 | "course_id": 50, 397 | "course_name": "Course 50", 398 | "instructor": "Instructor Name 50", 399 | "description": "Course 50 description goes here.", 400 | "duration": "8 weeks", 401 | "price": 69.99 402 | }, 403 | { 404 | "course_id": 51, 405 | "course_name": "Course 51", 406 | "instructor": "Instructor Name 51", 407 | "description": "Course 51 description goes here.", 408 | "duration": "8 weeks", 409 | "price": 69.99 410 | }, 411 | { 412 | "course_id": 52, 413 | "course_name": "Course 52", 414 | "instructor": "Instructor Name 52", 415 | "description": "Course 52 description goes here.", 416 | "duration": "8 weeks", 417 | "price": 69.99 418 | }, 419 | { 420 | "course_id": 53, 421 | "course_name": "Course 53", 422 | "instructor": "Instructor Name 53", 423 | "description": "Course 53 description goes here.", 424 | "duration": "8 weeks", 425 | "price": 69.99 426 | }, 427 | { 428 | "course_id": 54, 429 | "course_name": "Course 54", 430 | "instructor": "Instructor Name 54", 431 | "description": "Course 54 description goes here.", 432 | "duration": "8 weeks", 433 | "price": 69.99 434 | }, 435 | { 436 | "course_id": 55, 437 | "course_name": "Course 55", 438 | "instructor": "Instructor Name 55", 439 | "description": "Course 55 description goes here.", 440 | "duration": "8 weeks", 441 | "price": 69.99 442 | }, 443 | { 444 | "course_id": 56, 445 | "course_name": "Course 56", 446 | "instructor": "Instructor Name 56", 447 | "description": "Course 56 description goes here.", 448 | "duration": "8 weeks", 449 | "price": 69.99 450 | }, 451 | { 452 | "course_id": 57, 453 | "course_name": "Course 57", 454 | "instructor": "Instructor Name 57", 455 | "description": "Course 57 description goes here.", 456 | "duration": "8 weeks", 457 | "price": 69.99 458 | }, 459 | { 460 | "course_id": 58, 461 | "course_name": "Course 58", 462 | "instructor": "Instructor Name 58", 463 | "description": "Course 58 description goes here.", 464 | "duration": "8 weeks", 465 | "price": 69.99 466 | }, 467 | { 468 | "course_id": 59, 469 | "course_name": "Course 59", 470 | "instructor": "Instructor Name 59", 471 | "description": "Course 59 description goes here.", 472 | "duration": "8 weeks", 473 | "price": 69.99 474 | }, 475 | { 476 | "course_id": 60, 477 | "course_name": "Course 60", 478 | "instructor": "Instructor Name 60", 479 | "description": "Course 60 description goes here.", 480 | "duration": "8 weeks", 481 | "price": 69.99 482 | }, 483 | { 484 | "course_id": 61, 485 | "course_name": "Course 61", 486 | "instructor": "Instructor Name 61", 487 | "description": "Course 61 description goes here.", 488 | "duration": "8 weeks", 489 | "price": 69.99 490 | }, 491 | { 492 | "course_id": 62, 493 | "course_name": "Course 62", 494 | "instructor": "Instructor Name 62", 495 | "description": "Course 62 description goes here.", 496 | "duration": "8 weeks", 497 | "price": 69.99 498 | }, 499 | { 500 | "course_id": 63, 501 | "course_name": "Course 63", 502 | "instructor": "Instructor Name 63", 503 | "description": "Course 63 description goes here.", 504 | "duration": "8 weeks", 505 | "price": 69.99 506 | }, 507 | { 508 | "course_id": 64, 509 | "course_name": "Course 64", 510 | "instructor": "Instructor Name 64", 511 | "description": "Course 64 description goes here.", 512 | "duration": "8 weeks", 513 | "price": 69.99 514 | }, 515 | { 516 | "course_id": 65, 517 | "course_name": "Course 65", 518 | "instructor": "Instructor Name 65", 519 | "description": "Course 65 description goes here.", 520 | "duration": "8 weeks", 521 | "price": 69.99 522 | }, 523 | { 524 | "course_id": 66, 525 | "course_name": "Course 66", 526 | "instructor": "Instructor Name 66", 527 | "description": "Course 66 description goes here.", 528 | "duration": "8 weeks", 529 | "price": 69.99 530 | }, 531 | { 532 | "course_id": 67, 533 | "course_name": "Course 67", 534 | "instructor": "Instructor Name 67", 535 | "description": "Course 67 description goes here.", 536 | "duration": "8 weeks", 537 | "price": 69.99 538 | }, 539 | { 540 | "course_id": 68, 541 | "course_name": "Course 68", 542 | "instructor": "Instructor Name 68", 543 | "description": "Course 68 description goes here.", 544 | "duration": "8 weeks", 545 | "price": 69.99 546 | }, 547 | { 548 | "course_id": 69, 549 | "course_name": "Course 69", 550 | "instructor": "Instructor Name 69", 551 | "description": "Course 69 description goes here.", 552 | "duration": "8 weeks", 553 | "price": 69.99 554 | }, 555 | { 556 | "course_id": 70, 557 | "course_name": "Course 70", 558 | "instructor": "Instructor Name 70", 559 | "description": "Course 70 description goes here.", 560 | "duration": "8 weeks", 561 | "price": 69.99 562 | } 563 | ] 564 | } 565 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {} 3 | 4 | module.exports = nextConfig 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint", 10 | "db": "json-server -p 5007 -w db.json" 11 | }, 12 | "dependencies": { 13 | "@tanstack/react-query": "^4.35.3", 14 | "@tanstack/react-query-devtools": "^4.35.3", 15 | "@types/node": "20.6.2", 16 | "@types/react": "18.2.21", 17 | "@types/react-dom": "18.2.7", 18 | "autoprefixer": "10.4.15", 19 | "axios": "^1.5.0", 20 | "eslint": "8.49.0", 21 | "eslint-config-next": "13.4.19", 22 | "json-server": "^0.17.3", 23 | "next": "13.4.19", 24 | "postcss": "8.4.29", 25 | "react": "18.2.0", 26 | "react-dom": "18.2.0", 27 | "react-icons": "^4.11.0", 28 | "tailwindcss": "3.3.3", 29 | "typescript": "5.2.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from 'tailwindcss' 2 | 3 | const config: Config = { 4 | content: [ 5 | './pages/**/*.{js,ts,jsx,tsx,mdx}', 6 | './components/**/*.{js,ts,jsx,tsx,mdx}', 7 | './app/**/*.{js,ts,jsx,tsx,mdx}', 8 | ], 9 | theme: { 10 | extend: { 11 | backgroundImage: { 12 | 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', 13 | 'gradient-conic': 14 | 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', 15 | }, 16 | }, 17 | }, 18 | plugins: [], 19 | } 20 | export default config 21 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | --------------------------------------------------------------------------------