Questions tagged [single-page-application]

A single-page application (SPA) is a web application that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application.

A single-page application (SPA), also known as single-page interface (SPI), is a web application or web site that fits on a single web page with the goal of providing a more fluid user experience akin to a desktop application.

In an SPA, either all necessary code – HTML, JavaScript, and CSS – is retrieved with a single page load, or partial changes are performed loading new code on demand from the web server, usually driven by user actions. The page does not automatically reload during user interaction with the application, nor does control transfer to another page. Updates to the displayed page may or may not involve interaction with a server.

Resources

5306 questions
11
votes
8 answers

Architecture for single page application (JavaScript)

I wanted to understand the overall architecture for designing single page application (mainly through JavaScript) Let's say I have a login page (Usernam/Password) and on successful authentication, I am shown the homepage. Now both the login and…
11
votes
1 answer

Login to Single Page Application with Google authentication and Google Oauth 2.0

We are developing an SPA - full client base javascript application and need to authenticate our users to get access to the internals. As I found from the search we can outsource our authentication mechanism and use Google accounts for that. I…
11
votes
2 answers

Are there best practices/patterns for synchronizing local and remote data in SPA (html5 single page applications)?

I'm writing a simple "todo - helloworld" with jqueryMobile + knockout + breeze + WebAPI to learn about SPAs (Single Page Application) in a mobile context (unreliable internet connection) To enable offline usage the WebApp will leverage Application…
10
votes
2 answers

How to host an Angular app inside .NET Core 3.1 WebAPI?

I want to provide my Angular app through the root route / and the REST API through /api/*. For the Angular routing I have to redirect all requests to /index.html except the requests for existing files (e.g. media files) and my API controller routes.…
10
votes
1 answer

How to configure dotnet core 3 to serve up React SPA while using Http.sys and a URLPrefix?

After changing the URLPrefix I get the following error: The SPA default page middleware could not return the default page '/index.html' because it was not found, and no other middleware handled the request. Something thus is required to tell…
Steven T. Cramer
  • 1,508
  • 1
  • 18
  • 34
10
votes
2 answers

Best practice for multiple Vue instances/apps in Laravel

What I want to create is a web application with Laravel Lumen and VueJS, where Laravel Lumen is used for an API and VueJS for a SPA. In the application I want an admin section, a small forum and the website. I want to reuse this concept in future…
10
votes
1 answer

Client Side Deep Links with WebpackDevMiddleware 404s

I am using the WebpackDevMiddleware for Development builds to serve up a Vue.js application that uses client-side routing. The SPA application is served up from the root url just fine, but if I attempt to use any client-side deep links, I get a…
NotMyself
  • 29,209
  • 17
  • 56
  • 74
10
votes
3 answers

How to create a vanilla JS routing for SPA?

I'm creating a web app with no frameworks/tools/libraries, all Vanilla JS. I'm doing it in more of a 'React' style. I'd like to call a view that is in my views/pages/dashboard.js, display that view and change the URL when the user clicks the…
user10760738
10
votes
1 answer

Bugs in Sidebar Menu with React Router V4

I'm developing a single-page ReactJS Web app but I know I'm doing something wrong while defining my routing with React Router V4. My problem is as follows: PrivateRoute in my routes.js file is not working as expected. That is, I don't know why but…
Julia
  • 509
  • 1
  • 7
  • 19
10
votes
1 answer

authorization in a SPA or client side app

So I've been trying to find out best practices on how to tackle authorization, not authentication, in a SPA app. Say I have a client side MVC (angular, vuejs, etc ..) with an api backend, how do we manage using authorizations for the app? For…
10
votes
4 answers

"Please add a @NgModule annotation" Error on Angular2

I have made a custom angular2(5.0.x) module that looks like this : import { GuageService } from './services/guage.service'; import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { GuageComponent } from…
pxr_64
  • 510
  • 1
  • 8
  • 23
10
votes
3 answers

How to fetch local html file with vue.js?

I am following this example I am trying to load a html file with vue.js and add into my template. my attempt: HTTML:
ThunD3eR
  • 3,216
  • 5
  • 50
  • 94
10
votes
3 answers

Load a SPA webpage via AJAX

I'm trying to fetch an entire webpage using JavaScript by plugging in the URL. However, the website is built as a Single Page Application (SPA) that uses JavaScript / backbone.js to dynamically load most of it's contents after rendering the initial…
KyleMit
  • 30,350
  • 66
  • 462
  • 664
10
votes
2 answers

Visual Studio Single Page Application Integration

Technology: Visual Studio 2017 Asp.Net Core Tooling 1.1 .Net Framework 4.6.2 Single Page Application's and their integration into Visual Studio have become easier, with all the new support built into Visual Studio. But earlier in the week,…
Greg
  • 11,302
  • 2
  • 48
  • 79
10
votes
1 answer

Advanced Matching with New Facebook Pixel in Javascript Web App

I have a single page javascript application, in which I am trying to implement Advanced Matching with the New Facebook Pixel to give us better attribution on our Ads. We currently init the FB pixel when the app is first loaded, then fire standard…