You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.2 KiB
Markdown
62 lines
1.2 KiB
Markdown
# Posti DM
|
|
|
|

|
|
|
|
Prototipo di applicazione web per prenotare posti in dipartimento.
|
|
|
|
- FrontEnd: Vite + VanillaJS (?)
|
|
|
|
- BackEnd: Golang + go-chi + godotent + sqlite3 (?)
|
|
|
|
## Usage
|
|
|
|
The first time you want to build the project you should run first
|
|
|
|
```bash
|
|
$ make setup
|
|
```
|
|
|
|
Then to build the client and the server just run
|
|
|
|
```bash
|
|
$ make build
|
|
```
|
|
|
|
### Running: In Development
|
|
|
|
You need to start two concurrent processes as follows
|
|
|
|
```bash
|
|
#
|
|
# Firstly start the backend
|
|
#
|
|
$ cd server
|
|
$ go run .
|
|
|
|
# or also to reload the server on changes with "entr"
|
|
$ find -name '*.go' | entr -r -s 'go run .'
|
|
|
|
#
|
|
# Then in another shell start ViteJS to live-reload the frontend
|
|
#
|
|
$ cd client
|
|
$ npm run dev
|
|
```
|
|
|
|
### Running: In Production
|
|
|
|
First make sure that the local `.env` is set for running in production mode by specifing the `MODE` environment variable. The `HOST` and `URL` should match but can be whatever you want for example
|
|
|
|
```bash
|
|
MODE=production
|
|
HOST=:3000
|
|
URL=http://localhost:3000
|
|
```
|
|
|
|
Then just `make build` at the root of the project and then run the following (ehm forse alcuni path sono relativi rispetto alla directory corrent quindi per ora è meglio fare `cd` dentro `dist/`)
|
|
|
|
```bash
|
|
$ cd dist/
|
|
$ ./posti-dm
|
|
```
|