Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/
.env
.env.*
*.log
.idea
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:22-alpine AS build

WORKDIR /app

COPY package.json pnpm-lock.yaml ./
RUN corepack enable && pnpm install --frozen-lockfile

COPY . .
# Uses the same build command documented in README.md (pnpm build)
RUN pnpm build

FROM nginx:1.27-alpine AS runtime

COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

34 changes: 28 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

## Overview

**Mas Ari ADS Simulator** is a personal open-source coding exploration for learning and teaching smart defense scheme logic based on fast power-flow-aware load shedding.
**Mas Ari ADS Simulator** is a personal open-source coding exploration for learning and teaching smart defense scheme
logic based on fast power-flow-aware load shedding.

This demo explores a more explainable defense scheme concept using:

Expand All @@ -30,11 +31,14 @@ This demo explores a more explainable defense scheme concept using:
- frequency injection scenarios,
- and blackstart / restoration learning sequences.

The goal is to demonstrate that defense scheme actions should be based on electrical reasoning — power direction, source availability, grid/IBT support, island balance, equipment loading, and final system impact — not only on a fixed static trip list.
The goal is to demonstrate that defense scheme actions should be based on electrical reasoning — power direction, source
availability, grid/IBT support, island balance, equipment loading, and final system impact — not only on a fixed static
trip list.

## Learning and Teaching Use

This project can be used by engineers, students, trainers, educators, and power-system practitioners to learn and teach smart defense scheme concepts, especially fast power-flow-aware load shedding and explainable trip-matrix logic.
This project can be used by engineers, students, trainers, educators, and power-system practitioners to learn and teach
smart defense scheme concepts, especially fast power-flow-aware load shedding and explainable trip-matrix logic.

It is intended as an educational and exploratory simulator, not as a protection-grade or operational control system.

Expand All @@ -52,9 +56,11 @@ It is intended as an educational and exploratory simulator, not as a protection-

This project is a personal, independent, open-source exploration.

It is **not** a commercial product. It is **not** affiliated with, endorsed by, or representing any company, employer, utility, vendor, customer system, or project owner.
It is **not** a commercial product. It is **not** affiliated with, endorsed by, or representing any company, employer,
utility, vendor, customer system, or project owner.

No confidential customer data, utility data, employer data, or proprietary project information is intended to be included in this repository.
No confidential customer data, utility data, employer data, or proprietary project information is intended to be
included in this repository.

## Development

Expand Down Expand Up @@ -82,6 +88,21 @@ Preview the production build:
pnpm preview
```

### Docker development environment:

Create `.env` file with:

```text
PORT=<PORT_NUMBER>
```

Then build and run the Docker container:

```bash
docker compose build
docker compose up -d
```

## GitHub Pages Notes

This repository is intended to be published as:
Expand All @@ -96,7 +117,8 @@ The Vite base path is configured as:
base: "/ads/";
```

If the repository is renamed again, update `base` in `vite.config.ts` and the public URLs in `index.html` and this README.
If the repository is renamed again, update `base` in `vite.config.ts` and the public URLs in `index.html` and this
README.

## License

Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
ads:
build:
context: .
dockerfile: Dockerfile
ports:
- "${PORT:-8080}:80"
restart: unless-stopped
19 changes: 19 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
server {
listen 80;
server_name _;

root /usr/share/nginx/html;
index index.html;

# This build uses Vite base=/ads/, so redirect root to that path.
location = / {
return 302 /ads/;
}

# Strip /ads/ prefix and serve the built SPA.
location /ads/ {
rewrite ^/ads/(.*)$ /$1 break;
try_files $uri $uri/ /index.html;
}
}