Skip to content

easilyBaffled/points-streaks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

How can I keep infrastructure the same across both projects?

Bulletproof

- [x] Copy over plop
- [x] set proper repo
- [x] add MSW from [react-query-auth-demo - CodeSandbox](https://codesandbox.io/s/react-query-auth-demo-fvvvt?file=/src/index.tsx) to get login working
	> It was already in there, just not working
- [ ] evaluate Cypress vs Jest
- [x] use [plopjs](https://plopjs.com/) with [bulletproof example](https://github.com/alan2207/bulletproof-react/blob/ff8308ffe773782937e96a1883185eccebfd931e/generators/component/index.js) to generate features
- [x] use [plopjs](https://plopjs.com/) with [bulletproof example](https://github.com/alan2207/bulletproof-react/blob/ff8308ffe773782937e96a1883185eccebfd931e/generators/component/index.js) to generate slice
- [x] use [plopjs](https://plopjs.com/) with [bulletproof example](https://github.com/alan2207/bulletproof-react/blob/ff8308ffe773782937e96a1883185eccebfd931e/generators/component/index.js) to generate component
- [ ] port over my changes from Mapware
- [ ] port over my changes from Points

Mapware

- [ ] #fetch configure endpoint
- [ ] #fetch create the project specific fetch function for codegen
- [ ] #fetch integrate graphql generation
- [ ] create top level routing work / login
- [ ] move all routing to `features`
- [ ] pull in google analytics (and leave a place for our better stats)
- [ ] breadcrumbs nav
- [ ] share link

Bulletproof Infrastructure

for each directory/file- write up what is different and the tasks i need to move it over to my project

  • /.github

  • /.husky

  • /cypress

    • integration vs e2e - "integrationFolder": "cypress/e2e",
    • how to record test
    • create tests
    • add dashboard
      • what constitutes a test result (that would get charged for) is it each .spec is it each .it is it succeful runs
    • how does dashboard work with Github
    • add visual regression
    • cypress specific eslint.js
    • what's "fileServerFolder": "dist",
    • what does testing-library provide
  • coverage

  • /public

    • copy files
    • create replacement files
    • document instructions to change them
  • postcssrc.json

  • .stylelintrc.json

  • index.html

  • package.json - mostly scripts and lint-staged

  • tailwind.config.js

  • vercel.json

  • vite.config.ts

  • add GitHub - tailwindlabs/tailwindcss-forms

  • how to add lighthouse measurements to github

  • create constants and utils

  • move all tests to their proper /__test__

  • create doc explaining feature, routing, and index.jss

  • use direnv or something to make proper .env in accordance with what vite expects

  • try to add and test with GQL https://mswjs.io/docs/api/graphql/query https://mswjs.io/docs/getting-started/mocks/graphql-api https://www.btw.so/open-source-alternatives/auth0-alternatives

  • add sentry

UX

Performance

Points

Backlog

Permissions

CICD

Security

Confidence

V2

  • define types as GQL Scheme
  • How to mutate
  • Create BE
  • Convert to React Native
  • create composable Task reducer

Reading/Planning

Toys


The longer you wait to add infra like eslint, coverage, responsive, the harder it is to add So when coding features hits a lul I should take the opportunity to add cov

  • reduce vite logging
  • Could Not Complete: update reporting to only show broken tests
  • get tests to pass
  • Cypress Doesn't have an option: how to have cy watch and notify locally
  • Cy GitHub Actions
  • CICD
    • why is my pipeline breaking
    • the pipeline should install and/or cache build
    • lint, test, and so on
    • if all things pass properly deploy anew
  • create prod data
  • create PROD switch for build
  • eslint
    • add eslint
    • fix eslint issues
    • add the no-import rule from bulletproof
  • unit tests
    • collect coverage
    • error on coverage
  • add @ path alias
    • add jsconfig.json
    • update vite.config.js
    • run tests to make sure everything still works
  • why did i lose state

So I have finally hit a major refactoring point. I want to add standard tasks, ones that I can create, complete, move to history, and move back if necessary. I am going to have to recover from shooting myself in the foot first, because I named all the streak stuff "task" so the first thing is to refactor that to be just streaks And in looking forward I am going to have to be a little careful because I am also going to want daily tasks, that are like teh standard task but it doesn't get moved to history. I can think about how that gets implemented later, but it's more that I need to keep things open, so I can easily adapt it later.

  • how can I read that I am in a test env to disable firebase?
  • create cypress watch so I can make my changes and get live updates
  • refactor /task to be /streaks
  • move Task component to a shared /component location
  • update Task component so that it can be composed with other type of tasks
  • create exports necessary for tests
  • create tests for task CRUD
  • create entities for "tasks" and "history",
  • add create task input
  • add task list to UI
  • add history list
  • add tabbed view for active/history
  • add restore task button
  • add handler to bank to move task's value
  • fix eslint issues
  • https://rebassjs.org/ or Tailwind
  • keep a history of actions on each task
  • transfer streaks to app
  • display bank

So I know that I am doing things very wrong writing everything to the Firestore everytime I make a change to state. And there are certainly a number of things I could do to improve the situation but honestly right now I just need this thing to move along. So all improvements I can think of will go to Ideal Cloud/DB, but for now the job is GET IT DONE.

  • FireStore Persist
    • locate my persist code in the previous points
    • port over persist
    • read the new docs
      • collection> Gets a CollectionReference Not too much I can do with it, so I need to use getDoc(s)
      • getDoc> Reads the document referred to by this DocumentReference.

getDocs lets you specify a query and get an array, but if I'm only playing by myself then I don't need to query. But really I care about DocumentReference A DocumentSnapshot contains data read from a document in your Firestore database. The data can be extracted with .data() or .get() to get a specific field.

  • setDoc> Writes to the document referred to by this DocumentReference. If the document does not yet exist, it will be created.

If you provide merge or mergeFields, the provided data can be merged into an existing document. Perhaps I can in the future send just the chunk of state that has been updated, rather than sending the whole thing

  • set up persisting an object
  • get object persist working

OK I have finally hit the wall that I feel I always run into and then drop Cloud Storage. At savepoint I need a database. I wish to high hell that I could just save my entire redux store on every change but that doesn't seem to be possible. My wish would be something like immer-to-firestore where I could perform JS actions on an object and that would be translated to firestore/supabase/what-ever. It's possible my answer still lies with GraphQL, but that's going to require a lot of reading and learning. I may end up splitting my time between learning that and forward progress on streaks. So I am going to need to do some thinking For the time being I think I need to do some quick and dirty work on streaks to keep it going, namely use my redux-persist hack where I write the whole string of my state to firebase through redux-persist. I presume it's "gross" but it also let's me maintian my forward progress on this app, while I figure out what I am looking for

my number one concern is not having to work in two projects, so no client/server situation. Even if they both live in the same project, I really don't want to have to maintain a front and backend

ok so that last "Train of Thought" probably went on for long enoug, so this is where the new one starts. Once again I am going to try and stay away from all of that good foundational scaffolding that I'm working on in bulletproof in exchange for speed of getting things done here I can feel my motivation waning a bit so I really need to be good about laying out small chunks and reminding myself how much faster this will make my mornings, and just think once streaks are done I can start with regular tasking and automating the backlog

  • create Task Feature

  • move task store to feature

  • create component for Task

  • port over component for streak sandbox

  • set my defaults for layout

  • use Custom CSS Reset

  • add the React Error Overlay

  • wire up toggle tasks

  • wire up resolve day

  • why does resolve day break? (I was doing { payload: { bank } } destructuring on {}, and there's no good messaging for destructuring errors)

  • persist state

    • localStorage
    • [x]

add firebase connections

  • [x]

read React and Firebase without Redux

I am trying to build to resolveDay and to that end the next piece that I think I need is Bank So I am working on that. BUT I still don't have a way to solve the global state issue, so I am not creating a bankSlice Rather I am defining the object that would be used in createSlice that way if I chose I can work it into a globalSlice with the other pieces.

  • how do i define selectors
  • define a selector that produces the point value of a pizza and amount of pizza
  • should I use selectors in my unit tests?
  • bank unit tests
  • create redux slice sandbox for experiments redux/toolkit sandbox
  • https://redux.js.org/understanding/history-and-design/middleware#the-final-approach
  • https://redux-toolkit.js.org/api/getDefaultMiddleware
  • can I tell when state has or will change in the middleware?
  • how does the default middleware work?
  • what if I only return the updated action
  • sketch out resolveDay as a middleware that will serve as the director reading state, and dictating to each reducer what it will need to do
  • create tests based on the scenarios assuming a full redux store
  • create store based on the sandbox
  • create selectors for resolve day
  • # resolveDaySelectors get value of completed tasks for the bank
  • # resolveDaySelectors create action detailer
  • test resolveDay with the bank and getDaysPoints
  • load initialState for tests
  • create actual initialState

I don't really want to get too bogged down in the infrastructure, like I would with Bulletproof, this is really to get the thing off the ground. because nothing is more valuable than just using the damn thing. So this is, "just enough to use it" which includes: