|
|
4 years ago | |
|---|---|---|
| _content | 4 years ago | |
| _docs/screenshots | 4 years ago | |
| _frontend | 4 years ago | |
| _views | 4 years ago | |
| articles | 4 years ago | |
| auth | 4 years ago | |
| cmd/phc-website-server | 4 years ago | |
| config | 4 years ago | |
| handler | 4 years ago | |
| model | 4 years ago | |
| server | 4 years ago | |
| templates | 4 years ago | |
| util | 4 years ago | |
| .dockerignore | 4 years ago | |
| .env.dev | 4 years ago | |
| .gitignore | 4 years ago | |
| Dockerfile | 4 years ago | |
| Makefile | 4 years ago | |
| README.md | 4 years ago | |
| go.mod | 4 years ago | |
| go.sum | 4 years ago | |
| storia.go | 4 years ago | |
| storia.json | 4 years ago | |
| utenti.go | 4 years ago | |
README.md
Nuovo Sito PHC
Repo del server del nuovo sito per il PHC.
Dipendenze
-
Golang
-
github.com/alecthomas/chroma -
github.com/alecthomas/repr -
github.com/go-chi/chi/v5 -
github.com/joho/godotenv -
github.com/litao91/goldmark-mathjax -
github.com/yuin/goldmark -
github.com/yuin/goldmark-highlighting -
gopkg.in/yaml.v3
-
-
NodeJS
-
AlpineJS
-
FuseJS
-
Setup
Per ottenere il progetto basta fare
$ git clone https://git.phc.dm.unipi.it/phc/website
$ cd frontend/
frontend/ $ npm install
frontend/ $ cd ..
$ make frontend
Development
Setup
Copiare il file .env.dev in .env per dire al server di lavorare in modalità di development e su quale indirizzo servire il sito, poi avviare il server.
$ cp .env.dev .env
$ go run .
Server
Un comando comodo in fase di development che usa entr è
$ find . -type f -name '*.go' | entr -r go run .
# O anche con fd...
$ fd -e go | entr -r go run .
Frontend
Se si sta anche modificando codice dentro frontend/, in contemporanea serve anche fare
$ make frontend
# O anche con un watcher...
$ fd -e js | entr make frontend
Environment Variables
-
MODEPuò essere
production(default) odevelopment. -
HOSTIndirizzo (locale) sul quale servire il sito, di default è
localhost:8000. -
MAILIndirizzo di posta elettronica per contattare gli amministratori del sito, che compare nel footer di ogni pagina.
-
<SERVIZIO>_URLRappresentano link ad altri servizi forniti, è comodo impostarli per testare tutto in locale su varie porte (e poi in produzione i vari url diventano link a sotto-domini del sito principale).
Per ora ci sono
GIT_URL,CHAT_URLeUSER_PAGES_BASE_URL.
Altri Servizi
Questo servizio dipende dal servizio di autenticazione per permettere agli utenti di autenticarsi usando vari meccanismi.
Il servizio di autenticazione di default girerà su localhost:3535 ed è documentato sulla repo auth-service