Skip to content
/ myblog Public

'My Blog' - A full-stack web application with a custom, from-scratch backend server and React frontend.

License

Notifications You must be signed in to change notification settings

m-flak/myblog

Repository files navigation

myBLOG

A full-stack web application that shall be my personal blog

Configuration

Build

Before building the backend & frontend, initial configuration must be performed. This can be accomplished via:

git branch deploy
git checkout deploy
python configure.py

Follow the instructions to configure both the frontend & backend.

Afterwards, apply the generated config/database_users.sql file to the database on your server. This can be done like this:

mysql -u root -p < database_users.sql

You'll populate the database with tables and a user account using the server executable. We'll get to that later in Backend Setup.

Web Server & Host Configuration

Both an example systemd unit file and nginx configuration can be found in the srvconfig directory.

Frontend Setup

Building

For general questions about building the frontend, see this file.

Deployment

Refer to the sample nginx configuration for any questions. The frontend is deployed like any React application.

Backend Setup

Building

Building the backend requires maven. You'll probably need to remove this from pom.xml:

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M3</version>
          <configuration>
              <argLine>--enable-preview</argLine>
          </configuration>
        </plugin>

Remove that in order to disable the tests, because the tests require a functional MySQL database & account. The testing database and account is included in the database_users.sql file.

Run the mvn package command from within the server directory.

Post-Build

Before the server can get to work, the database must be filled with tables, and a user account needs to be created.

For the tables: java --enable-preview -jar server-1.0-shaded.jar --mode migrate

For the user: java --enable-preview -jar server-1.0-shaded.jar --mode shell