Comments (8)
We went for using GitHub gist as the database. 😅
from editor-backend.
@domoritz @siddhant1 I tried to research as much as possible but I would really like your suggestions on this.
from editor-backend.
Thank you for writing this up!
https://github.com/elastic/elasticsearch-js is an up-to-date library for Elasticsearch. I also found that you can search over specific fields.
One other issue we need to look into is ranking search results. As far as I can see it, Mongo or Postgres don't have a good way to rank search results. Github and Wikipedia are using Elasticsearch for searching. I see that Mongo or PG are a better fit for data storage but I'm not convinced that they make a better search index.
from editor-backend.
@domoritz Yeah, their usage seems pretty similar to MongoDB only. But storing user information can only be supported in PG or MongoDB. bl.ocks.org were also using MongoDB for authentication and elasticsearch for searching.
So I am still unsure how searching will happen when things are stored across two collections in elasticsearch DB(here users and gist).
Blocks was able to do it since it had the user id as the GitHub handle itself so it simply requested GitHub api for its gist. But in our case, I am planning to have a custom user_id which will be unique. This will ensure extending this platform in a way that the code of visualizations can also be stored somewhere else than just GitHub gist.
Having a user model will help us extend the platform. Otherwise, I guess we can just have one document for gist which will store the gist information and the user it is uploaded by. The latter case will require the user to be registered from one single platform only.
from editor-backend.
I see. How about we go the simple route for now and only support github? Then we don't need to store the user and we don't need to do our own authentication. We hopefully can spin up a service in a month or so and then take it from there?
from editor-backend.
@domoritz okay ✌🏽 I will research a little about the ouath process as well. I think we would only need to create session variables on front-end when authenticated. Need not store anything more.
from editor-backend.
Instead of writing the whole authentication process ourselves , have a look at passport.js
from editor-backend.
@siddhant1 yeah, obviously. I was talking about the response given back by GitHub API after authentication. Will we need to store any relevant information from it?
from editor-backend.
Related Issues (20)
- Move code here
- Setup simple deployment HOT 3
- de-duplicate setup instructions
- Should we set the Same Site attribute?
- Can't run in dev mode HOT 1
- Sign in does not work on Safari HOT 13
- Add tests
- Add favicon HOT 2
- Don't use deprecated authentication api HOT 1
- Replace now with vercel HOT 4
- Add pagination to gist fetching HOT 1
- Add link to docs HOT 1
- Sign-in link at https://vega.now.sh/ doesn't work HOT 7
- Make backend stateless
- Implementation of pagination HOT 1
- Use yarn HOT 5
- Session cookie expiration doesn't increment on browser cookie storage when re-visited HOT 1
- Switch to vega-lite-dev-config HOT 2
- Request GIST permission for github HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from editor-backend.