Improved main project readme.

This commit is contained in:
Andrew Lalis 2023-05-17 11:38:26 +02:00
parent b347cd609e
commit ba4a0c16d6
2 changed files with 62 additions and 7 deletions

View File

@ -1,7 +1,50 @@
# Gymboard
Leaderboards for your local community gym.
Leaderboards and social lifting for your local community gym.
Gymboard is a platform for sharing videos of your gym lifts with the world,
from your local gym to the world's stage.
## Architecture Overview
Gymboard is designed as a sort of hybrid architecture combining the best of
microservices and monoliths. Here's a short list of each project that makes
up the Gymboard ecosystem, and what they do:
| Project | Type | Description |
| --- | --- | --- |
| 💻 **gymboard-app** | TS, VueJS, Quasar | A front-end web application for users accessing Gymboard. |
| 🧬 **gymboard-api** | Java, Spring | The *main* backend service that the app talks to. Includes auth and most business logic. |
| 🔍 **gymboard-search** | Java, Lucene | An indexing and searching service that scrapes data from *gymboard-api* to build Lucene search indexes. |
| 🗂 **gymboard-cdn** | Java, Spring | A minimal content-delivery service that manages general file storage, including video processing. |
| 🛠 **gymboard-cli** | D | **WIP** command-line-interface for managing all services for development and deployment. |
| 📸 **gymboard-uploads** | D, Handy-Httpd | **WIP** dedicated service for video upload processing, to extract functionality from *gymboard-cdn*. |
## Development
Gymboard is comprised of a variety of components, each in its own directory, and with its own project format. Follow the instructions in the README of the respective project to set that one up.
A `docker-compose.yml` file is defined in this directory, and it defines a set of services that may be used by one or more services. Install docker on your system if you haven't already, and run `docker-compose up -d` to start the services.
Gymboard is comprised of a variety of components, each in its own directory,
and with its own project format. Follow the instructions in the README of the
respective project to set that one up.
A `docker-compose.yml` file is defined in this directory, and it defines a set
of services that may be used by one or more services. Install docker on your
system if you haven't already, and run `docker-compose up -d` to start the
services.
**WIP:**
A `build_apps.d` script is available to try and build all projects and collect
their artifacts in a `build/` directory for deployment.
> Eventually, this functionality will be merged into *gymboard-cli*.
### Local Environment
The requirements to develop each project depend of course on the type of
project. But in general, the following software recommendations should hold:
| Type | Requirements |
| --- | --- |
| **Java** | [Latest LTS version](https://adoptium.net/en-GB/temurin/releases/), latest Maven version |
| **VueJS** | Vue 3, with a recent version of NodeJS and NPM or similar. |
| **D** | [D toolchain](https://dlang.org/download.html) (compiler + dub) for D version >= 2.103, DMD recommended compiler |
[Docker](https://www.docker.com/) is recommended for running local dependencies
like DB, mail server, message queues, etc.

View File

@ -6,6 +6,8 @@
* thread.
*
* Supply the "clean" command to remove all build artifacts instead of building.
*
* Eventually, this will be migrated to gymboard-cli.
*/
module build_apps;
@ -20,7 +22,8 @@ enum BUILDS_DIR = "build";
int main(string[] args) {
if (args.length > 1 && args[1] == "clean") {
rmdirRecurse(BUILDS_DIR);
writeln("Cleaning builds");
if (exists(BUILDS_DIR)) rmdirRecurse(BUILDS_DIR);
return 0;
}
Thread[] buildThreads = [
@ -91,8 +94,10 @@ int runBuild(const BuildSpec spec) {
string buildDir = buildPath(BUILDS_DIR, spec.name);
if (exists(buildDir)) rmdirRecurse(buildDir);
mkdirRecurse(buildDir);
File buildLogFile = File(buildPath(buildDir, "build.log"), "w");
File buildErrorLogFile = File(buildPath(buildDir, "build-error.log"), "w");
const logFilePath = buildPath(buildDir, "build.log");
const errorLogFilePath = buildPath(buildDir, "build-error.log");
File buildLogFile = File(logFilePath, "w");
File buildErrorLogFile = File(errorLogFilePath, "w");
Pid pid = spawnShell(
spec.buildCommand,
std.stdio.stdin,
@ -104,7 +109,14 @@ int runBuild(const BuildSpec spec) {
nativeShell()
);
int result = wait(pid);
if (result != 0) return result;
if (result != 0) {
writefln!"Build command failed for build \"%s\". Check %s for more info."(spec.name, errorLogFilePath);
return result;
}
// Clean up unused log files.
if (getSize(logFilePath) == 0) std.file.remove(logFilePath);
if (getSize(errorLogFilePath) == 0) std.file.remove(errorLogFilePath);
// Find and extract artifacts.
bool artifactFound = false;