[go: up one dir, main page]

Skip to content

al0cam/feelingQuery

Repository files navigation

FeelingQuery

A simple web app to help you track your feelings

Purpose

The main idea of the app is to track the feelings of a group of people which can be useful in a scrum team for example.

Stack: Svelte + TS + Vite + TailwindCSS + DaisyUI

The application is built using Svelte and TypeScript. The build tool is Vite. The app uses TailwindCSS and DaisyUI for styling.

Recommended IDE Setup

VS Code + Svelte. Also, install the Tailwind CSS IntelliSense extension.

How to run the app

First of all, you need to have Node.js and Git installed on your machine. I will assume you already have that done and go from there.

  1. Clone the repository
  2. Run npm install
  3. Run npm run dev
  4. Open your browser and go to http://localhost:SOME_PORT where SOME_PORT is the port number that Vite is using, it is random because there was no need for a specific port.
  5. Enjoy the app!

How to build the app

  1. Run npm ci
  2. Run npm run build
  3. The build will be in the dist folder

How to run the tests

There are no tests yet.

How to contribute

  1. Fork the repository
  2. Create a new branch
  3. Make your changes
  4. Open a pull request

Documentation

The application uses a repository for fetching things from the backend and a store to manage the fetched and cached information. Current use of the repository and store looks like this. alt text

I want to change the current arhitecture so that all the calls for the repository, at least for a basic user go through the teamStore. Since all the caching is happening in the teamStore and so on, that would prevent extra calls to the Repository and it would make more sense to interface the teamStore from the frontend dev perspective. All the values which I am supposed to fetch for the frontend come from the store anyway.

After further contemplation, I have come to the conclusion that the repository shouldnt have any complex logic in it. The only responsibility it should have is fetching things from the database or backend.

All the logic should be pushed into the store. The store should be the one that is responsible for managing the state of the application and checking whether it's even required to call the repository or if the data is already in the store.

Another important point is that svelte stores, at present, don't have a get method which complicates things. Because of that I like vue's stores more. But since the application is done in svelte now, I will try to make a workaround for that. (As far as I have seen, in Svelte 5 this is addressed)

Even though I wrote all of this I don't feel like implementing them right now. But it's a good reference for future development.

Now that I look closely at the repository, I see that it only contains CRU calls and helper methods such as isCached...

Work is required on the teamStore and pushing methods and logic from the repository for caching and similar into the store so that there is singular access from the UI to the store and not going to repository and then back to the store.

The only case when feelings are added is today. So the current date is the only date for which feeling aditions is permited. Because of that there is no point in having a function which adds any date and therefore there is no point in having the function to add dates for any date but instead for today specifically.

The date interval is used in three cases. One is when fetching the Average feelings of a team between two dates. Second is when the same is done but for Mode. Third is when the team is... I don't see the third case. There should be only two cases atm. However, the implementation will be written generally inside the store and then used in the methods to get the Average and Mode.

The way i was building the repository is bad. I started delegating all the try catches to the teamStore without throwing any errors which removes the possibility of distinguishing between errors. Therefore, a better approach would be throwing the errors in the repo with specific messages which are then caught in the teamStore.

I may have understood svelte reactivity wrong. By creating a cetnrat svelte store which houses a big object I think it lost reactivity. Or some of the functions that I am calling inherently can't be reactive since they are variables which would prompt me to make another store just to store variables that I need in the UI. It seems I need to use the derived store to achieve such use cases.

It would have been easier to track the repository if it was in multiple files. It has grown to explain that change, before there was no point, perhaps. Maybe thats the next step.

Having a a serious problem with firebase hosting, trying to perform the fix as per the tagged stackoverflow post but no success so far. [https://stackoverflow.com/questions/75514653/firebase-action-hosting-deploy-fails-with-requesterror-resource-not-accessible]. Not sure what exactly fixed it but now it works...

License

MIT License

Copyright (c) [2024] [Benjamin Filip Šikač]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

TOOD

  • Add secrets to Firebase
  • write code that generates toast messages for success, error and warning
  • Define logic for setting the dates and teams
  • Define logic for adding the dates and teams
  • Define logic for fetching the feelings
  • Add a way to share the feelings with the team
  • Add CI/CD pipeline for testing branch
  • Add CI/CD pipeline for main branch
  • Add a way to visualize the feelings
  • Add a way to export the feelings
  • Add a way to import the feelings
  • Add tests

About

App for querying your team about how they feel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published