Skip to content

ArthurVBS/Canadel

Repository files navigation

Canadel

Β  Β  Β  Β  Β  Β  Β 

✨ About the project:

  • πŸͺ‘ The project is a Product Manager for Canadel.inc.
  • πŸ§ͺ The project has unit tests for backend and frontend and allow the developer see its coverage.
  • 🧹 The project has linters for backend and frontend to validate the quality of the code and format it.
  • 🐳 The project uses CI-CD to validate the Merge Requests with pipelines in the GitHub actions.
  • πŸ§‘β€πŸ’» The project was two approaches:
    • Java 17 + Spring in the backend and Typescript + Vue 3 in the frontend.
    • C# + .NET 8 in the backend and Typescript + Vue 3 in the frontend.

πŸ’» Project status:

  • Finished project βœ”οΈ

πŸ›  Technologies:

  • Backend:
    • Java Ecosystem
      • Java
      • Spring
      • Gradlew
      • Spotless
      • Lombok
      • H2 Database
      • Jacoco Reporter
    • C# Ecosystem
      • C#
      • .NET
      • Xunit
      • SQLite
  • Frontend:
    • TypeScript
    • Vue
    • Yarn or NPM
    • Node
    • CSS
    • Vuetify
    • Vuex
    • Vite
    • Vitest
  • General:
    • Docker Compose
    • Makefile

πŸ“ Features:

  • The application is a CRUD product manager:
    • Allow user create a product with name, description and its price.
    • Allow user read all products data: ID, name, description, price and createdAt.
    • Allow user read a specific product data based in its ID. (Backend endpoint only).
    • Allow user update a product by its ID with name, description and its price.
    • Allow user delete a product by its ID.
  • The application validates the CRUD in both connection parts (frontend and backend).
    • Do not allow to create or to update with empty name, empty description or zero price.
    • Do not allow to read by id, to update by id or to delete by id using an invalid ID.
  • The application is accessible for the most used screen sizes:
    • Allow user access the application by web.
    • Allow user access the application by mobile.
  • The application stores the data in a database.
  • The application holds the information in frontend using state.

βš™οΈ Prerequisites:

πŸƒβ€β™‚οΈβ€βž‘οΈ Run

  • General:
    • Docker Compose
    • Makefile

πŸ§‘β€πŸ’» Develop

  • Backend:
    • Java Ecosystem
      • Java 17
      • Gradle 8
    • C# Ecosystem
      • C#
      • .NET 8
  • Frontend:
    • Node 20
    • Yarn
  • General:
    • Makefile
    • Docker Compose

πŸš€ How to run the application?

πŸƒβ€β™‚οΈβ€βž‘οΈ Run

  • Download the ZIP or Clone the application on your machine;
    • Open one CMD terminal in the root of the project folder,
    • Run make run-docker-compose-dotnet or make run-docker-compose-java,
    • Access the application through http://localhost:5173.

πŸ’» Develop

  • Clone the application on your machine;
    • Open two CMD terminal in the root of the project folder,
    • The first terminal access one of the backend folders: ,
      • To use Java Ecosystem: cd backend-java
        • Install gradle modules: ./gradlew,
        • Finally, start a localhost: ./gradlew bootRun,
        • The available endpoint: http://localhost:12000.
      • To use C# Ecosystem: cd backend-dotnet
        • Install modules: dotnet build,
        • Finally, start a localhost: dotnet run --project ./Canadel/Canadel.csproj,
        • The available endpoint: http://localhost:12000.
    • The second terminal access the frontend folder: cd frontend,
      • Install node modules: yarn or npm install,
      • Finally, start a localhost: yarn dev or npm run dev,
      • The available endpoint: http://localhost:5173.
    • Access the application through http://localhost:5173.

πŸ§ͺ How to run the tests?

πŸƒβ€β™‚οΈβ€βž‘οΈJust Run

  • Backend:
    • Open the CMD terminal,
    • Access the backend folder,
      • To use Java Ecosystem: cd backend-java
        • Install gradle modules: ./gradlew,
        • Finally run the tests: ./gradlew test.
      • To use C# Ecosystem: cd backend-dotnet
        • Build project: dotnet build,
        • Finally run the tests: dotnet test.
  • Frontend:
    • Open the CMD terminal,
    • Access the frontend folder: cd frontend,
    • Install node modules: yarn or npm install,
    • Finally, run the test: yarn test or npm run test.

πŸ“Š Run with Coverage

  • Backend
    • Open the CMD terminal,
    • Access the backend folder cd backend
      • To use Java Ecosystem: cd backend-java
        • Install gradle modules: ./gradlew
        • Finally run the tests with coverage: ./gradlew test jacocoTestCoverageVerification,
        • Open the backend-java/build/reports/jacoco/test/html/index.html file in browser.
      • To use C# Ecosystem: cd backend-dotnet
        • Build project: dotnet build,
        • Install globally the report generator tool: dotnet tool install -g dotnet-reportgenerator-globaltool
        • Run the tests with the coverage result: dotnet test --collect:"XPlat Code Coverage"
        • Convert the coverage to html: reportgenerator -reports:"Canadel.Tests/TestResults/**/coverage.cobertura.xml" -targetdir:"coverage-report" -reporttypes:Html
          • or
        • Convert the coverage to html: reportgenerator.exe -reports:"Canadel.Tests\TestResults\**\coverage.cobertura.xml" -targetdir:"coverage-report" -reporttypes:Html
        • Open the backend-dotnet/coverage-report/index.html file in browser.
  • Frontend
    • Open the CMD terminal,
    • Access the frontend folder: cd frontend
    • Install node modules: yarn or npm install,
    • Run the test with coverage: yarn test:coverage or npm run test:coverage,
    • Open the frontend/coverage/index.html file in browser.

πŸ‘¨πŸ½β€πŸ’» Author

Author's photo
Made by Arthur V.B.S.✌🏽