Skip to content

Commit 6b23dae

Browse files
committed
readme added and header buttons fixed
1 parent 77ff016 commit 6b23dae

File tree

4 files changed

+133
-70
lines changed

4 files changed

+133
-70
lines changed

README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Meta Clock project using React, Spring and PostgreSQL
2+
3+
**View on GitHub Pages:** https://zabrafax.github.io/spring-react-meta-clock/
4+
*Note: The server may take a few minutes to start.*
5+
6+
7+
## Meta Clock allows you to display time in an interesting and elegant way.
8+
9+
Inspired by [ *ClockClock 24* ](https://www.humanssince1982.com/en-eu/products/clockclock-24-white),
10+
created with React, Spring, Java and PostgreSQL. Web-application have different options to try.
11+
Once you find your perfect settings, you can display it on fullscreen. Have features like:
12+
13+
* Ability to choose custom theme colors
14+
* Time zone selection
15+
* Different clock grid variations
16+
* Ability to create an account
17+
* All settings are saved on the server when you are logged in
18+
* Account sensitive data is saved in hashed form
19+
* Auto authorization using tokens
20+
21+
22+
## Deployment & Hosting
23+
24+
* Backend deployed on Render
25+
* Frontend deployed automatically via GitHub Actions using Docker
26+
* Database hosted on Supabase
27+
28+
### Note:
29+
Due to free hosting, the server may take a couple of minutes to start.
30+
31+
32+
## How to launch
33+
34+
### View on GitHub Pages:
35+
36+
https://zabrafax.github.io/spring-react-meta-clock/
37+
*Note: The server may take a few minutes to start.*
38+
39+
### Manual launch:
40+
41+
1. Clone the repository:
42+
```bash
43+
git clone git@github.com:Zabrafax/spring-react-meta-clock.git
44+
cd spring-react-meta-clock
45+
```
46+
47+
2. Backend setup:
48+
```bash
49+
cd backend
50+
```
51+
52+
* Rename .env.example to .env:
53+
54+
```bash
55+
mv .env.example .env
56+
```
57+
58+
* Edit .env and provide your database connection details:
59+
60+
```ini
61+
SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/meta_clock_db
62+
SPRING_DATASOURCE_USERNAME=postgres
63+
SPRING_DATASOURCE_PASSWORD=postgres
64+
```
65+
66+
* Create the database meta_clock_db in PostgreSQL:
67+
68+
```sql
69+
CREATE DATABASE meta_clock_db;
70+
```
71+
72+
* Run the backend (Spring Boot):
73+
74+
```bash
75+
./mvnw spring-boot:run
76+
```
77+
78+
3. Frontend setup:
79+
```bash
80+
cd frontend
81+
```
82+
83+
* Rename .env.example to .env:
84+
85+
```bash
86+
mv .env.example .env
87+
```
88+
89+
* Install dependencies:
90+
91+
```bash
92+
npm install
93+
```
94+
95+
* Start the React app:
96+
97+
```bash
98+
npm start
99+
```
100+
101+
102+
## Technologies Used
103+
104+
* ![React](https://img.shields.io/badge/React-61DAFB?logo=react&logoColor=black)
105+
![JavaScript](https://img.shields.io/badge/JavaScript-F7DF1E?logo=javascript&logoColor=black)
106+
![HTML5](https://img.shields.io/badge/HTML5-E34F26?logo=html5&logoColor=white)
107+
![CSS3](https://img.shields.io/badge/CSS3-1572B6?logo=css3&logoColor=white)
108+
![npm](https://img.shields.io/badge/npm-CB3837?logo=npm&logoColor=white)
109+
![ESLint](https://img.shields.io/badge/ESLint-4B32C3?logo=eslint&logoColor=white)
110+
* ![Spring](https://img.shields.io/badge/spring-%236DB33F.svg?logo=spring&logoColor=white)
111+
![Java](https://img.shields.io/badge/Java-007396?style=flat&logo=openjdk&logoColor=white)
112+
![Apache Maven](https://img.shields.io/badge/Apache%20Maven-C71A36?logo=Apache%20Maven&logoColor=white)
113+
![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?logo=postgresql&logoColor=white)
114+
![Docker](https://img.shields.io/badge/Docker-2496ED?logo=docker&logoColor=white)
115+
* ![WebSocket](https://img.shields.io/badge/WebSocket-008080?logo=websocket&logoColor=white)
116+
![REST API](https://img.shields.io/badge/REST_API-61DAFB?logo=rest&logoColor=white)
117+
![JWT](https://img.shields.io/badge/JWT-000000?logo=jsonwebtokens&logoColor=white)
118+
119+
120+
## Future Improvements
121+
122+
Adding different animations.
123+
124+
#### Created by [@Zabrafax](https://github.com/Zabrafax)

frontend/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REACT_APP_API_BASE=http://localhost:8080/api

frontend/README.md

Lines changed: 0 additions & 70 deletions
This file was deleted.

frontend/src/components/Header.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,29 @@ function Header({ onAccountClick, onSettingsClick, onAboutClick, onFullscreenCli
77

88
function handleAccountClick(e) {
99
e.preventDefault();
10+
e.currentTarget.blur();
11+
1012
onAccountClick();
1113
}
1214

1315
function handleSettingsClick(e) {
1416
e.preventDefault();
17+
e.currentTarget.blur();
18+
1519
onSettingsClick();
1620
}
1721

1822
function handleAboutClick(e) {
1923
e.preventDefault();
24+
e.currentTarget.blur();
25+
2026
onAboutClick();
2127
}
2228

2329
function handleFullscreenClick(e) {
2430
e.preventDefault();
31+
e.currentTarget.blur();
32+
2533
onFullscreenClick();
2634
}
2735

0 commit comments

Comments
 (0)