Initial project structure

main
Antonio De Lucreziis 3 years ago
commit 4901bf49ef

8
.gitignore vendored

@ -0,0 +1,8 @@
# NodeJS
node_modules/
dist/
.env
# Local files
*.local*

@ -0,0 +1 @@
# Lupus Lite

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login &bull; Lupus Lite</title>
</head>
<body>
<h1>Lupus Lite | Game</h1>
</body>
</html>

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lupus Lite</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Lato:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/src/main.scss">
</head>
<body>
<h1>Lupus Lite</h1>
</body>
</html>

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login &bull; Lupus Lite</title>
</head>
<body>
<h1>Lupus Lite | Login</h1>
</body>
</html>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,16 @@
{
"name": "lupus-lite-2022-frontend",
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"author": "aziis98",
"license": "MIT",
"devDependencies": {
"sass": "^1.52.3",
"vite": "^2.9.12"
}
}

@ -0,0 +1,113 @@
*,
*::before,
*::after {
box-sizing: border-box;
}
:root {
--ft-serif: 'IM Fell English', serif;
--ft-serif-wt-regular: 400;
--ft-sans: 'Lato', sans-serif;
--ft-sans-wt-light: 300;
--ft-sans-wt-regular: 400;
--ft-sans-wt-bold: 900;
--text-500: #f0f0f0;
--accent-100: #f19d90;
--accent-500: #a31e17;
--bg-500: #222;
}
html,
body {
width: 100%;
min-height: 100vh;
margin: 0;
font-family: var(--ft-sans);
font-weight: var(--ft-sans-wt-regular);
font-size: 16px;
color: var(--text-500);
background: var(--bg-500);
}
// Components
form {
display: grid;
grid-template-columns: auto 1fr;
gap: 0.5rem 1rem;
max-width: 35rem;
width: 100%;
align-items: center;
.full-row {
grid-column: span 2;
place-self: center;
}
label {
font-weight: var(--ft-sans-wt-bold);
}
@media screen and (max-width: 512px) {
grid-template-columns: 1fr;
.full-row {
grid-column: span 1;
place-self: stretch;
}
}
}
//
// Typography
//
hr {
width: 100%;
height: 2px;
border: none;
background: var(--accent-700);
}
p {
margin: 0;
}
// Headings
$base-font-size: 18px;
$heading-scale: 1.33;
@function pow($number, $exponent) {
$value: 1;
@if $exponent > 0 {
@for $i from 1 through $exponent {
$value: $value * $number;
}
}
@return $value;
}
@for $i from 1 through 5 {
h#{$i} {
margin: 0;
font-family: var(--ft-serif);
color: var(--accent-100);
$factor: pow($heading-scale, 5 - $i);
font-size: $base-font-size * $factor;
line-height: 1;
}
}

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login &bull; Lupus Lite</title>
</head>
<body>
<h1>Lupus Lite | @username</h1>
</body>
</html>

@ -0,0 +1,26 @@
import { defineConfig } from 'vite'
import { basename, extname, resolve } from 'path'
const stripExt = path => basename(path, extname(path))
export default defineConfig({
build: {
rollupOptions: {
input: Object.fromEntries(
[
// Entry points
'index.html',
'login.html',
'user.html',
'game.html',
].map(path => [stripExt(path), resolve(__dirname, path)])
),
},
},
server: {
proxy: {
'/api': 'http://127.0.0.1:4000',
},
},
plugins: [],
})

@ -0,0 +1,13 @@
module github.com/aziis98/lupus-lite
go 1.18
require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/gofiber/fiber/v2 v2.34.1 // indirect
github.com/klauspost/compress v1.15.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.37.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
)

@ -0,0 +1,26 @@
github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/gofiber/fiber/v2 v2.34.1 h1:C6saXB7385HvtXX+XMzc5Dqj5S/aEXOfKCW7JNep4rA=
github.com/gofiber/fiber/v2 v2.34.1/go.mod h1:ozRQfS+D7EL1+hMH+gutku0kfx1wLX4hAxDCtDzpj4U=
github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U=
github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasthttp v1.37.0 h1:7WHCyI7EAkQMVmrfBhWTCOaeROb1aCBiTopx63LkMbE=
github.com/valyala/fasthttp v1.37.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I=
github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8=
github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc=
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 h1:nhht2DYV/Sn3qOayu8lM+cU1ii9sTLUeBQwQQfUHtrs=
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

@ -0,0 +1,37 @@
package main
import (
"log"
"os"
"os/exec"
"strings"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/logger"
"github.com/gofiber/fiber/v2/middleware/recover"
)
func main() {
mode := os.Getenv("MODE")
app := fiber.New()
app.Use(logger.New())
app.Use(recover.New())
// Static files
app.Static("/", "./frontend/dist")
// Api routes
app.Route("/api", mountApiRoutes)
if strings.HasPrefix(mode, "dev") {
log.Printf(`Running dev server for frontend: "npm run dev"`)
err := (exec.Command("sh", "-c", "cd frontend/ && npm run dev").Start())
if err != nil {
log.Fatal(err)
}
}
log.Fatal(app.Listen(":4000"))
}

@ -0,0 +1,9 @@
package main
import "github.com/gofiber/fiber/v2"
func mountApiRoutes(api fiber.Router) {
api.Get("/status", func(c *fiber.Ctx) error {
return c.SendString("ok")
})
}
Loading…
Cancel
Save