Skip to content

Commit 5dabf98

Browse files
committed
feat: add react project and files
1 parent 5656867 commit 5dabf98

File tree

11 files changed

+100
-54
lines changed

11 files changed

+100
-54
lines changed

.docker/docker-compose.dev.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ services:
55
image: postgres:13
66
restart: unless-stopped
77
container_name: example-api-database
8-
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
8+
command:
9+
[
10+
"postgres",
11+
"-c",
12+
"log_statement=all",
13+
"-c",
14+
"log_destination=stderr"
15+
]
916
ports:
1017
- "5432:5432"
1118
environment:
@@ -17,7 +24,7 @@ services:
1724
volumes:
1825
- ./.volumes/database:/var/lib/postgresql/data
1926
networks:
20-
- example-api
27+
- simple-network
2128
tty: true
2229

2330
api:
@@ -38,12 +45,12 @@ services:
3845
- ./.volumes/maven:/root/.m2
3946
working_dir: /app
4047
networks:
41-
- example-api
48+
- simple-network
4249
tty: true
4350
entrypoint: "mvn spring-boot:run"
4451

4552
web:
46-
build:
53+
build:
4754
context: ../web
4855
dockerfile: ../web/docker/Dockerfile.dev
4956
image: node:16.14.2
@@ -55,10 +62,10 @@ services:
5562
- ../web:/app
5663
working_dir: /app
5764
networks:
58-
- example-api
65+
- simple-network
5966
tty: true
6067
entrypoint: "npm run dev"
6168

6269
networks:
63-
example-api:
64-
driver: bridge
70+
simple-network:
71+
driver: bridge

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
java openjdk-17.0.1
22
maven 3.8.4
3+
nodejs 16.17.0

web/docker/Dockerfile.dev

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
FROM node:16.14.2
22

3-
WORKDIR /app
4-
53
EXPOSE 3000
64

7-
COPY . .
5+
WORKDIR /app
86

9-
RUN npm install
7+
COPY . .
108

11-
ENTRYPOINT [ "npm", "run", "dev" ]
9+
RUN npm install

web/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5+
<link rel="preconnect" href="https://fonts.googleapis.com">
6+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
7+
58
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
69
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
11+
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400&display=swap" rel="stylesheet">
712

8-
<title>Spring CRUD</title>
13+
<title>Spring Boot - CRUD</title>
914
</head>
1015
<body>
1116
<div id="root"></div>

web/package-lock.json

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "crud-example",
2+
"name": "springboot-example",
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",
66
"scripts": {
7-
"dev": "vite",
7+
"dev": "vite --host 0.0.0.0",
88
"build": "tsc && vite build",
99
"preview": "vite preview"
1010
},

web/src/App.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
export const App = () => (
2-
<div className="App">
3-
<h1>Hello filho da puta!</h1>
4-
</div>
5-
)
1+
export const App = () => {
2+
return (
3+
<h1 style={{ textAlign: 'center', marginTop: '20pt' }}>
4+
Spring Boot API + React App
5+
</h1>
6+
)
7+
}

web/src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

web/src/main.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { StrictMode } from 'react'
2-
import { createRoot } from 'react-dom/client'
1+
import { StrictMode } from 'react';
2+
import { render } from 'react-dom';
33

4-
import { App } from './App';
4+
import { App } from './App'
55

6-
createRoot(document.getElementById('root') as HTMLElement).render(
6+
import './styles/index.css'
7+
8+
render(
79
<StrictMode>
810
<App />
9-
</StrictMode>
10-
)
11+
</StrictMode>,
12+
document.getElementById('root')
13+
);

web/src/styles/index.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1+
* {
2+
margin: 0;
3+
padding: 0;
4+
box-sizing: border-box;
5+
outline: 0;
6+
}
17

8+
body {
9+
background: #312E38;
10+
color: #FFF;
11+
-webkit-font-smoothing: antialiased;
12+
}
13+
14+
body,
15+
input,
16+
button {
17+
font-family: 'Poppins', serif;
18+
font-size: 16px;
19+
}
20+
21+
h1,
22+
h2,
23+
h3,
24+
h4,
25+
h5,
26+
h6,
27+
strong {
28+
font-weight: 500;
29+
}
30+
31+
button {
32+
cursor: pointer;
33+
}

0 commit comments

Comments
 (0)