Skip to content

Commit

Permalink
- Developing PWA features
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshathSai committed May 25, 2024
1 parent 8ee3795 commit d148ff3
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 11 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@
<artifactId>hyperscript.org</artifactId>
<version>0.9.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.progressify/progressify-spring -->
<dependency>
<groupId>org.progressify</groupId>
<artifactId>progressify-spring</artifactId>
<version>0.2.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ MicrosoftStoreRecord topRated(@PathVariable(value = "pgNo") int pgNo,
@PathVariable(value = "mediaType") String mediaType,
@PathVariable(value = "filteredCategories") String filteredCategories);

@GetExchange("video.topselling.movies&pgNo=1&noItems=12&mediaType=movies&filteredCategories=AllProducts&studioFilter=")
MicrosoftStoreRecord topSelling();

@GetExchange("video.toprented.movies&pgNo=1&noItems=12&mediaType=movies&filteredCategories=AllProducts&studioFilter=")
MicrosoftStoreRecord topRented();
@GetExchange("video.topselling.movies&pgNo={pgNo}&noItems={noItems}&mediaType={mediaType}&filteredCategories={filteredCategories}&studioFilter=")
MicrosoftStoreRecord topSelling(@PathVariable(value = "pgNo") int pgNo,
@PathVariable(value = "noItems") int noItems,
@PathVariable(value = "mediaType") String mediaType,
@PathVariable(value = "filteredCategories") String filteredCategories);

@GetExchange("video.toprented.movies&pgNo={pgNo}&noItems={noItems}&mediaType={mediaType}&filteredCategories={filteredCategories}&studioFilter=")
MicrosoftStoreRecord topRented(@PathVariable(value = "pgNo") int pgNo,
@PathVariable(value = "noItems") int noItems,
@PathVariable(value = "mediaType") String mediaType,
@PathVariable(value = "filteredCategories") String filteredCategories);

@GetExchange("video.collections.promo_marvelmovies&pgNo=1&noItems=48&mediaType=movies&filteredCategories=AllProducts")
MicrosoftStoreRecord MCUCollection();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.akshathsaipittala.streamspace.web.controllers;

import org.progressify.spring.annotations.StaleWhileRevalidate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class WebController {

@GetMapping("/")
@StaleWhileRevalidate
public String index() {
return "index";
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ management.endpoints.web.exposure.include=health,metrics
#server.ssl.bundle=web-server
#server.ssl.client-auth=none

spring.datasource.url=jdbc:h2:file:~/.h2;AUTO_RECONNECT=TRUE;
#spring.datasource.url=jdbc:h2:mem:db;AUTO_RECONNECT=TRUE;
spring.datasource.url=jdbc:h2:file:~/.h2
#spring.datasource.url=jdbc:h2:mem:db
spring.datasource.username=sa
spring.datasource.password=password
spring.datasource.driver-class-name=org.h2.Driver
Expand Down
Binary file added src/main/resources/static/assets/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/main/resources/static/assets/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Stream Space",
"short_name": "StreamSpace",
"icons": [
{
"src": "images/logo.png",
"sizes": "32x32",
"type": "image/png"
}
],
"start_url": "../",
"display": "standalone",
"background_color": "hsl(214, 27%, 26%)",
"theme_color": "hsl(214, 27%, 26%)"
}
Binary file added src/main/resources/static/favicon.ico
Binary file not shown.
24 changes: 20 additions & 4 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
xmlns:th="http://www.thymeleaf.org"
lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stream Space</title>
<title>StreamSpace</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">

<!--<link rel="stylesheet" th:href="@{/css/ZegoeLight-U.css}">-->
<!-- Bootstrap CSS -->
<link th:rel="stylesheet" th:href="@{/webjars/bootstrap/css/bootstrap.min.css}"/>
Expand All @@ -15,6 +19,18 @@
<script type="text/javascript" th:src="@{/webjars/hyperscript.org/dist/_hyperscript.js}"></script>
<!-- Bootstrap ICONS -->
<link th:rel="stylesheet" th:href="@{/webjars/bootstrap-icons/font/bootstrap-icons.css}">

<link rel="manifest" th:href="@{/assets/manifest.webmanifest}">
<link rel="apple-touch-icon" th:href="@{/assets/images/logo.png}" />

<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', ()=> {
navigator.serviceWorker.register('/sw.js');
});
}
</script>

<style>
/*@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');*/
/** {
Expand Down Expand Up @@ -307,7 +323,7 @@
autofocus
>
<!-- <span class="input-group-text" id="basic-addon2">search</span> -->
<!--<img id="spinner" class="htmx-indicator" src="/images/loader.svg" alt="Request In Flight..."/>-->
<!--<img id="spinner" class="htmx-indicator" th:src="@{/assets/images/loader.svg}" alt="Request In Flight..."/>-->
<!--<div id="globalProgress" class="globalProgress" style="height: 3px; background-color: white;">
<div class="indeterminate" style="background-color: red;"></div>
</div>-->
Expand Down

0 comments on commit d148ff3

Please sign in to comment.