-
Welcome to TaskNote App
-
+
+
+
Welcome to TaskNote
+
Your best friend to keep up with notes and tasks!
@@ -71,7 +71,6 @@ function Landing(): JSX.Element {
-
);
}
diff --git a/client/src/views/Landing/styles.scss b/client/src/views/Landing/styles.scss
index c9121e6..392da0f 100644
--- a/client/src/views/Landing/styles.scss
+++ b/client/src/views/Landing/styles.scss
@@ -1,3 +1,62 @@
-body {
- background-color: #ccc;
+$primary-color: #61cd8d;
+$light-bg: #f8f9fa;
+$dark-text: #343a40;
+
+.landing-page {
+ position: relative;
+ text-align: center;
+ color: $dark-text;
+ background: url('../../assets/landing-bg.jpg') no-repeat center center;
+ background-size: cover; // Ensures the image covers the whole background
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(255, 255, 255, 0.85); // Slight white overlay for text readability
+ z-index: 1;
+ }
+
+ div {
+ position: relative;
+ z-index: 2; // Ensures the content is above the background and overlay
+ }
+
+ h1 {
+ font-size: 2.5rem;
+ font-weight: 700;
+ margin-bottom: 1rem;
+ color: $dark-text;
+ }
+
+ p {
+ font-size: 1.25rem;
+ margin-bottom: 2rem;
+ color: $dark-text;
+ }
+
+ .btn-lg {
+ font-size: 1rem;
+ padding: 0.75rem 1.5rem;
+ }
+
+ .btn-primary {
+ background-color: $primary-color;
+ border-color: $primary-color;
+ &:hover {
+ background-color: darken($primary-color, 10%);
+ }
+ }
+
+ .btn-outline-primary {
+ color: $primary-color;
+ border-color: $primary-color;
+ &:hover {
+ background-color: $primary-color;
+ color: #fff;
+ }
+ }
}
diff --git a/client/src/views/Login/index.tsx b/client/src/views/Login/index.tsx
index 8bbffe6..5946c60 100644
--- a/client/src/views/Login/index.tsx
+++ b/client/src/views/Login/index.tsx
@@ -4,8 +4,9 @@ import React, {
import {
Alert, Button, Card, Col, Container, Form, Row
} from 'react-bootstrap';
-import { useNavigate } from 'react-router-dom';
+import { Link, useNavigate } from 'react-router-dom';
import AuthContext from '../../context/AuthContext';
+import './styles.scss';
/**
* Login page component.
@@ -45,6 +46,7 @@ function Login(): JSX.Element {
const form = event.currentTarget;
if (form.checkValidity() === false) {
setFormInvalid(true);
+ setErrorMessage('Please fill in your username and password!');
return;
}
@@ -65,12 +67,12 @@ function Login(): JSX.Element {
useEffect(() => {}, [formInvalid]);
return (
-
+
- Login
+ Login
{formInvalid ? (
@@ -80,12 +82,12 @@ function Login(): JSX.Element {
- Email address
+ Email
@@ -95,7 +97,7 @@ function Login(): JSX.Element {
required
type="password"
name="password"
- placeholder="Password"
+ placeholder="Type your password here"
/>
@@ -109,16 +111,16 @@ function Login(): JSX.Element {
- Don't have an account?
-
- Register
-
+ Don't have an account yet?
+
+ Register here
+
diff --git a/client/src/views/Login/styles.scss b/client/src/views/Login/styles.scss
new file mode 100644
index 0000000..17a682f
--- /dev/null
+++ b/client/src/views/Login/styles.scss
@@ -0,0 +1,62 @@
+$primary-color: #61cd8d;
+$light-bg: #f8f9fa;
+$dark-text: #343a40;
+
+.login-page {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ min-height: 100vh;
+ background: url('../../assets/landing-bg.jpg') no-repeat center center;
+ background-size: cover;
+
+ &::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(255, 255, 255, 0.85); // White overlay for readability
+ z-index: 1;
+ }
+
+ .card {
+ position: relative;
+ z-index: 2;
+ border: none;
+ border-radius: 8px;
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
+ }
+
+ h2 {
+ font-size: 1.75rem;
+ font-weight: 600;
+ margin-bottom: 1.5rem;
+ color: $dark-text;
+ }
+
+ .form-control {
+ border-radius: 5px;
+ }
+
+ .btn-primary {
+ background-color: $primary-color;
+ border-color: $primary-color;
+ &:hover {
+ background-color: darken($primary-color, 10%);
+ }
+ }
+
+ .text-center a {
+ color: $primary-color;
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+
+ .alert-danger {
+ background-color: rgba(255, 0, 0, 0.1);
+ border-color: rgba(255, 0, 0, 0.3);
+ }
+}
diff --git a/client/src/views/Register/index.tsx b/client/src/views/Register/index.tsx
index fda143d..0a99475 100644
--- a/client/src/views/Register/index.tsx
+++ b/client/src/views/Register/index.tsx
@@ -4,7 +4,7 @@ import React, {
import {
Alert, Button, Card, Col, Container, Form, Row
} from 'react-bootstrap';
-import { useNavigate } from 'react-router-dom';
+import { Link, useNavigate } from 'react-router-dom';
import AuthContext from '../../context/AuthContext';
/**
@@ -45,6 +45,7 @@ function Register(): JSX.Element {
const form = event.currentTarget;
if (form.checkValidity() === false) {
setFormInvalid(true);
+ setErrorMessage('Please fill in your username and password!');
return;
}
@@ -65,12 +66,12 @@ function Register(): JSX.Element {
useEffect(() => {}, [formInvalid]);
return (
-
+
- Create account
+ Create account
{formInvalid ? (
@@ -80,12 +81,12 @@ function Register(): JSX.Element {
- Email address
+ Email
@@ -95,7 +96,7 @@ function Register(): JSX.Element {
required
type="password"
name="password"
- placeholder="Password"
+ placeholder="Type your password here"
/>
@@ -104,25 +105,21 @@ function Register(): JSX.Element {
type="submit"
className="w-100"
>
- Login
+ Sign-up and register
diff --git a/server/src/main/java/br/com/tasknoteapp/server/response/SummaryResponse.java b/server/src/main/java/br/com/tasknoteapp/server/response/SummaryResponse.java
index 5aab782..c94b453 100644
--- a/server/src/main/java/br/com/tasknoteapp/server/response/SummaryResponse.java
+++ b/server/src/main/java/br/com/tasknoteapp/server/response/SummaryResponse.java
@@ -1,3 +1,4 @@
package br.com.tasknoteapp.server.response;
-public record SummaryResponse(Integer pendingTaskCount, Integer doneTaskCount) {}
+public record SummaryResponse(
+ Integer pendingTaskCount, Integer doneTaskCount, Integer notesCount) {}
diff --git a/server/src/main/java/br/com/tasknoteapp/server/service/impl/HomeServiceImpl.java b/server/src/main/java/br/com/tasknoteapp/server/service/impl/HomeServiceImpl.java
index e162976..0619603 100644
--- a/server/src/main/java/br/com/tasknoteapp/server/service/impl/HomeServiceImpl.java
+++ b/server/src/main/java/br/com/tasknoteapp/server/service/impl/HomeServiceImpl.java
@@ -31,11 +31,13 @@ class HomeServiceImpl implements HomeService {
public SummaryResponse getSummary() {
log.info("Getting summary");
List tasks = taskService.getAllTasks();
+ List notes = noteService.getAllNotes();
long doneCount = tasks.stream().filter(t -> t.done() == true).count();
long undoneCount = tasks.stream().filter(t -> t.done() == false).count();
+ int taskCount = notes.size();
- return new SummaryResponse((int) undoneCount, (int) doneCount);
+ return new SummaryResponse((int) undoneCount, (int) doneCount, taskCount);
}
/**
diff --git a/server/src/test/java/br/com/tasknoteapp/server/controller/HomeControllerTest.java b/server/src/test/java/br/com/tasknoteapp/server/controller/HomeControllerTest.java
index 6a3516c..6354b06 100644
--- a/server/src/test/java/br/com/tasknoteapp/server/controller/HomeControllerTest.java
+++ b/server/src/test/java/br/com/tasknoteapp/server/controller/HomeControllerTest.java
@@ -35,7 +35,7 @@ class HomeControllerTest {
@DisplayName("Get summary happy path should succeed")
@WithMockUser(username = "user@domain.com", password = "abcde123456A@")
void getSummary_happyPath_shouldSucceed() throws Exception {
- SummaryResponse response = new SummaryResponse(0, 6);
+ SummaryResponse response = new SummaryResponse(0, 6, 2);
when(homeService.getSummary()).thenReturn(response);
@@ -48,13 +48,14 @@ class HomeControllerTest {
.andExpect(status().isOk())
.andExpect(jsonPath("$.pendingTaskCount").value(response.pendingTaskCount()))
.andExpect(jsonPath("$.doneTaskCount").value(response.doneTaskCount()))
+ .andExpect(jsonPath("$.notesCount").value(response.notesCount()))
.andReturn();
}
@Test
@DisplayName("Get summary user not authorized should fail")
void getSummary_userNotAuthorized_shouldFail() throws Exception {
- SummaryResponse response = new SummaryResponse(0, 6);
+ SummaryResponse response = new SummaryResponse(0, 6, 2);
when(homeService.getSummary()).thenReturn(response);