Project Structure and Best Practices
Understanding the Project Structure:
To ensure a clean and maintainable project, we've adopted a well-organized folder structure:
agrimarket/
βββ app/
βββ components/
β β βββ Header/
β β β βββ Header.tsx
β β β βββ Header.module.css
β β βββ Footer/
β β β βββ Footer.tsx
β β β βββ Footer.module.css
β β βββ ...
βββ public/
βββ prisma/
βββ tailwind.config.js
βββ next.config.js
βββ package.json
Key Folders and Their Purpose:
- app: Contains the main application code.
- components: Stores reusable UI components, organized into subdirectories for better organization.
- public: Stores static assets like images, fonts, and favicons.
- prisma: Contains Prisma schema and migration files for database interactions.
- tailwind.config.js: Configures Tailwind CSS for the project.
- next.config.js: Configures Next.js for the project.
- package.json: Manages project dependencies and scripts.
Best Practices for Contributors:
- Follow the Folder Structure: Maintain the existing folder structure to ensure consistency and ease of navigation.
- Use Clear and Concise Naming: Use descriptive names for files, components, and variables.
- Write Clean and Well-Commented Code: Adhere to coding standards, use meaningful variable names, and add comments where necessary.
- Leverage the Tech Stack: Utilize Next.js, TypeScript, Tailwind CSS, and shadcn UI to build efficient and maintainable components.
- Write Comprehensive Tests: Write unit and integration tests to ensure code quality and prevent regressions.
- Follow Git Best Practices: Use clear commit messages, create meaningful branches, and resolve merge conflicts promptly.