diff --git a/README.md b/README.md index 7ba9e7e7..433b09b4 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,64 @@ -# Laravel using PostgreSQL in Docker +# SIDES -

- docker+laravel -

+**Sabo Integrated Debris Flow Monitoring and Early Warning System** -## Introduction +Flood and debris flow early warning system for Sungai Kupang, Malaysia. Operated under Jabatan Pengairan dan Saliran (JPS) — the Malaysian Department of Irrigation and Drainage. -Build a simple laravel application development environment with docker compose. +Monitors rainfall, water levels, and siren activations at remote telemetry stations with a real-time web dashboard, interactive map, and push notifications. - -## Requirement - -- Docker ^19.* - - -## Installation - -1. Git clone & move to working directory -2. Settings your credentials, copy `.env.example` to `.env` -3. Execute the following command for create application +## Quick Start ```bash -$ make create-project +git clone && cd tckdev +cp .env.example .env # Configure credentials +cp src/.env.example src/.env # Configure Laravel +docker compose up -d --build ``` -4. Next, set environment DB for app laravel in `src/.env` variable : +The app container automatically runs migrations, seeding, and asset building on first start. Access the dashboard at `http://localhost`. + +## Documentation + +Full documentation is in [`docs/`](docs/): + +| Document | Description | +|----------|-------------| +| [01-OVERVIEW](docs/01-OVERVIEW.md) | Project overview, purpose, and high-level architecture | +| [02-ARCHITECTURE](docs/02-ARCHITECTURE.md) | Technology stack, container layout, request flow, middleware | +| [03-DEPLOYMENT](docs/03-DEPLOYMENT.md) | Docker Compose deployment, reverse proxy setup, production checklist | +| [04-DATA-PIPELINE](docs/04-DATA-PIPELINE.md) | Python autoscript, FTP ingestion, CSV parsing, alert triggers | +| [05-FEATURES](docs/05-FEATURES.md) | User-facing features, routes, and access control | +| [06-DATABASE](docs/06-DATABASE.md) | PostgreSQL schema, tables, relationships | +| [07-API](docs/07-API.md) | REST API reference for station data and push notifications | +| [08-CONFIGURATION](docs/08-CONFIGURATION.md) | Environment variables, Docker Compose config, Nginx, Laravel | + +## Stack + +- **Backend**: Laravel 12 (PHP 8.2-FPM) +- **Database**: PostgreSQL 16 +- **Frontend**: Blade + Alpine.js + Tailwind CSS + Leaflet.js +- **Push Notifications**: Firebase Cloud Messaging +- **Data Pipeline**: Python (psycopg2, ftplib) +- **Deployment**: Docker Compose (nginx, php-fpm, postgres, pgadmin) + +## Project Structure + ``` -DB_CONNECTION=pgsql -DB_HOST=postgres -DB_PORT=5432 -DB_DATABASE= // same in root .env variable POSTGRES_DB -DB_USERNAME= // same in root .env variable POSTGRES_USER -DB_PASSWORD= // same in root .env variable POSTGRES_PASSWORD +tckdev/ +├── src/ # Laravel application (bind-mounted into containers) +│ ├── app/Http/Controllers/ +│ ├── database/migrations/ +│ ├── routes/ +│ ├── resources/views/ +│ └── .env +├── autoscript/ +│ └── sidesdecode.py # Python data ingestion pipeline +├── docker/ +│ ├── nginx/default.conf +│ └── entrypoint.sh +├── docs/ # Documentation wiki +├── docker-compose.yml +├── Dockerfile +├── .env # Docker-level credentials +└── .env.example ``` - -5. show application in [http://localhost:85](http://localhost:85) - -app+laravel - -1. show adminer in [http://localhost:8080](http://localhost:8080) - -adminer - -7. show pgadmin in [http://localhost:5050](http://localhost:5050) - -pgadmin - -8. list execute command in [Makefile](Makefile). - -## Container details : -- ``app`` use image: - - [php](https://hub.docker.com/_/php):8.2-fpm - - [composer](https://hub.docker.com/_/composer):2.3 - - [npm](https://deb.nodesource.com/setup_lts.x):latest -- ``web`` use image: - - [nginx](https://hub.docker.com/_/nginx):stable-alpine -- ``db`` use image: - - [postgres](https://hub.docker.com/_/postgres):15 -- ``adminer`` use image: - - [adminer](https://hub.docker.com/_/adminer):latest - -*Optional* -- ``pgadmin`` use image: - - [pgadmin](https://hub.docker.com/_/pgadmin):latest