This document provides an overview of the architecture for the AIT Lab Website project, including its folder structure, purpose, and key files. This organization ensures clarity, scalability, and maintainability for developers.
ait-lab-next/
├── .next/ # Build artifacts generated by Next.js
├── app/ # Next.js App Router and page components
├── components/ # Reusable React components
├── data/ # JSON files for static and dynamic data
├── docs/ # Project documentation
├── node_modules/ # Installed npm/yarn dependencies
├── public/ # Static assets (images, icons, videos)
├── types/ # TypeScript type definitions
├── .gitignore # Git ignored files and folders
├── next-env.d.ts # Next.js TypeScript environment
├── next-sitemap.config.js # Sitemap configuration
├── next.config.ts # Next.js configuration file
├── package.json # Project metadata and dependencies
├── README.md # Project overview documentation
├── tsconfig.json # TypeScript configuration
├── yarn.lock # Yarn lock file for dependencies
- Purpose: Contains the build artifacts generated by Next.js during development and production builds.
- Do not edit manually.
- Purpose: Houses the Next.js App Router and page-specific components.
- Key Subfolders and Files:
about/
,news/
,teams/
: Contain the pages for their respective sections.layout.tsx
: Defines the global layout for pages (e.g., shared Navbar/Footer).page.tsx
: The homepage entry point.theme.ts
: Theme configuration for the project.
- Purpose: Contains reusable React components for UI and functionality.
- Key Files:
- Global Components:
Navbar.tsx
: The navigation bar used across the site.Footer.tsx
: The footer used across the site.ScrollToTop.tsx
: Adds a "scroll to top" button for user convenience.
- Homepage Components (in
components/Homepage
):Hero.tsx
: The hero section for the homepage.ProjectsSection.tsx
: Displays projects on the homepage.RecentNews.tsx
: Shows recent news on the homepage.
- Specialized Components:
GrantCard.tsx
: Displays information about individual grants.ProjectCard.tsx
: Displays project summaries in card format.TeamProfileModal.tsx
: Displays detailed team member profiles in a modal.
- Global Components:
- Purpose: Contains JSON files that serve as the data sources for various sections.
- Key Files:
porjs_and_grants.json
: Details about all projects and grants (updated).news.json
: Contains news articles to display on the website.Teams_Data.json
: Data about team members for the Teams section.courses.json
: Information about courses related to the lab.
- Purpose: Contains project documentation.
- Key Files:
installation.md
: Installation guide for developers.components.md
: Overview of all components and their functionality.architecture.md
: (this file) Detailed explanation of the project structure.
- Purpose: Stores installed dependencies from npm/yarn.
- Do not edit manually.
- Purpose: Stores static assets that are publicly accessible.
- Key Files:
img/
: Subfolder for images used in the project.AIT_Favicon.png
: The favicon for the site.sitemap.xml
: Auto-generated sitemap for SEO purposes.robots.txt
: Instructions for web crawlers.manifest.json
: Web app manifest file for PWA support.
- Purpose: Contains custom TypeScript type definitions for better type safety.
- Key Files:
ProjectsAndGrants.ts
: Defines types for projects and grants data.TeamMember.ts
: Defines types for team member data.
.gitignore
: Specifies files and folders to exclude from Git version control.next-env.d.ts
: TypeScript types for Next.js-specific features.next-sitemap.config.js
: Configures the generation of sitemaps.next.config.ts
: Next.js configuration file for customizing project settings.tsconfig.json
: TypeScript configuration file to enforce strict typing and code standards.
- Folder structure separates global components from page-specific components, making it easy to maintain and extend.
- Common elements like
Navbar
andFooter
are kept incomponents/
to ensure they're reusable throughout the site.
- Static data (e.g.,
projects.json
,news.json
) is stored in thedata/
folder to decouple logic and UI.
- TypeScript is used extensively to minimize runtime errors and improve developer experience.
-
Add New Pages:
- Add a new folder under
app/
and create apage.tsx
file.
- Add a new folder under
-
Add New Components:
- Create a new
.tsx
file undercomponents/
. - If it’s page-specific, place it under a subfolder (e.g.,
components/Homepage
).
- Create a new
-
Add New Data:
- Update or add a new JSON file in the
data/
folder. - Use TypeScript definitions from
types/
for validation.
- Update or add a new JSON file in the