GithubHelp home page GithubHelp logo

seinecle / nocodefunctions-web-app Goto Github PK

View Code? Open in Web Editor NEW
34.0 4.0 5.0 27.67 MB

The code base of the front-end of nocodefunctions.com

Home Page: https://nocodefunctions.com

HTML 33.11% Java 30.43% JavaScript 0.22% CSS 36.21% Batchfile 0.02%
data-science java nocode webapp jakarta-faces network-analysis nlp sentiment-analysis topic-modeling data-processing

nocodefunctions-web-app's Introduction

Nocodefunctions: web platform for data analysis for non coders

free, click & point, no registration, open source

Just visit https://nocodefunctions.com

Goal, vision

Nocodefunctions is a web app which makes best-in-class data analysis functions available to all. See more details

1. free

The app is free with no limitation on usage

2. functions in text mining, graph mining and more

Text mining:

Pdf mining:

Graph mining:

Tools:

2. no registration

There is no login asked and no installation. No credit card required. The aim is to make it as easy and seamless as possible for you to work.

3. no code

All the functions are click and point. No coding skill needed.

4. open source

You are here on the Github repository which hosts the code of the web app. The license is Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License: https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode

Most of the functions have their dedicated repository. See the list of all repos tied to Nocodefunctions.

5. Respectful of your data

The data is not stored nor re-used in any way.

6. Available in 107 different languages

See more details.

7. Contributing

Contributions are welcome:

  • request for new functions?
  • reporting a bug, a bad translation?
  • contributions to the code, design or else

You can open an issue here or send an email to [email protected]

8. Blog

Frequent posts about nocodefunctions: https://nocodefunctions.com/blog/

9. Author

Nocodefunctions is developed since July 2021 by Clement Levallois (on Mastodon, on Twitter)

nocodefunctions-web-app's People

Contributors

seinecle avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

nocodefunctions-web-app's Issues

Navigating to a new page after a long running operation: welcoming suggestions

[tl;dr] https://twitter.com/seinecle/status/1748615007363829827

Background: how is this part of the app architectured

This (free, open source) app helps users analyze their data with text mining and network analysis. Different operations are possible, they are called "functions".

Functions typically take 1 second to a few minutes to run. The function called "Cowo" is the one where I experiment new ways to make the wait and the experience as good to the user as I can, while the function is running. When I'll get it right, I'll model the other functions in the same way.

The architecture is quite exotic, but I stand by it. Here it is:

  • the user uploads one or several files containing the text they want to analyze. The text content is persisted on disk as a single file, the name of the file is a "data persistence id" which is unique to this dataset.

  • the user then navigates to the cowo.html page, where they can set a few options to fine tune how the function will run. On this page, they click on a CommandButton "compute" which executes the runAnalysis() method in CowoBean, which is a Session Scoped Bean hosting the fields and methods related to this function.

  • the method runAnalysis() launches two methods in succession, each designed to return quickly, so the runAnalysis() method returns almost immediately:

public void runAnalysis() {
        progress = 0;
        runButtonDisabled = true;
        gexfHasArrived = false;
        sendCallToCowoFunction();
        getTopNodes();
    }

sendCallToCowoFunction() sends a GET request to the API endpoint (locally hosted) which runs the actual function Cowo. The API endpoint executes the function asynchronously, so the GET request returns almost immediately.

The results of the function are stored on disk with a file.

getTopNodes() is used to extract a sample of the results returned by Cowo. The method creates a new thread and executes all its code in this new thread, so the method returns immediately.

Communication and orchestration between the front-end and the different parts of the backend

How are all these different steps orchestrated, and how is the user alerted that the end results have arrived?

Things that are weird (but I am ok with them)

  • using the file system (instead of db) as a way to store intermediary results and share them between processes
  • having functions located in different sub-systems sending messages through http calls, and having an Application Scoped "WatchTower" Bean centralizing these messages.

I see it as a way to avoid using frameworks that would professionally handle of all of this. I have a taste for keeping things as framework-free as a I can.

Things that are not satisfying (and finally, the question!)

  • I don't like polling from the front-end to wait for results and execute things when they arrive. This is largely a matter of taste. I would prefer the backend to execute the navigation by itself when it has finished running the function.
  • and this is where I have a question: spinning a new thread running an asynch method, it would be able to return to the original Session Scoped when the results have arrived, with a callback. And the Session Scoped bean would then do a page redirect!. But the callback function cannot execute a page navigation because somehow, the state of the session is not recognized/ maintained / reconciled? Here is:
@Stateless
public class LongRunningProcessBean {

    @Asynchronous
    public void executeLongRunningOperation(Consumer<String> callback) {
        // retrieve topNodes...

        // Invoke the callback when top nodes have bee retrieved
        callback.accept("success!");
    }
}

@Named
@SessionScoped
public class CowoBean {

    @EJB
    private LongRunningProcessBean longRunningProcessBean;

    public void startLongRunningOperation() {
        longRunningProcessBean.executeLongRunningOperation(this::onOperationComplete);
    }

    private void onOperationComplete(Strint result) {
            FacesContext context = FacesContext.getCurrentInstance(); // **error, not able to retrieve Context**
            context.getApplication().getNavigationHandler().handleNavigation(context, null, "/cowo/results.xhtml?faces-redirect=true");
    }
}

If that would work, that would be more elegant than a polling or a while () loop running and waiting for a result, right?

But FacesContext context = FacesContext.getCurrentInstance(); returns an error because the multi-thread design doesn't go well with the single thread model of JSF (or is it JakartaEE?). As a solution, it might be possible to:

  • pass on an httpsession object to the asynch method startLongRunningOperation()
  • having this same httpsession object passed back to the callback
  • using this httpsession object to retrieve the original, correct FacesContext.getCurrentInstance(); and hence enable a navigation to whatever page, maintaining the state of this user session.

But I don't have a clear view on how doing that. Thanks for your help!

Dúvida

Qual eu uso pra criar um ERP, Adianti Builder ou Bubble?

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.