Skip to content

Releases: SilvaCastillo/train-controller

v1.0

Choose a tag to compare

@SilvaCastillo SilvaCastillo released this 26 Oct 17:06
6a919f3

Release v1.0

Preparatory Work

Before delving into the details of requirements 1 and 2, it's worth mentioning that I undertook the following actions as part of my preparation:

  1. Code Comments: I thoroughly reviewed both the backend and frontend code, ensuring that all relevant sections were clearly documented with comments. This improved code readability and comprehensibility for myself and other developers who may work on the project in the future.

  2. Code Refactoring: In the 'database' and 'models/tickets' files, I conducted extensive refactoring to enhance the code's structure. This helped organize and consolidate the code, making it more maintainable for future development.

  3. URL Handling: I relocated URL references from both backend and frontend files to a separate file called 'utils.js.' This step contributed to a more structured project and simplified maintenance. The URL in 'utils.js' can now be customized based on whether I'm working locally or on a live server, ensuring flexibility in different environments.

  4. Removal of Unused Code: I identified and removed unused code in the 'utils.js' file. This resulted in a cleaner and more efficient codebase.

  5. Elimination of Unused Imports: I reviewed the project's files and removed import statements that referred to files no longer in use. This cleanup improved the project structure and code consistency.

  6. .env File: To enhance project security, I removed the '.env' file from the backend repository. This was a crucial step to prevent the exposure of sensitive information.

  7. Quality Assurance with 'npm run lint': Before implementing requirements 1 and 2, I used 'npm run lint' to ensure that the code adhered to a high standard of quality and consistency. Any code clashes or shortcomings were addressed.

  8. PropTypes for Enhanced Prop Validation: To bolster the codebase's robustness and clarity, I added PropTypes to improve prop validation in the project. This step facilitated troubleshooting and helped avoid potential issues.

With these actions as a foundation, I was ready to tackle requirements 1 and 2 and build upon the improved codebase.

Requirement 1

Part 1: To fulfill requirement 1, I added an if statement in my frontend API file to check if the received objects have the 'FromLocation' and 'ToLocation' attributes. Initially, I attempted to handle this on the backend, but it proved challenging to implement satisfactorily. Thus, I opted to continue handling trains without 'FromLocation' and 'ToLocation' attributes in the objects. This allows us to potentially address these cases more effectively in the future.

Part 2: To fulfill requirement 1, I needed to make changes so that clicking on a train's info displays only that specific train on the map and in the list. Clicking again should show all trains once more. To achieve this, I introduced the following variables: positionData, shouldRenderContent, filteredMarkers, and filteredTrains. I also created the handleSelectTrain function, which is used when clicking on a train in the list. Depending on the value of shouldRenderContent, the function alters what should be displayed. If shouldRenderContent is true, all trains are shown, and if false, only the selected train is displayed. Working alone made this task somewhat challenging, but I managed to implement these changes.

To display the correct trains and markers, I utilize the trainsToShow and markersToRender variables. If shouldRenderContent is true, all trains and markers are displayed; otherwise, only the filtered trains and markers are shown. I also check for duplicate train data to avoid displaying the same train twice.

Requirement 2

To fulfill requirement 2, I made the following changes:

  1. Introduction of GraphQL to the Backend: This required a significant restructuring of existing code to adapt it to the GraphQL data model.

  2. Integration of Apollo Client on the Frontend: I integrated Apollo Client to fetch data from the GraphQL backend and ensure data is displayed as before.

  3. Removal of the Old API File from the Frontend: Since GraphQL is now exclusively used for data retrieval, I removed the old API file from the frontend.

  4. Organizing GraphQL Requests and Mutations: I created a new file in the 'utils' folder in the frontend called 'queries' to organize all the GraphQL requests needed to fetch data from the GraphQL backend or perform mutations, such as creating a ticket.

Release v0.2.1

Choose a tag to compare

@SilvaCastillo SilvaCastillo released this 12 Oct 17:09
e973c36

Release v0.2.1

I have prioritized maintainability, consistency, and code quality in this release. The major enhancements can be found under

Codebase Improvements:

  • Enhanced code readability with clear comments, making the codebase more understandable.
  • Eliminated unnecessary spaces, resulting in cleaner and more organized code.
  • Refactored URLs used in both database and ticket functionality, offering more flexibility.
  • Centralized URL configuration by adding it to the utils file while removing obsolete code.
  • Trimmed down the codebase by removing unused imports from the database.
  • Introduced meaningful comments to the utils file, facilitating understanding.

Workflow and Repository Enhancements:

  • Improved security and configuration management by removing the .env file from the repository.
  • Streamlined the structure of the backend's test folder, moving it into the backend directory for improved organization.
  • Streamlined workflows by adjusting the working directory for the test folder.
  • Ensured code quality and consistency by running npm run lint.
  • Refined the codebase by removing redundant imports for cleaner, more efficient code.
  • Boosted code reliability by implementing PropTypes for enhanced props validation.

Database Migration and Frontend Implementation

Choose a tag to compare

@SilvaCastillo SilvaCastillo released this 11 Oct 13:38

Release Notes for v0.20

Database Migration and Frontend Implementation

Major Changes:

  1. Database Migration to MongoDB:

    • The backend has been upgraded to use MongoDB atlas instead of the previous SQLite database. This change enhances data storage and retrieval capabilities.
  2. Frontend Implementation with Vite/React and Tailwind CSS:

    • The frontend of the application has been completely revamped using the Vite/React JavaScript framework, coupled with the use of Tailwind CSS for styling. This update ensures a more dynamic and responsive user interface, making it easier for users to interact with the application.

Enhancements:

  1. Test Implementation:

    • Comprehensive testing has been added throughout the development process. These tests ensure that the application functions reliably and consistently.
  2. Continuous Integration with GitHub Actions:

    • A continuous integration pipeline has been set up using GitHub Actions. This CI/CD process automatically builds, tests, and deploys the application, ensuring code quality and stability.
  3. Deployment Details:

    • The frontend is now live on the student server.
    • The backend and database have been deployed in the cloud on Azure.

Thank you for using our application. We hope you enjoy the enhanced performance and user experience.

Initial Code Setup, NPM Audit Fixes, and API Key Integration

Choose a tag to compare

@SilvaCastillo SilvaCastillo released this 03 Sep 13:53
4144098

Release Notes for v0.1.0

In this initial release, we have laid the foundation for our project with the following major improvements:

  • Code Setup: We've established the project's directory structure and configured the development environment, ensuring a solid foundation for future development.

  • NPM Audit Fixes: We've diligently addressed and resolved all reported issues from NPM audit, enhancing the project's security and stability.

  • API Key Integration: We've seamlessly integrated an essential API key, enabling access to external services and data for enhanced project functionality.