More detailed build instructions
This commit is contained in:
parent
6450e73435
commit
1f4eda293a
1 changed files with 16 additions and 2 deletions
18
BUILD.md
18
BUILD.md
|
@ -1,10 +1,16 @@
|
||||||
# Build Instructions
|
# Build Instructions
|
||||||
|
|
||||||
|
The build is fairly simple, and I intend to keep it that way. The project is split into two main parts: the backend and the frontend.
|
||||||
|
|
||||||
|
Making all of these parts work properly under linux/macOS is fairly simple, but Windows is untested territory. You can always contact [Billy G™®©](https://support.microsoft.com) for help.
|
||||||
|
|
||||||
## Backend
|
## Backend
|
||||||
|
|
||||||
For demo purposes, the backend uses sqlite3 as the database. The database is stored in the `backend` directory.
|
For demo purposes, the backend uses sqlite3 as the database. The database is stored in the `backend` directory.
|
||||||
|
|
||||||
For migrating the database, simply navigate to the backend directory and run `make migrate`, this will initialize the sqlite3 database.
|
For future development, the database will be migrated to a more robust database such as PostgreSQL. This will require a few changes to the code, but the migration should be fairly simple. Practical difference for the programmer is the requirement of a running PostgreSQL server, for which a container can be used.
|
||||||
|
|
||||||
|
For initializing the database, simply navigate to the backend directory and run `make migrate`, which will create the database and the necessary tables.
|
||||||
|
|
||||||
To build and run the main server binary:
|
To build and run the main server binary:
|
||||||
|
|
||||||
|
@ -15,8 +21,14 @@ make run
|
||||||
|
|
||||||
The server will be running on `localhost:8080`. This server does not hot reload, so you will need to restart the server after making changes.
|
The server will be running on `localhost:8080`. This server does not hot reload, so you will need to restart the server after making changes.
|
||||||
|
|
||||||
|
If you ever wonder what the makefile does, you can always inspect it. It's quite simple and self-explanatory.
|
||||||
|
|
||||||
## Frontend
|
## Frontend
|
||||||
|
|
||||||
|
The frontend code might look very intimidating at first, but it's actually quite simple. The vast majority of the code is boilerplate and configuration.
|
||||||
|
|
||||||
|
The important parts resides in the `src` directory, which contains the actual React components and corresponding styles.
|
||||||
|
|
||||||
The frontend is built using Vite with React. Vite handles hot reloading and bundling.
|
The frontend is built using Vite with React. Vite handles hot reloading and bundling.
|
||||||
|
|
||||||
First, you need to pull in the dependencies by running `npm install` in the frontend directory.
|
First, you need to pull in the dependencies by running `npm install` in the frontend directory.
|
||||||
|
@ -24,4 +36,6 @@ To spin up the development server, run `npm run dev`. This will start the develo
|
||||||
|
|
||||||
## Release Builds
|
## Release Builds
|
||||||
|
|
||||||
Under Construction TM
|
The release build for the backend is a simple binary that can be run on any machine. The release build for the frontend is a static bundle that can be served by any web server.
|
||||||
|
|
||||||
|
We combine the frontend and backend into a single container using Podman/Docker. The `Containerfile` (also known as a Dockerfile) in the container directory is used to build the container. To see exactly how the container is built, refer to the `Containerfile`.
|
Loading…
Reference in a new issue