Browse Source

Added frontend components and set up Express

ts
galmio 9 months ago
parent
commit
da25cc4937
  1. 3
      .env.example
  2. 3
      .gitignore
  3. 31
      Dockerfile
  4. 14
      docker-compose.dev.yml
  5. 6
      docker-compose.prod.yml
  6. 17
      docker-compose.yml
  7. 24
      package-lock.json
  8. 8
      package.json
  9. 5
      src/client/Dockerfile
  10. 19
      src/client/package-lock.json
  11. 9
      src/client/package.json
  12. BIN
      src/client/src/assets/icon/communication/ic_email.png
  13. BIN
      src/client/src/assets/icon/communication/phone.png
  14. BIN
      src/client/src/assets/icon/maps/my_location.png
  15. BIN
      src/client/src/assets/icon/social/facebook.png
  16. BIN
      src/client/src/assets/icon/social/linkedin.png
  17. BIN
      src/client/src/assets/img/post2.png
  18. 1
      src/client/src/index.html
  19. 6
      src/client/src/js/App.js
  20. 30
      src/client/src/js/components/layout/Card/CardItem/index.js
  21. 18
      src/client/src/js/components/layout/Card/index.js
  22. 49
      src/client/src/js/components/layout/Form/FormInput/index.js
  23. 36
      src/client/src/js/components/layout/Form/hooks.js
  24. 33
      src/client/src/js/components/layout/Form/index.js
  25. 4
      src/client/src/js/components/layout/Navbar/index.js
  26. 18
      src/client/src/js/components/layout/Showcase/BareShowcase/index.js
  27. 35
      src/client/src/js/components/pages/About.js
  28. 62
      src/client/src/js/components/pages/Contact.js
  29. 17
      src/client/src/js/components/pages/Doulton.js
  30. 4
      src/client/src/js/components/pages/Index.js
  31. 1
      src/client/src/styles/base/_variables.scss
  32. 10
      src/client/src/styles/components/_button.scss
  33. 28
      src/client/src/styles/components/_card.scss
  34. 39
      src/client/src/styles/components/_form.scss
  35. 19
      src/client/src/styles/components/_showcase.scss
  36. 52
      src/client/src/styles/layout/_container.scss
  37. 1
      src/client/src/styles/layout/_footer.scss
  38. 2
      src/client/src/styles/main.scss
  39. 21
      src/client/webpack.common.js
  40. 16
      src/client/webpack.dev.js
  41. 6
      src/client/webpack.prod.js
  42. 15
      src/server/.eslintrc.js
  43. 8
      src/server/.prettierrc.js
  44. 10
      src/server/Dockerfile
  45. 374
      src/server/package-lock.json
  46. 20
      src/server/package.json
  47. 20
      src/server/src/server.js

3
.env.example

@ -0,0 +1,3 @@
PORT=
HOSTNAME=
NETWORK=

3
.gitignore

@ -0,0 +1,3 @@
node_modules/
dist/
.env

31
Dockerfile

@ -1,24 +1,25 @@
# Set up and build the client
FROM node:lts-slim as client
FROM node:lts-alpine as build
WORKDIR /usr/src/app/client/
COPY client/package*.json ./
RUN npm install -qy
COPY client/ ./
WORKDIR /usr/src/client/
COPY src/client/package*.json ./
RUN npm ci -qy
COPY src/client/ ./
RUN npm run build
# Copy build dir to maintain the current production version local
FROM node:lts-slim
WORKDIR /usr/src/app
COPY --from=client /usr/src/app/client/dist/ ./src/client/dist/
# Copy build dir to production container
FROM node:lts-alpine
COPY --from=build /usr/src/client/dist/ ./usr/src/client/dist/
# Set up the server
WORKDIR /usr/src/app/server/
COPY server/package*.json ./
RUN npm install -qy
COPY server/ ./
# Create the app directory
WORKDIR /usr/src/server/
ENV PORT 8000
# Install app dependencies
COPY src/server/package*.json ./
RUN npm install -qy --only production
# Bundle app source
COPY src/server/ ./
EXPOSE 8000

14
docker-compose.dev.yml

@ -0,0 +1,14 @@
version: "3"
services:
client:
build:
context: ./src/client/
command: npm start
image: siameses_client
container_name: siameses_client
ports:
- "8080:8080"
volumes:
- ./src/client:/usr/src/client
- /usr/src/client/node_modules

6
docker-compose.prod.yml

@ -5,11 +5,9 @@ services:
container_name: "siameses"
hostname: "siameses"
restart: unless-stopped
environment:
NODE_ENV: production
PORT: 8000
env_file: .env
networks:
default:
external:
name: caddy_net
name: $NETWORK

17
docker-compose.yml

@ -1,13 +1,10 @@
version: "3"
services:
client:
build:
context: ./src/client/
command: npm start
image: siameses_client
container_name: siameses_client
siameses:
build: .
container_name: "siameses"
hostname: "siameses"
restart: unless-stopped
env_file: .env
ports:
- "2500:80"
volumes:
- ./src/client:/usr/src/app
- /usr/src/app/node_modules
- "8000:8000"

24
package-lock.json

@ -66,9 +66,9 @@
"dev": true
},
"acorn": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz",
"integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==",
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.3.1.tgz",
"integrity": "sha512-tLc0wSnatxAQHVHUapaHdz72pi9KUyHjq5KyHjGg9Y8Ifdc79pTh2XvI6I1/chZbnM7QtNKzh66ooDogPZSleA==",
"dev": true
},
"acorn-jsx": {
@ -495,9 +495,9 @@
}
},
"eslint-plugin-import": {
"version": "2.21.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.21.1.tgz",
"integrity": "sha512-qYOOsgUv63vHof7BqbzuD+Ud34bXHxFJxntuAC1ZappFZXYbRIek3aJ7jc9i2dHDGDyZ/0zlO0cpioES265Lsw==",
"version": "2.21.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.21.2.tgz",
"integrity": "sha512-FEmxeGI6yaz+SnEB6YgNHlQK1Bs2DKLM+YF+vuTk5H8J9CLbJLtlPvRFgZZ2+sXiKAlN5dpdlrWOjK8ZoZJpQA==",
"dev": true,
"requires": {
"array-includes": "^3.1.1",
@ -623,9 +623,9 @@
}
},
"eslint-utils": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz",
"integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
"dev": true,
"requires": {
"eslint-visitor-keys": "^1.1.0"
@ -896,9 +896,9 @@
"dev": true
},
"inquirer": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz",
"integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.2.0.tgz",
"integrity": "sha512-E0c4rPwr9ByePfNlTIB8z51kK1s2n6jrHuJeEHENl/sbq2G/S1auvibgEwNR4uSyiU+PiYHqSwsgGiXjG8p5ZQ==",
"dev": true,
"requires": {
"ansi-escapes": "^4.2.1",

8
package.json

@ -4,7 +4,8 @@
"description": "Siameses website",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "cd src/server/src && node server"
},
"repository": {
"type": "git",
@ -15,10 +16,11 @@
"devDependencies": {
"eslint": "^7.2.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.21.1",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-standard": "^4.0.1"
}
},
"dependencies": {}
}

5
src/client/Dockerfile

@ -1,8 +1,7 @@
FROM node:lts-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
WORKDIR /usr/src/client
COPY package*.json ./
RUN npm ci -qy
COPY . .
EXPOSE 80
EXPOSE 8080
CMD [ "npm", "start" ]

19
src/client/package-lock.json

@ -2773,6 +2773,16 @@
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
"dev": true
},
"clean-webpack-plugin": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/clean-webpack-plugin/-/clean-webpack-plugin-3.0.0.tgz",
"integrity": "sha512-MciirUH5r+cYLGCOL5JX/ZLzOZbVr1ot3Fw+KcvbhUb6PM+yycqd9ZhIlcigQ5gl+XhppNmw3bEFuaaMNyLj3A==",
"dev": true,
"requires": {
"@types/webpack": "^4.4.31",
"del": "^4.1.1"
}
},
"cliui": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
@ -10946,6 +10956,15 @@
"uuid": "^3.3.2"
}
},
"webpack-merge": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz",
"integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==",
"dev": true,
"requires": {
"lodash": "^4.17.15"
}
},
"webpack-sources": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz",

9
src/client/package.json

@ -5,9 +5,8 @@
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack-dev-server --mode development",
"build": "webpack --mode production",
"dev": "webpack --config webpack.config.js"
"start": "webpack-dev-server --config webpack.dev.js --mode development",
"build": "webpack --config webpack.prod.js --mode production"
},
"repository": {
"type": "git",
@ -21,6 +20,7 @@
"@babel/preset-react": "^7.10.1",
"@svgr/webpack": "^5.4.0",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^6.0.2",
"css-loader": "^3.5.3",
"file-loader": "^6.0.0",
@ -34,7 +34,8 @@
"url-loader": "^4.1.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.11.0"
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2"
},
"dependencies": {
"react": "^16.13.1",

BIN
src/client/src/assets/icon/communication/ic_email.png

Before

Width: 16  |  Height: 16  |  Size: 363 B

BIN
src/client/src/assets/icon/communication/phone.png

Before

Width: 16  |  Height: 16  |  Size: 361 B

BIN
src/client/src/assets/icon/maps/my_location.png

Before

Width: 16  |  Height: 16  |  Size: 533 B

BIN
src/client/src/assets/icon/social/facebook.png

Before

Width: 24  |  Height: 24  |  Size: 716 B

BIN
src/client/src/assets/icon/social/linkedin.png

Before

Width: 24  |  Height: 24  |  Size: 721 B

BIN
src/client/src/assets/img/post2.png

Before

Width: 1801  |  Height: 1801  |  Size: 740 KiB

1
src/client/src/index.html

@ -4,6 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="assets/icon/brand/logo-siameses.svg">
<title>Siameses</title>
</head>
<body>

6
src/client/src/js/App.js

@ -2,6 +2,9 @@ import React from 'react'
import { Navbar } from './components/layout/Navbar'
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
import Index from './components/pages/Index'
import About from './components/pages/About'
import Doulton from './components/pages/Doulton'
import Contact from './components/pages/Contact'
import Footer from './components/layout/Footer'
const App = () => {
@ -10,6 +13,9 @@ const App = () => {
<Route path="/" render={ () => <Navbar /> } />
<Switch>
<Route exact path="/" component={ Index } />
<Route exact path="/about" component={ About } />
<Route exact path="/doulton" component={ Doulton } />
<Route exact path="/contact" component={ Contact } />
</Switch>
<Route path="/" render={ () => <Footer /> } />
</Router>

30
src/client/src/js/components/layout/Card/CardItem/index.js

@ -0,0 +1,30 @@
import React from 'react'
import { ButtonWrapper } from '../../Button'
const CardItem = ({ avatar, name, position, socialLink }) => (
<div className="card-item">
<div className="avatar">
<img src={avatar} alt="" />
</div>
<div className="details">
<span className="name">{name}</span>
<span className="position">{position}</span>
</div>
<ButtonWrapper
buttons={[
{
type: 'full',
content: 'LinkedIn',
path: 'https://linkedin.com'
},
{
type: 'bare',
content: 'LinkedIn',
path: 'https://linkedin.com'
}
]}
/>
</div>
)
export default CardItem

18
src/client/src/js/components/layout/Card/index.js

@ -0,0 +1,18 @@
import React from 'react'
import CardItem from './CardItem'
const Card = ({ cards }) => (
<div className="card-wrapper">
{cards.map((card, i) => (
<CardItem
avatar={card.avatar}
name={card.name}
position={card.position}
socialLink={card.socialLink}
key={i}
/>
))}
</div>
)
export default Card

49
src/client/src/js/components/layout/Form/FormInput/index.js

@ -1,19 +1,56 @@
import React, { useState, useEffect, useRef } from 'react'
const FormInput = ({ type, focus, label, id }) => {
const outerDiv = useRef(null)
const FormInput = ({
type,
isActive,
label,
id,
onChange,
value,
onClick,
onBlur,
onFocus,
outerDiv
}) => {
return (
<div ref={outerDiv}>
{type !== 'textarea' ? (
<div className="input-wrapper">
<div className="label">{label}</div>
<input type="text" id={id} autoFocus={focus} name={id} />
<div
className={
'label ' + (value !== '' || isActive ? 'selected' : '')
}>
{label}
</div>
<input
type="text"
id={id}
name={id}
value={value}
onChange={onChange}
onClick={onClick}
onBlur={onBlur}
onFocus={onFocus}
/>
</div>
) : (
<div className="input-wrapper large">
<div className="label">{label}</div>
<textarea id={id} name={id} />
<div
className={
'label ' + (value !== '' || isActive ? 'selected' : '')
}>
{label}
</div>
<textarea
id={id}
name={id}
value={value}
onChange={onChange}
onClick={onClick}
onBlur={onBlur}
onFocus={onFocus}
/>
</div>
)}
</div>

36
src/client/src/js/components/layout/Form/hooks.js

@ -0,0 +1,36 @@
import { useState, useEffect, useRef } from 'react'
export const useFormInput = (initialValue = '') => {
const [value, setValue] = useState(initialValue)
const [isActive, setIsActive] = useState(false)
const outerDiv = useRef(null)
const handleChange = (e) => setValue(e.target.value)
const handleClick = () => setIsActive(true)
const handleOutsideClick = (e) => {
if (outerDiv.current.contains(e.target)) {
return
}
setIsActive(false)
}
const handleFocus = () => setIsActive(true)
const handleFocusOut = () => setIsActive(false)
useEffect(() => {
document.addEventListener('click', handleOutsideClick)
return () => {
document.removeEventListener('click', handleOutsideClick)
}
}, [isActive])
return {
value,
isActive,
onChange: handleChange,
onClick: handleClick,
onFocus: handleFocus,
onBlur: handleFocusOut,
outerDiv
}
}

33
src/client/src/js/components/layout/Form/index.js

@ -1,29 +1,17 @@
import React, { useState, useRef } from 'react'
import React, { useRef } from 'react'
import Button from '../Button'
import FormInput from './FormInput'
import { useFetch } from '../../../hooks/useFetch'
export const useFormInput = (initialValue) => {
const [value, setValue] = useState(initialValue)
const handleChange = (e) => {
setValue(e.target.value)
}
return {
value,
onChange: handleChange
}
}
import { useFormInput } from './hooks'
const Form = () => {
const formRef = useRef(null)
const name = useFormInput('')
const email = useFormInput('')
const phone = useFormInput('')
const message = useFormInput('')
const name = useFormInput()
const email = useFormInput()
const phone = useFormInput()
const message = useFormInput()
const handleSubmit = e => {
const handleSubmit = (e) => {
e.preventDefault()
useFetch('/api/email', {
name: name,
@ -36,9 +24,10 @@ const Form = () => {
return (
<div className="form-wrapper">
<form method="POST" onSubmit={handleSubmit} ref={formRef}>
<FormInput label="Name" id="name" focus={true} />
<FormInput label="Email" id="email" />
<FormInput label="Message" type="textarea" id="message" />
<FormInput label="Nombres y apellidos" id="name" focus={true} {...name} />
<FormInput label="Email" id="email" {...email} />
<FormInput label="Celular" id="phone" {...phone} />
<FormInput label="Mensaje" type="textarea" id="message" {...message} />
<Button type="full" content="Enviar consulta" path="/api/sendemail" />
</form>
</div>

4
src/client/src/js/components/layout/Navbar/index.js

@ -27,8 +27,8 @@ export const Navbar = () => {
</NavLink>
<ul className="navbar">
<NavbarItem title="Inicio" url="/" active={false} exact={true} />
<NavbarItem title="Nosotros" url="/nosotros" active={false} />
<NavbarItem title="Doulton Filters" url="/doulton-filters" active={false} />
<NavbarItem title="Nosotros" url="/about" active={false} />
<NavbarItem title="Doulton Filters" url="/doulton" active={false} />
<NavbarItem title="Contacto" url="/contact" active={false} />
<div className="social-links">
<a target="_blank" rel="noreferrer" href="https://facebook.com/siameses.com.pe"><FbLogo /></a>

18
src/client/src/js/components/layout/Showcase/BareShowcase/index.js

@ -0,0 +1,18 @@
import React from 'react'
import Button from '../../Button'
const BareShowcase = ({ content, children, link }) => {
return (
<div className="bare-showcase">
<div className="heading">
<span>{children}</span>
</div>
<div className="content">
{content}
<Button type="bare" content={link.label} path={link.path} />
</div>
</div>
)
}
export default BareShowcase

35
src/client/src/js/components/pages/About.js

@ -0,0 +1,35 @@
import React from 'react'
import BareShowcase from '../layout/Showcase/BareShowcase'
import Card from '../layout/Card'
const About = () => (
<div className="about-wrapper">
<BareShowcase
content="Ofrecemos soluciones de calidad y ecoamigables de purificación de agua para las familias y comercios del Perú."
link={{
label: 'Conoce nuestra historia',
path: ''
}}>
¡Hola!
<br /> <b>Somos Siameses</b>
</BareShowcase>
<Card
cards={[
{
avatar: 'assets/img/carlos.png',
name: 'Carlos Siles Molinelli',
position: 'Director Ejecutivo',
socialLink: 'https://linkedin.com'
},
{
avatar: 'assets/img/miguel.png',
name: 'Miguel Moreno Revilla',
position: 'Director Ejecutivo',
socialLink: 'https://linkedin'
}
]}
/>
</div>
)
export default About

62
src/client/src/js/components/pages/Contact.js

@ -1,8 +1,68 @@
import React from 'react'
import Form from '../layout/Form'
import PhoneIcon from '../../../assets/icon/communication/phone.svg'
import MailIcon from '../../../assets/icon/communication/ic_email.svg'
import MapIcon from '../../../assets/icon/maps/my_location.svg'
import FbLogo from '../../../assets/icon/social/facebook.svg'
import LiLogo from '../../../assets/icon/social/linkedin.svg'
const Contact = () => (
<Form />
<div className="contact-wrapper">
<div className="contact-container">
<div className="contact-details">
<div className="title">
<h1>Estamos para resolver tus dudas y atenderte</h1>
</div>
<div className="content">
<div className="content-link">
<PhoneIcon />
<a href="tel:016543210">01 654 3210</a>
</div>
<div className="content-link">
<MailIcon />
<a href="mailto:contacto@siameses.com.pe">
contacto@siameses.com.pe
</a>
</div>
<div className="content-link">
<MapIcon width="25" />
<a
target="blank"
rel="noreferrer"
href="https://www.openstreetmap.org/?mlat=-12.1345101&mlon=-77.026404&zoom=17#map=17/-12.13451/-77.02640">
Av. Armedariz 480 Miraflores, Lima, Peru
</a>
</div>
</div>
</div>
<div className="branding">
<div className="social-links">
<span>Visitanos en</span>
<div className="social-icons">
<a
target="_blank"
rel="noreferrer"
href="https://facebook.com/siameses.com.pe">
<FbLogo />
</a>
<a
target="_blank"
rel="noreferrer"
href="https://linkedin.com/company/siameses/">
<LiLogo />
</a>
</div>
</div>
<span>
Conoce más en{' '}
<a target="_blank" rel="noreferrer" href="https://doulton.com.pe">
www.doulton.com.pe
</a>
</span>
</div>
</div>
<Form />
</div>
)
export default Contact

17
src/client/src/js/components/pages/Doulton.js

@ -0,0 +1,17 @@
import React from 'react'
import BareShowcase from '../layout/Showcase/BareShowcase'
const Doulton = () => (
<div className="doulton-wrapper">
<BareShowcase
content="Somos representantes de Doulton Filters ® del Reino Unido, para ofrecer la mejor calidad de agua purificada a las familias y comercios del Perú."
link={{
label: 'Ir a Doulton.com.pe',
path: 'https://doulton.com.pe'
}}>
¡La marca Nº1 en <b>purificadores de agua</b> ya está aquí!
</BareShowcase>
</div>
)
export default Doulton

4
src/client/src/js/components/pages/Index.js

@ -20,12 +20,12 @@ const Index = () => (
{
type: 'full',
content: 'Ir a Doulton',
path: '/doulton-filters'
path: '/doulton'
},
{
type: 'bare',
content: 'Ver vídeo',
path: '/doulton-filters#video'
path: '/doulton#video'
}
]}
image={{

1
src/client/src/styles/base/_variables.scss

@ -2,6 +2,7 @@
$black: #000000;
$gray: #e3e7f2;
$cool_gray: #f0f0f0;
$dark_gray: #747b8e;
$cyan: #95c2c5;
$dark_blue: #081f5b;
$navy_blue: #1C3E94;

10
src/client/src/styles/components/_button.scss

@ -1,24 +1,29 @@
.btn-wrapper {
@include flexbox;
@include align-items(center);
padding: 2rem 0;
.btn {
margin: 2rem 1rem;
}
}
.btn {
@include user-select-none;
text-transform: uppercase;
font-family: $nunito-semibold;
border: none;
cursor: pointer;
padding: 1rem 2rem;
margin: 2rem 0;
}
.fullBtn {
background: $navy_blue;
color: $gray;
border-radius: 100px;
padding: 1rem 2rem;
}
.altFullBtn {
border-radius: 100px;
color: $navy_blue;
background: white;
padding: 1rem 2rem;
}
.bareBtn {
@include flexbox-center;
@ -28,4 +33,3 @@
font-size: 0.8rem;
letter-spacing: 3px;
}
}

28
src/client/src/styles/components/_card.scss

@ -0,0 +1,28 @@
.card-wrapper {
@include flexbox-center;
.card-item {
box-shadow: 0px 0px 12px rgba(31, 44, 115, 0.1);
border-radius: 8px;
.avatar {
img {
border-radius: 50%;
}
}
.details {
@include flexbox;
@include flex-direction(column);
font-family: $nunito-semibold;
color: $navy_blue;
.name {
font-size: 20px;
line-height: 32px;
}
.position {
font-size: 12px;
line-height: 16px;
text-transform: uppercase;
letter-spacing: 2px;
}
}
}
}

39
src/client/src/styles/components/_form.scss

@ -24,13 +24,20 @@
transition: transform 0.2s ease-in-out, font-size 0.2s ease-in-out,
color 0.1s ease-in;
}
.selected {
transform: translateY(-30px);
font-size: 0.8rem;
color: $navy_blue;
}
input {
width: 400px;
border: none;
background: transparent;
border-bottom: 1px solid $gray;
color: $gray;
font-size: 1.1rem;
color: $dark_gray;
transition: border-bottom 0.2s ease-in-out;
font-family: $nunito-light;
padding: 0.8rem 0.5rem;
z-index: 2;
&:focus {
@ -40,18 +47,21 @@
width: 250px;
}
}
input .selected {
transform: 'translateY(-30px)';
font-size: '.8rem';
color: '#FDA130';
}
}
.input-wrapper.large {
@extend .input-wrapper;
height: 200px;
margin: 3rem 0 0 0;
box-sizing: border-box;
textarea {
resize: none;
width: 420px;
padding: 1rem 0.5rem;
padding: 0.5rem;
height: 200px;
font-size: 0.9rem;
color: $gray;
font-size: 14px;
font-family: inherit;
font-size: inherit;
color: $dark_gray;
bottom: 0;
border: none;
background: transparent;
@ -67,15 +77,14 @@
width: 270px;
}
}
}
.input-wrapper.large {
@extend .input-wrapper;
height: 200px;
margin: 3rem 0 0 0;
box-sizing: border-box;
.label {
top: 1rem;
}
.selected {
transform: translateY(-40px);
font-size: 0.8rem;
color: $navy_blue;
}
}
}
}

19
src/client/src/styles/components/_showcase.scss

@ -53,3 +53,22 @@
}
}
}
.bare-showcase {
@include flexbox;
.heading {
@include flexbox;
@include flex(50%);
font-family: $nunito-light;
font-size: 2rem;
padding: 2rem 4rem;
box-sizing: border-box;
color: $navy_blue;
}
.content {
@include flexbox;
@include flex-direction(column);
@include flex(50%);
padding: 2rem 4rem;
box-sizing: border-box;
}
}

52
src/client/src/styles/layout/_container.scss

@ -0,0 +1,52 @@
.contact-wrapper {
@include flexbox;
@include justify-content(center);
@include align-items(baseline);
padding: 2rem 4rem;
.contact-container {
@include flexbox;
@include flex-direction(column);
padding: 0 3rem;
.title h1 {
$font-family: $nunito-semibold;
color: $navy_blue;
}
.content {
padding: 2rem 0;
.content-link {
padding: 1rem 0;
@include flexbox;
@include flex-wrap(nowrap);
@include align-items(center);
a {
padding-left: 0.5rem;
text-decoration: none;
color: $dark_gray;
}
}
}
.branding {
.social-links {
@include flexbox;
@include flex-wrap(nowrap);
padding: 2rem 0;
.social-icons {
padding-left: 1rem;
a {
@include user-select-none;
svg {
padding: 0 0.5rem;
}
}
}
}
span {
a {
@include user-select-none;
text-decoration: underline;
color: $gold;
}
}
}
}
}

1
src/client/src/styles/layout/_footer.scss

@ -24,6 +24,7 @@ footer {
.branding {
@include flexbox;
@include justify-content(flex-end);
@include align-items(center);
a {
color: $gold;
text-decoration: underline;

2
src/client/src/styles/main.scss

@ -5,5 +5,7 @@
@import "components/button";
@import "components/navbar";
@import "components/showcase";
@import "components/card";
@import "components/form";
@import "layout/footer";
@import "layout/container";

src/client/webpack.config.js → src/client/webpack.common.js

16
src/client/webpack.dev.js

@ -0,0 +1,16 @@
const merge = require('webpack-merge')
const common = require('./webpack.common')
module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
devServer: {
historyApiFallback: true,
// Only output errors, warnings, or new compilations. It hides the massive list of modules.
stats: 'minimal',
hot: true,
inline: true,
host: '0.0.0.0',
port: 8080
}
})

6
src/client/webpack.prod.js

@ -0,0 +1,6 @@
const merge = require('webpack-merge')
const common = require('./webpack.common')
module.exports = merge(common, {
mode: 'production'
})

15
src/server/.eslintrc.js

@ -0,0 +1,15 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es2020: true
},
extends: [
'standard'
],
parserOptions: {
ecmaVersion: 11
},
rules: {
}
}

8
src/server/.prettierrc.js

@ -0,0 +1,8 @@
module.exports = {
trailingComma: 'none',
tabWidth: 2,
semi: false,
singleQuote: true,
arrowParens: 'always',
bracketSpacing: true
}

10
src/server/Dockerfile

@ -0,0 +1,10 @@
FROM node:lts-alpine
RUN mkdir -p /usr/src/server
WORKDIR /usr/src/server
COPY package*.json ./
RUN npm ci -qy
COPY . .
EXPOSE $PORT
CMD [ "npm start" ]

374
src/server/package-lock.json

@ -0,0 +1,374 @@
{
"name": "siameses_server",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
"requires": {
"mime-types": "~2.1.24",
"negotiator": "0.6.2"
}
},
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
"requires": {
"bytes": "3.1.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"on-finished": "~2.3.0",
"qs": "6.7.0",
"raw-body": "2.4.0",
"type-is": "~1.6.17"
}
},
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"content-disposition": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
"requires": {
"safe-buffer": "5.1.2"
}
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
},
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
"requires": {
"accepts": "~1.3.7",
"array-flatten": "1.1.1",
"body-parser": "1.19.0",
"content-disposition": "0.5.3",
"content-type": "~1.0.4",
"cookie": "0.4.0",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "~1.1.2",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"finalhandler": "~1.1.2",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "~1.1.2",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.5",
"qs": "6.7.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.1.2",
"send": "0.17.1",
"serve-static": "1.14.1",
"setprototypeof": "1.1.1",
"statuses": "~1.5.0",
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
}
},
"finalhandler": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"statuses": "~1.5.0",
"unpipe": "~1.0.0"
}
},
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"http-errors": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.1",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
}
},
"iconv-lite": {
"version": "0.4.24",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
}
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"mime-db": {
"version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
},
"mime-types": {
"version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"requires": {
"mime-db": "1.44.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.2",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"parseurl": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
},
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.1"
}
},
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
},
"raw-body": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
"requires": {
"bytes": "3.1.0",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
}
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
},
"send": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.7.2",
"mime": "1.6.0",
"ms": "2.1.1",
"on-finished": "~2.3.0",
"range-parser": "~1.2.1",
"statuses": "~1.5.0"
},
"dependencies": {
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}
}
},
"serve-static": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.17.1"
}
},
"setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
},
"statuses": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
},
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "~2.1.24"
}
},
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
}
}
}

20
src/server/package.json

@ -0,0 +1,20 @@
{
"name": "siameses_server",
"version": "1.0.0",
"description": "Siameses backend",
"main": "src/server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/server"
},
"repository": {
"type": "git",
"url": "https://git.galm.io/galmio/siameses-v2"
},
"author": "galmio",
"license": "AGPL-3.0",
"dependencies": {
"express": "^4.17.1"
},
"devDependencies": {}
}

20
src/server/src/server.js

@ -0,0 +1,20 @@
const path = require('path')
const express = require('express')
// Constants
const PORT = process.env.PORT || 4000
const HOST = process.env.HOST || '0.0.0.0'
const CLIENT_BUILD_PATH = path.join(__dirname, '../../client/dist')
// Initiallize Express
const app = express()
// Static files middleware
app.use(express.static(CLIENT_BUILD_PATH))
app.get('*', (req, res) => {
res.sendFile(path.join(CLIENT_BUILD_PATH, 'index.html'))
})
app.listen(PORT, HOST, () =>
console.log(`App running in http://${HOST}:${PORT}`)
)
Loading…
Cancel
Save