Code Monkey home page Code Monkey logo

rmt's People

Contributors

reyesml avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

rmt's Issues

Add transaction support

https://gorm.io/docs/transactions.html

Possibly get rid of "repos" pattern and lift db interactions into the interactors? ๐Ÿค”

Another option is to have each repo method accept db as a param. Not sure how much I like this though. Originally, I wanted the interactors to be largely unaware of the underlying database mechanism. Keeping db queries isolated to Repos limits the blast radius if I decide to swap out the ORM for something else in the future. I'd like to maintain this isolation if possible.

Basically, I need a mechanism for hot-swapping the Repos' db attribute once a transaction has begun.

SEARCH! ๐Ÿ”Ž

Users should be able to search by:

  • people's names
  • quality names
  • notes?

Add end-to-end server tests

The interactor tests are nice because they're simple to spin up, but I find more runtime errors slipping through that relate to config/dependency setup. It would be nice to have some end-to-end tests that run server.main and actually poke the server.

Add Login Form

  • General login form layout
  • Redirect from "/home" to "/login" if user is lot logged in
  • Load user information when "/" is visited and user is already logged in
  • Redirect from "/login" to "/home" is user is already logged in

If login successful:

  • set session cookie
  • persist currentUser information in store
  • redirect to "/home"

If login not successful:

  • display error message

Find a way to automagically scope queries by segment?

I'm debating whether I want to explicitly pass the segment UUID to every repo method, or find a way to control this at a lower level with scopes...

One one hand, explicitly passing the segment UUID to the repos makes it very clear that the queries are scoped by segment. On the other hand, a dev (me) may forget to add UUID filtering to a repository.

I think it would be safer to set the Segment UUID on the DB context at the start of a request, and use this to automatically scope all queries that occur during the request. If someone forgets to set the Segment UUID on the DB context, the query should fail/error.

Initiatives

Initiative:

  • Title
  • Body
  • Participants:
    • Person
    • <some info that i don't know what to name> standing? status? thoughts? idk.
  • Notes

Flesh out the People/Qualities datamodel

  • A user can have multiple people.
  • A person can have qualities.
  • Qualities can have Notes.
  • People can have Notes.
  • If a Person's Quality has a note, so does that person.
    All data is segmented.

The data should look something like this(?):

Image

Add search to people list

It should behave similar to the home-page search, but if the query string is empty then the person list should display all people.

The home-page search will eventually search across multiple datatypes (people, initiatives, notes, etc), so I want to keep the "people" specific search on the people page.

Replace random session tokens with JWT's

Right now our session tokens are just randomly generated values. This puts us at risk because we are forced to query the database in order to validate the token.

If we switch to JWT's, we can leverage their built-in signature validation to avoid db queries that are guaranteed to fail. Also, we can store the token expiration time in the jwt to avoid another scenario where we know we don't have to query the database.

Ideally, we only query the database when we know there is a good chance of a token being valid. We could also store additional user information in the jwt to avoid having to query for this on each request, but I actually like the idea of requiring a db query to complete token verification. This gives us the ability to revoke sessions before their expiration, and ensures that we don't operate on potentially stale user information.

Create User Identities + Authentication

This issue can be closed when we've configured a basic database to hold user identities and an API for authenticating users.

Non-goals:

  • Creating a secure store for personal user data.
  • Creating a front-end for users to log in

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.