Skip to content

Commit

Permalink
update makefile and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo committed Oct 1, 2024
1 parent 19597ae commit a6567f6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 91 deletions.
52 changes: 12 additions & 40 deletions public-site/Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,15 @@
.PHONY: lint
lint:
npm run "lint"
npm run "lint-ts"
.PHONY: dev-up
dev-up:
docker compose --profile dev up --build

.PHONY: dev-down
dev-down:
docker compose --profile dev down

.PHONY: lint-strict
lint-strict:
npm run "lint-strict"

.PHONY: run
run:
npm run start

.PHONY: build-dist run-dist run-dist-rebuilt

build-dist:
npm run build

run-dist:
npm run serve

run-dist-rebuilt: build-dist run-dist

.PHONY: run-docker-dev
run-docker-dev:
docker compose -f docker-compose.yml up

.PHONY: build-docker
build-docker:
docker build . -t public-site

.PHONY: run-docker
run-docker:
docker run -it -p 8080:8080 public-site

.PHONY: run-docker-rebuilt
run-docker-rebuilt: build-docker run-docker

.PHONY: down
down:
docker compose down
.PHONY: prod-up
prod-up:
docker compose --profile prod up --build

.PHONY: prod-down
prod-down:
docker compose --profile prod down
62 changes: 11 additions & 51 deletions public-site/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Radix Public Site

This is the public site for promoting, documenting & showcasing the Radix
platform. It is a static site built with [VuePress 2](https://v2.vuepress.vuejs.org/).
platform. It is a static site built with [Docusaurus](https://docusaurus.io).

## Running, building

### The easy way

`docker compose --profile dev up --build`
`make dev-up`: Starts Docker compose services beloning to the`dev` profile.

This starts the Docusaurus developer server on port 8000, and NGINX on port 8080 which proxies requests to the docusaurus server. This ensures that your browser receives the same security related headers (defined in ./proxy/headers) as when you build and run the Dockerfile container image. Changes to source files are immediatly shown in the browser.

You can see the site on <http://localhost:8080>

Stop the server with Ctrl+C, but also run `docker compose --profile dev down` to clean up the
Stop the server with Ctrl+C, but also run `make dev-down` to clean up the
Docker state.

If you need a shell in the container:
Expand All @@ -22,71 +22,31 @@ If you need a shell in the container:

NB: The search plugin does not work when running the docusaurus development server.

You can also build and run the container image intended for production environments by running `docker compose --profile prod up --build`. To stop and cleanup you run `docker compose --profile prod down`.

**Windows**: There is currently [a
problem](https://github.com/docker/for-win/issues/56) with Docker that prevents
auto-reload of the development server from working when source files change. A
simple workaround is to use [a little watcher
process](https://github.com/FrodeHus/docker-windows-volume-watcher/releases).
You can also build and run the container image intended for production environments by running `make prod-up`. To stop and cleanup you run `make prod-down`.

### The other way

You can also run docusurus locally. All that is needed is NodeJS and NPM. In the root folder of the project run `npm i` to fetch dependencies followed by `npm run start` to start serving the development environment of the Public Site. The disadvantage is that you will not catch errors caused by the security headers set by NGINX.

## Folder structure

The site content is organised within `/docs/src/`. In here you'll find:
## Files and folder structure

- `/.vuepress/`: The Vuepress source folder containing the main site configuration.
- `/.vuepress/components/`: Custom user-created Vuepress components.
- `/.vuepress/public/`: All public content for the Public Site, such as images and general stylesheets.
- `/.vuepress/styles/`: Style override files for Vuepress. See the [CSS Section](#CSS) below.

But the interesting bits are the actual content:
File `docusaurus.config.ts` contains the main configuration for Docusaurus. This is where we configure the overall page layout like headers, footers, navbar, themes etc.

- `/community/`: Information about the Radix community and team.
- `/docs/`: General concepts (topics).
- `/feature/`: List of all fratures in Radix.
- `/guides/`: User-friendly, conversational guides on how to achieve specific objectives.
- `/references/`: Reference documentation for end-users.
- `/other/`: Documentation not directly related to any specific category.
- `/radix-config/`: Reference documentation for end-users.
- `/start/`: Getting started guide

## docusaurus

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

[Create an application](https://docusaurus.io/docs/installation)
```bash
npx create-docusaurus@latest public-site classic --typescript
```

## docusaurus development

`npm start`
Starts the development server.

`npm run build`
Bundles your website into static files for production.

`npm run serve`
Serves the built website locally.

`npm run deploy`
Publishes the website to GitHub pages.

We recommend that you begin by typing:

`cd public-site`
`npm start`

## Production build

The production build is containerised in the project's `Dockerfile`. To run the
build image locally:

docker build -t radix-public-site-prod .
docker run --name radix-public-site-prod_container --rm -p 8080:8080 radix-public-site-prod

The web server will be available on <http://localhost:8080>

# Credits

trees by Made x Made from the Noun Project: <https://thenounproject.com/term/trees/1723897/>
Expand Down

0 comments on commit a6567f6

Please sign in to comment.