Skip to content

Comments

Refactor Backend#54

Merged
jankapunkt merged 99 commits intorelease-1.0.0from
First-Backend-Refactor
Dec 12, 2024
Merged

Refactor Backend#54
jankapunkt merged 99 commits intorelease-1.0.0from
First-Backend-Refactor

Conversation

@alessandrobelli
Copy link
Contributor

@alessandrobelli alessandrobelli commented Jun 27, 2024

Refactor using Backend refactor guidelines.

  • Implement Form Requests:

    • Create Form Request classes for validation and authorization.
    • Refactor existing validation logic out of controllers into Form Requests.
  • Review and Refactor Models:

    • Ensure proper use of Eloquent for interacting with the database.
    • Try to use scopes as frequently as possible.
    • Use $fillable, $timestamps, $primaryKey, $auditExclude, $casts and other properties correctly.
    • Implement necessary relationships and encapsulate business logic within models.
  • Review and Refactor Controllers:

    • Ensure each controller follows the Single Responsibility Principle as closely as possible.
    • Use proper naming conventions for controllers.
    • Move business logic to service classes where applicable.
    • Implement or refactor to standard methods (index, show, store, update, destroy) when possible.
  • Optimize Database Interactions:

    • Implement chunking for processing large datasets.
    • Cache frequently accessed data, if there are any.
    • Analyze and optimize query performance.
  • Review and Improve Policies:

    • Ensure all permissions and policies are correctly defined in app/Policies.
    • Refactor and simplify policy methods for better maintainability.

@alessandrobelli alessandrobelli added enhancement New feature or request code quality labels Jun 27, 2024
@alessandrobelli alessandrobelli added this to the Release 1.0 milestone Jun 27, 2024
@alessandrobelli alessandrobelli self-assigned this Jun 27, 2024
@alessandrobelli alessandrobelli marked this pull request as draft June 27, 2024 10:36
jankapunkt and others added 13 commits June 30, 2024 22:13
- created factory of codebooks
- used the request validation instead of the inline one for the codebook controller and codebookcodes controller
- extended tests for codebooks
- coding controller has now security checks
- add codecontrollertests
- optimized the code update to just one function instead of 3
- now the project controller is refactored
- still need to refactor the audits
- removed unused or useless code
- new requests for resources
- removed description limit
Alessandro Belli added 3 commits September 12, 2024 10:53
- now audits have their controller
- url consistency
- add form request and security to the selection controller
jankapunkt and others added 27 commits November 11, 2024 08:24
- now we add a codebook property "code order"
- implemented tests for that
- improved codebook update to include code_order
- improved form request to include codebook update
- we can now store settings in the settings table
- created allowed settings table, currently not used but ready for
- created migrations, tests, factories and enum
- created command to manage allowed settings
- rename from default codebook to "project name codebook"
- bugifx export codebook
- add tests for new features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants