Hot answers tagged

6

I work on a code base in a compiled language (Scala) which is tens if not hundreds of thousands of lines long. The first thing commonly done in such situations is to break the application into microservices that usually max out at two or three thousand lines of code each, spread out among maybe 50 source files. Many are much smaller. Next, as others have ...


5

You're asking the classic multi-tenant question. Personally I would - and have - maintain a single copy of the application. It would look up the subdomain in the db to grab a site id, grab the info about the site, and show the relevant content. Templates and images can be stored by putting them into a directory named the same as their subdomain or site ...


3

Both solution are viable, they simply don't apply to the same use-cases. a) manipulate the DOM via JavaScript : This result in a more heavy first page, but after that you will use less bandwidth, because you will only fetch what you need, and not rebuild and send everything. And in the cases where you don't need to fetch anything, it will be really quick (...


2

dynamically appending new code on the rendered page in a way that the changes would reflect on the other clients And this makes it possible to do XSS, mislead the users into providing confidential data such as passwords, and do lots of other cool stuff. You can't just let the users change the source code and run it, unverified, in other people's browsers. ...


2

Ahmed, Web pages can be built in just html. In fact, that's how the web started out: with just simple html pages, things we would call today "brochure-ware". The user requests a page and the server delivers a mixture of text and pictures, and then it's done. There is no interactivity, like individual preferences or searching a database. PHP came later ...


2

You may have to modify the base template you are using for the static page generator to accomplish your goals. Add the javascript libraries/frameworks you need for the individual entries on the main template. Then, as you are creating your entries, add the relevant javascript code to the blog entry to perform the necessary interactions for your readers.


1

There's a widely used tool for Java which allows you to reload classed on the fly when they are recompiled. I've used it and it's reliable for the kind of thing you are talking about. Combine that with an IDE that compiles each class on saving (faster than I can blink,) it's basically just like what you describe. I don't know if anything like that exists ...


1

With a little guidance from @RobertHarvey I found a StackOverflow answer about Presentation Models. A presentation model is a utility class that is used to render data on a screen or report. Presentation models are typically used to model complex data structures that are composed from data from multiple DTO’s. Presentation models often represent a ...


1

I see all websites (THE big ones) make both PHP and HTML in same page .. Do I need to make all my website pages as PHP and embedded HTML inside it ? The fundamental problem here is that you're seeing a thing that websites you perceive as being big ones and then you're assuming that's a good thing to do. It's not. PHP is terrible enough on its own; ...


1

You could also go for the middle ground here: use Parse Server + Parse Dashboard. You'll need to get familiar with it to set it up, but it's battle proven, and has many of the features you want: Maintained by Facebook for a very long time, and they're pretty good at authentication It's open source, has a large community, and follows semver, so should be ...


1

Usually you have to query DB every time you render a page. Q1 - Yes, you just have to select all items ordered by created date (well, you don't want to select ALL, but only how much you need for current page - see 'Pagination') Q2 - Yes. Same as above. This might not work exactly as you want, because SQL databases are not search engines. In SQL DB you can ...


1

I am not a lawyer but my understanding is that as long as you are not distributing the software, you don't need to do anything special. You are free to use it for commercial uses. This license was created before the concept of the cloud and the AGPL was created to address this loophole: http://www.gnu.org/licenses/why-affero-gpl.en.html



Only top voted, non community-wiki answers of a minimum length are eligible