Coder Social home page Coder Social logo

gogive's Introduction


My Skill Set

Frontend

JavaScript TypeScript

Backend

Go dotnet

DevOps

Docker Kubernetes Git Bash

Tools

Linux Vim Goland Kitty

Connect with me





---- My last publication:

Go and copies


Quote of today :

If debugging is the process of removing software bugs, then programming must be the process of putting them in. - E. W. Dijkstra


Octo Ring logo
previousrandomnext
check out other GitHub profiles in the Octo Ring

gogive's People

Contributors

khatibomar avatar

Watchers

 avatar

gogive's Issues

Currently analytic will lost data is users delete posts

Currently analytic will lost data is users delete posts
So to fix that there is two option in mind
Do a shadow delete by adding an deleted default false , then put it delete=true when the user delete something.
and do indexing on the deleted for faster access.
this can cause the database to slow down if lot of items have been deleted.

the fix two is to create an alternate table with _delete suffix to store deleted items then doing an view that will join those two tables , so analytic can access this table to do queries.

Likely will go with solution two because it's a good chance to use views.

Phone and image url are entered as empty string instead of null

Phone and image url are entered as empty string instead of null which can be problematic later

SELECT id, pcode, user_id, category_id, created_at, name, quantity, image_url, version
FROM public.items;

image

SELECT id, pcode, user_id, category_id, created_at, name, quantity, image_url, version
FROM public.items 
WHERE image_url=null;

image

Limiting Requests for users

Current idea is to limit the number of donations that a user can receive or Request.

func (app *application) showItemHandler(w http.ResponseWriter, r *http.Request) {

so in this method is good to check if the current user status if it's:

  • anonymous -> Return some random data like XXXXXXXX on user details.
  • if it's an authorized user :
    1. check if the user already reveal this item , return full details about item and owner
    2. if the user doesn't reveal the item before , treat it same as anonymous user.
      when the user click the button to reveal , check in the actions history table , see if the user have made >= N ( where N is number of revealing happens in last span of time likely a month) if it's <= N , fetch the data again but this time uncensored.

hiding the owner details is useful because if the user already revealed the name of the owner likely that the number is the same , so better to censor all the data like name , phone , email...

func (app *application) authenticate(next http.Handler) http.Handler {

this middleware will ensure that we can know the user information if it's anonymous or not. so I should do something like

user := app.contextGetUser(r)

to get the user information , after that I can implement SQL necessary to fetch required data likely doing an JOIN on users,items and revealing history tables or "better" using an VIEW that will already join those tables.

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.