A
A
AigizK2014-03-03 10:43:54
JavaScript
AigizK, 2014-03-03 10:43:54

How to make friends with JS project?

There is a project where a company is registered and gets its employees/clients. And those, in turn, fill in different tables or perform other actions. Now some basic functionality has been implemented, with the help of which a company can generate reports or receive notifications.
But this is not enough, it is necessary to give companies the opportunity to create their own logic on top of the current one.
For example: now when a task is created, an email notification is sent to the employee. What if this task is very important and you need to send another SMS notification.
Accordingly, the idea arose to implement additional functionality in the form of js scripts. Those. they write js code, and this code works as if it was written by us in a server-side language.
In this regard, the question is:
1. in which direction to dig?
2. Has anyone solved a similar problem and what did you encounter?
PS
All data in the database is stored as events. Any of your actions, up to pressing a button on a certain page, is an event that will be stored in our database. Therefore, having a list of events and such a tool, companies will be able to implement such logic that we simply would not have thought of or considered unnecessary. Also, we will not clog the project with logic that can be written in the form of js scripts.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yakov Akulov, 2014-03-03
@jakulov

I know people who implemented such a task, now we have 1C
In general, how do you imagine sending SMS through a javascript script?
On the topic: everything is quite feasible, you can enable users to hang custom callbacks on any events.
But writing these scripts, albeit in javascript, needs to be limited to some kind of API.
Those. there is a set of methods with documentation, these methods can be used by users in their scripts.
Those. stupidly create your own js-library with a set of functionality (API) that meets the subject area. And users are already calling these methods and doing something.
You can implement this, for example, on node.js, while limiting user scripts to a kind of sandbox (for example, allowing only API methods to be executed and no more).

A
AigizK, 2014-03-03
@AigizK

I agree that you need to create your own library. And you can send SMS with a Get-request (for example, smsc has such an opportunity). I'm more interested in how we should handle all this on the server.
Those. I want the user to be able to write some code in pure js + using our library, and on the server we must execute this code. The idea with Node.js is interesting, but I have the whole implementation in C # / ASP.NET MVC, I don’t really want to connect node.js there just for the sake of it.
Regarding security, each company will have its own database, and access to it will be ReadOnly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question