Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Sturucure

The lib folder contains the main source code for the application, organized into several packages and files. Below is a guide that outlines the structure and purpose of each component within the lib folder.

Overview

The lib folder is structured to promote modularity and reusability, following the VEP (View, Example, Page) Development Guide. It is organized into subdirectories and files, each serving a specific role in the application.

Directory Structure

  • client: Contains client-side models and data handling logic.

    • models: Defines data structures and handles serialization/deserialization.
      • label.dart: Model for labels.
      • note.dart: Model for notes.
      • pagination.dart: Handles pagination logic.
  • frontend: Responsible for the user interface and user experience.

    • features: Encapsulates feature-specific views and examples.
      • home: Contains the home view and its example for testing.
        • home_view.dart: Defines the main UI for the home feature.
        • home_example.dart: Provides test scenarios for the home view.
    • widgets: Reusable UI components shared across different views.
    • utils: Utility functions and helpers used by the frontend.
    • data: Contains fake or mock data for testing purposes.
      • fake_data.dart: Provides mock data for testing the UI.
  • server: Manages server-side logic and interactions with back-end services.

    • notes.dart: Handles server-side operations for notes.
    • note_server.dart: Manages communication with the note server.

Key Files

  • frontend_app.dart: Entry point for the frontend application, initializing the UI components.
  • example_page.dart: Demonstrates how to use and test various components in isolation.

Guidelines

  1. Feature Development: Each feature should have a corresponding view and example for isolated testing.
  2. Testing: Utilize mock data for testing views and ensure scenarios like loading, error, and empty states are covered.
  3. Integration: Once tested, integrate features into pages that communicate with the backend.
  4. Documentation: Maintain clear and concise documentation for each file, explaining its role and usage.
  5. Code Reviews: Ensure all code changes undergo thorough reviews to maintain quality and consistency.

By following this guide, developers can navigate the lib folder efficiently, contributing to a maintainable and scalable codebase.

VEP (View, Example, Page) Development Guide

This document outlines the rules and workflow structure for frontend developers working on the Arfoon company projects. By following this VEP guide, we aim to standardize the development process, ensure consistency, and improve code maintainability and functionality.

  1. FeatureView

Each feature should be encapsulated as a View with parameters. This makes it reusable, modular, and easily testable.

Rules for FeatureView

  1. Structure: • A view should be created as a Flutter widget in its own file within the views package. • Parameters must be passed to make the view flexible and adaptable to various scenarios.

  2. Reusability: • Ensure the view can be reused across the app without modification. • Avoid hardcoding values; rely on dynamic input through parameters.

  3. Design Adherence: • The view must strictly follow the design provided by the UI designer.

  4. Folder Organization: • Store views in the lib/views directory. • Name files using the feature name in lowercase and underscores (e.g., user_profile_view.dart).

  5. FeatureExample

To ensure proper functionality, an Example must be created for testing each view independently.

Rules for FeatureExample

  1. Purpose: • Test the View using mock data to simulate various scenarios.

  2. Scenarios to Test: • Loading State: Ensure the view properly handles and displays loading indicators. • Error State: Verify that error messages or fallback UI elements are displayed correctly. • Empty Data: Test how the view behaves with no data and provide a meaningful placeholder. • Successful Result: Ensure the view displays data as intended when provided with valid input.

  3. Implementation: • Create a standalone example in the lib/examples folder. • Name the file with the feature name (e.g., user_profile_example.dart).

  4. Testing Methodology: • Use mock data to populate the view parameters. • Ensure every parameter is tested with valid, invalid, and boundary values.

  5. FeaturePage

Once the View and Example are tested and verified, integrate the feature into a Page linked to the backend or server.

Rules for FeaturePage

  1. Purpose: • Convert the mock data example into a fully functional page by integrating backend API calls.
  2. Integration: • Replace mock data with real-time data fetched from the backend. • Use proper state management techniques (e.g., Provider, Bloc, or Riverpod) to handle loading, errors, and success states.
  3. Folder Organization: • Store pages in the lib/pages folder. • Name files using the feature name (e.g., user_profile_page.dart).
  4. Code Practices: • Implement error handling for failed API calls. • Optimize performance by reducing unnecessary API calls or re-rendering. • Link navigations and actions to other features/pages as required.
  5. Testing: • Conduct manual and automated tests to ensure the page works seamlessly with the backend.

Workflow Summary

  1. View Development

• Start by creating the FeatureView as a reusable widget with parameters. • Save the view in the lib/views folder.

  1. Testing with Example

• Build a standalone FeatureExample in the lib/examples folder to test the view. • Test for Loading, Error, Empty Data, and Successful Result scenarios.

  1. Integration into a Page

• Create the FeaturePage in the lib/pages folder. • Link the page with the backend server for real-time functionality.

Best Practices

  1. Documentation: • Add comments and documentation to each file explaining its purpose, parameters, and usage.
  2. Code Reviews: • Every View, Example, and Page must undergo a code review before being merged into the main branch.
  3. Error Handling: • Use meaningful error messages and provide fallback options where applicable.
  4. UI Consistency: • Ensure all features follow the design system defined by the UI designer.
  5. Collaboration: • Work closely with the backend team to resolve API issues or define requirements.

By adhering to this VEP Development Guide, the team can ensure high-quality frontend development that is scalable, maintainable, and user-friendly.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages