Git Product home page Git Product logo

express-objection-starter's People

Contributors

dependabot-preview[bot] avatar janejeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

orlgln

express-objection-starter's Issues

Active sessions

  • list all current sessions for a user
  • track location/IP/device/etc for each session
  • allow revoking sessions manually
  • update the updatedAt time every time the session is used, not created
  • Somehow parse IP into geolocation (country/city would be enough), either server-side or client-side

Finer control of admin actions

  • Admins shouldn't be able to affect other admins' status
  • Allow admins to "step down" on their own

Update tests! Should I have an "owner" role?

Do we need ajv-errors?

I'm only using ajv-errors for is the username verification. However, that should be done in the frontend... does that mean I can take off this dependency?

Cleaner way of mapping environment variables?

DATABASE_URL needs to be mapped to database:connection (IF it exists), and the same can go for BONSAI_URL and whatever config elasticsearch takes in... can we have a central place to manage this?

Test ways of injecting settings

createValidator as a one-time hook and setting this.foo = bar might not work/persist. Check that the jsonSchema, relationMappings, and whatever else is injected in #21 actually works (better yet, write a test!)

Online counter

Really stretching it, but having the counter would serve as an example for online systems using Redis

Database-agnostic streaming replication

If we want FTS via external document stores, then we need to pipe changes from the "truth store" to the search index.

While there are native ways to stream changes (such as zombodb for Postgres), 1. you often can't install plugins in DBaaS providers, 2. it doesn't work for different db's, 3. how would you even filter objects (e.g. private) and properties?

Using the bulk update option in #34, it might be possible to do this by running a repeating job that checks for last "updated_at" (inclusive, since we don’t care if we have to do it more than once; plus, this way we don’t lock the table), drags all objects and push them to the search index.

And we can avoid locking by keeping a "bookmark" thru job data (eliminating the need for transactions) instead.

https://gocardless.com/blog/syncing-postgres-to-elasticsearch-lessons-learned/

Add email verification

  • Setup email
  • Route for re-requesting verification email
  • Route for account recovery/password reset

Improve hooks (git and npm)

While we want the whole "setup" thing to run automatically (especially after pulling, since people always forget to do that), it's annoying that it runs after yarn add!

I only want it to run on these cases:

  • after a git pull (except in CI)
  • before a yarn test
  • after a production push

Provide encryption for production config

I've tried experimenting with this but I have NO idea how to make it work!

Ideally, the workflow would be like:

  1. write to a template production YAML file (that is based on production.example.yml) to make changes
  2. run something that'll produce the encrypted production.yml
  3. read that encrypted production.yml that can be committed

How the fsck do I do step 2?

CI pipeline

  • npm publish (when tag is present)
  • automated GitHub release?

Automatically delete images

Might be related to #35, but to avoid storage buildup, we either need all images to "expire" at some point, or have some kind of mechanism to delete images when their parent resources are deleted and/or changed (e.g. avatar change)

Implement flash messages

Should come before #4.

In addition, on every error, we should redirect to the page it was at and display the flash

Continuous deployment

Write an example CircleCI config to push directly to Heroku, perhaps using the Orb?

Goes hand-in-hand with #23.

Make express-sslify optional based on config

Ideally, redirecting HTTP => HTTPS should be handled by the reverse proxy. But if you're directly exposing Heroku API, then you kinda need it.

This would also be a good time to look at the whole "reverse proxy" section of config

Reduce the number of calls to Redis

We have to make a call to Redis for active session support, and another call to Redis for rate limiting, on every request. Can we cut this down into 1?

Automatically watch files

A lot of things need to happen automatically:

  • typescript generation from json schema
  • json generation from yaml files
  • prettier/eslint/whatever

The goal is to make them run automatically, but not unnecessarily:

  • linting should happen only before a commit, and shouldn't trigger a restart (i.e. nodemon)
  • json generation should happen every time yaml file changes during development, and should be done before running any tests
  • typescript generation would be a "nice to have" feature during development, but could be considered part of linting as well.

Ideally, these should be handled by hooks.

Look at https://github.com/chrisvfritz/vue-enterprise-boilerplate for "inspiration"

Rewrite active sessions

The way it's implemented in #10, SCAN takes O(n) time in relation to the total number of keys on Redis, which is obviously not performant.

I could also write it the way GitLab does, but managing the extra set and somehow expiring them (sets don't expire, so over time there will be a buildup of sessions from people who don't use the service anymore) seems like a huge PITA.

Finally, this would be a good opportunity to rethink the way to store and query sessions entirely, as per #13.

Parallel DB testing

Objection.js and db-errors both support sqlite3, mysql, postgres, and mssql. That means this repo needs to be tested against all of those.

https://circleci.com/docs/2.0/workflows/

  • Set up build matrix on CircleCI
  • Rewrite "magic queries" on the base class to make it work on all databases (.returning('*) tricks)

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.