Toggle navigation
Toggle navigation
This project
Loading...
Sign in
DongyoungKwon
/
Teleprompter-SST
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
DongyoungKwon
2020-12-08 22:07:40 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b8f1f57b5504b8e039eb7b872bb6ac0efbdb441f
b8f1f57b
1 parent
c1d976f0
Fix a bug that occurred when multiple people use
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
76 additions
and
46 deletions
README.md
client/package-lock.json
client/package.json
client/public/index.html
client/src/App.css
client/src/App.js
client/src/index.css
client/src/pages/MainPage.js
client/src/pages/PrompterPage.js
package-lock.json
package.json
server.js
README.md
View file @
b8f1f57
# Teleprompter-SST
# Teleprompter-STT
## Table of Contents
-
[
νλ‘μ νΈ μκ°
](
#-νλ‘μ νΈ-μκ°
)
-
[
μ£Όμ κΈ°λ₯
](
#-μ£Όμ-κΈ°λ₯
)
-
[
Directory ꡬ쑰
](
#-directory-ꡬ쑰
)
-
[
μ€μΉ λ°©λ²
](
#-μ€μΉ-λ°©λ²
)
-
[
νμ
](
#-νμ
)
-
[
Reference
](
#-reference
)
-
[
License
](
#-license
)
## π νλ‘μ νΈ μκ°
-
μμ±μ λ§μΆ° λλ³Έμ νλ©΄μ μ€μκ°μΌλ‘ μΆλ ₯νλ ν둬νν° μλΉμ€
-
Untactμλμ νμνμμμ νΈνκ² λ°νν μ μλλ‘ λμμ£Όλ μλΉμ€
## π μ£ΌμκΈ°λ₯
-
[
**Web Speech API**
](
https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
)
&&
[
**String-Similarity API**
](
https://www.npmjs.com/package/string-similarity
)
μ¬μ©
## π μ£Όμ κΈ°λ₯
-
[
**Web Speech API**
](
https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
)
&&
[
**string-similarity API**
](
https://www.npmjs.com/package/string-similarity
)
μ¬μ©
-
Real-time Script Output
## π Directory ꡬ쑰
```
bash
Teleprompter-S
S
T
Teleprompter-S
T
T
βββ client ---> Front-end
[
React]
β βββ public ---> μ μ νμΌ λ³΄κ΄
β β βββ favicon.ico
β β βββ index.html
β β βββ manifest.json
β β βββ robots.txt
...
...
@@ -38,50 +45,71 @@ Teleprompter-SST
β β βββ styles.js ---> PrompterPage.js Style
β βββ .gitignore
β βββ package-lock.json
β βββ package.json
β βββ yarn.lock
β βββ package.json
β
βββ .gitignore
βββ LICENSE ---> MIT License
βββ package-lock.json
βββ package.json
βββ README.md
βββ server.js ---> Back-end
[
Node Express]
βββ yarn.lock
βββ server.js ---> Back-end
[
Node.js Express]
```
## :keyboard: μ€μΉ λ°©λ²
#### βοΈ React & Express μλ² λμ ꡬλ (Local Serverλ‘ λμ)
##### client ν΄λ μ΄λ
`$ cd Teleprompter-STT/client`
##### Reactμ νμν λͺ¨λ μ€μΉ
`$ npm install`
##### Teleprompter-STT ν΄λ μ΄λ
`$ cd ..`
##### Node.jsμ νμν λͺ¨λ μ€μΉ
`$ npm install`
## β¨οΈ μ€μΉ λ°©λ²
##### React & Express μλ² λμ μμ
`$ npm run dev`
<br>
#### βοΈ Express μλ²λ‘λ§ κ΅¬λ (Herokuλ‘ λ°°ν¬ κ°λ₯)
#### client ν΄λ μ΄λ
`$ cd Teleprompter-S
S
T/client`
####
#
client ν΄λ μ΄λ
`$ cd Teleprompter-S
T
T/client`
####
package.jsonμ λͺ μλ
λͺ¨λ μ€μΉ
####
# Reactμ νμν
λͺ¨λ μ€μΉ
`$ npm install`
#### Teleprompter-SST ν΄λ μ΄λ
##### Build File μμ±
`$ npm run build`
##### Teleprompter-STT ν΄λ μ΄λ
`$ cd ..`
#### package.jsonμ λͺ μλ λͺ¨λ μ€μΉ
##### Node.jsμ νμν λͺ¨λ μ€μΉ
`$ npm install`
#### μμ
####
# Express μλ²
μμ
`$ npm run server`
#### Local Address μ μ
`http://localhost:3000`
## π§βπ» νμ
## π₯ νμ
-
κΆλμ (2016110307)
-
κΉλ€μ (2017110268)
## π Reference
-
[
**Web Speech API**
](
https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API
)
-
[
**String-Similarity API**
](
https://www.npmjs.com/package/string-similarity
)
-
[
**string-similarity API**
](
https://www.npmjs.com/package/string-similarity
)
-
[
**Material-Ui**
](
https://material-ui.com/
)
## π License
Teleprompter-SST is
[
MIT licensed
](
./LICENSE
)
.
\ No newline at end of file
Teleprompter-STT is
[
MIT licensed
](
./LICENSE
)
.
<br>
[
πBack To The Top
](
#teleprompter-stt
)
\ No newline at end of file
...
...
client/package-lock.json
View file @
b8f1f57
{
"name"
:
"teleprompter-frontend"
,
"version"
:
"
0.1
.0"
,
"name"
:
"teleprompter-
stt-
frontend"
,
"version"
:
"
1.0
.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
...
...
client/package.json
View file @
b8f1f57
{
"name"
:
"teleprompter-frontend"
,
"version"
:
"
0.1
.0"
,
"name"
:
"teleprompter-
stt-
frontend"
,
"version"
:
"
1.0
.0"
,
"private"
:
true
,
"dependencies"
:
{
"@material-ui/core"
:
"^4.11.0"
,
...
...
client/public/index.html
View file @
b8f1f57
...
...
@@ -17,4 +17,4 @@
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div
id=
"root"
></div>
</body>
</html>
</html>
\ No newline at end of file
...
...
client/src/App.css
View file @
b8f1f57
...
...
@@ -35,4 +35,4 @@
to
{
transform
:
rotate
(
360deg
);
}
}
}
\ No newline at end of file
...
...
client/src/App.js
View file @
b8f1f57
...
...
@@ -9,7 +9,7 @@ class App extends Component {
return
(
<>
<
Route
path
=
"/"
component
=
{
MainPage
}
exact
=
{
true
}
/
>
<
Route
path
=
"/prompter
:script
"
component
=
{
PrompterPage
}
exact
=
{
true
}
/
>
<
Route
path
=
"/prompter"
component
=
{
PrompterPage
}
exact
=
{
true
}
/
>
<
/
>
);
}
...
...
client/src/index.css
View file @
b8f1f57
@import
url(http://fonts.googleapis.com/earlyaccess/notosanskr.css)
;
@import
url(http
s
://fonts.googleapis.com/earlyaccess/notosanskr.css)
;
body
{
margin
:
0
;
...
...
client/src/pages/MainPage.js
View file @
b8f1f57
...
...
@@ -70,7 +70,7 @@ class MainPage extends Component {
this
.
setState
({
script
:
''
})
this
.
props
.
history
.
push
(
`/prompter:
${
this
.
script
}
`
);
this
.
props
.
history
.
push
(
'/prompter'
);
}
// Send script to Server
...
...
client/src/pages/PrompterPage.js
View file @
b8f1f57
import
React
,
{
Fragment
}
from
'react'
;
import
React
,
{
Fragment
,
useEffect
}
from
'react'
;
import
axios
from
'axios'
import
{
withStyles
,
Button
}
from
'@material-ui/core'
;
import
{
...
...
@@ -21,14 +21,16 @@ function PrompterPage({match}) {
const
[
progress
,
setProgress
]
=
React
.
useState
(
0
);
// Serverλ‘λΆν° Script λ°μμ΄
axios
.
get
(
`api/
${
match
.
params
[
"script"
].
slice
(
1
)}
`
)
.
then
(
res
=>
{
// .then : μλ΅(μνμ½λ200~300λ―Έλ§)μ±κ³΅μ
console
.
log
(
res
.
data
);
setWords
(
res
.
data
.
split
(
" "
));
// λ°μμ¨ Script λ¬Έμμ΄ μ²λ¦¬
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
useEffect
(()
=>
{
axios
.
get
(
'api/script'
)
.
then
(
res
=>
{
// .then : μλ΅(μνμ½λ200~300λ―Έλ§)μ±κ³΅μ
console
.
log
(
res
.
data
);
setWords
(
res
.
data
.
split
(
" "
));
// λ°μμ¨ Script λ¬Έμμ΄ μ²λ¦¬
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
},
[
match
.
params
]);
const
handleListening
=
()
=>
{
if
(
listening
)
{
...
...
package-lock.json
View file @
b8f1f57
This diff is collapsed. Click to expand it.
package.json
View file @
b8f1f57
...
...
@@ -5,9 +5,9 @@
"main"
:
"index.js"
,
"scripts"
:
{
"heroku-postbuild"
:
"NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
,
"client"
:
"cd client &&
yar
n start"
,
"client"
:
"cd client &&
npm ru
n start"
,
"server"
:
"nodemon server.js"
,
"dev"
:
"concurrently --kill-others-on-fail
\"
yarn server
\"
\"
yar
n client
\"
"
"dev"
:
"concurrently --kill-others-on-fail
\"
npm run server
\"
\"
npm ru
n client
\"
"
},
"repository"
:
{
"type"
:
"git"
,
...
...
server.js
View file @
b8f1f57
...
...
@@ -13,14 +13,14 @@ let scriptReceived = "";
app
.
get
(
'/api/:script'
,
(
req
,
res
)
=>
{
res
.
send
(
scriptReceived
)
)
;
});
app
.
post
(
'/api/:script'
,
(
req
,
res
)
=>
{
scriptReceived
=
req
.
body
.
script
;
});
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'./client/build'
)));
// μ μ νμΌλ‘ λ°κΏμ§ React[front-end]λ₯Ό Express μλ²λ‘
μ¬μ©νμ¬ κΈ°μ‘΄μ 2κ°μ μλ²λ‘ μ΄μνλ κ²μ νλμ μλ²λ‘ μ¬
μ©ν μ μλλ‘ ν΄μ€
app
.
use
(
express
.
static
(
path
.
join
(
__dirname
,
'./client/build'
)));
// μ μ νμΌλ‘ λ°κΏμ§ React[front-end]λ₯Ό Express μλ²λ‘
λ§ μ΄
μ©ν μ μλλ‘ ν΄μ€
app
.
get
(
'*'
,
(
req
,
res
,
next
)
=>
{
res
.
sendFile
(
path
.
join
(
__dirname
,
"./client/build"
,
"index.html"
));
...
...
Please
register
or
login
to post a comment