docs: add auto-login and git install steps to setup guide
This commit is contained in:
71
README.md
71
README.md
@@ -40,14 +40,49 @@ sudo systemctl stop sshd && sudo systemctl disable sshd
|
|||||||
|
|
||||||
Follow these steps in order after cloning the repository.
|
Follow these steps in order after cloning the repository.
|
||||||
|
|
||||||
### Step 1 — Clone the repository
|
### Step 1 — Enable auto-login (LXQt / SDDM)
|
||||||
|
|
||||||
|
This office PC uses Debian with the LXQt desktop and the SDDM login manager. Set it to log straight into the desktop on boot, no password prompt.
|
||||||
|
|
||||||
|
Create a drop-in config (replace `jj` with the actual Linux username if different):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo mkdir -p /etc/sddm.conf.d
|
||||||
|
sudo tee /etc/sddm.conf.d/autologin.conf > /dev/null <<'EOF'
|
||||||
|
[Autologin]
|
||||||
|
User=jj
|
||||||
|
Session=lxqt.desktop
|
||||||
|
EOF
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify it was written:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cat /etc/sddm.conf.d/autologin.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
Reboot to apply — the PC should boot straight to the desktop with no login screen.
|
||||||
|
|
||||||
|
> If a different session is installed, list available sessions with `ls /usr/share/xsessions/` and use that filename instead of `lxqt.desktop`.
|
||||||
|
|
||||||
|
### Step 2 — Install Git
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y git
|
||||||
|
|
||||||
|
# Verify
|
||||||
|
git --version
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3 — Clone the repository
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone <your-repo-url>
|
git clone <your-repo-url>
|
||||||
cd DentalManagementMHAprilgg
|
cd DentalManagementMHAprilgg
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2 — Install Node.js
|
### Step 4 — Install Node.js
|
||||||
|
|
||||||
Required to run the Backend and Frontend.
|
Required to run the Backend and Frontend.
|
||||||
|
|
||||||
@@ -60,7 +95,7 @@ node -v # should print v20.x.x
|
|||||||
npm -v
|
npm -v
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 3 — Install Python
|
### Step 5 — Install Python
|
||||||
|
|
||||||
Required to run the Selenium and OCR services.
|
Required to run the Selenium and OCR services.
|
||||||
|
|
||||||
@@ -71,7 +106,7 @@ sudo apt-get install -y python3 python3-pip python3-venv
|
|||||||
python3 --version # should print 3.10 or higher
|
python3 --version # should print 3.10 or higher
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 4 — Install Chrome
|
### Step 6 — Install Chrome
|
||||||
|
|
||||||
Required for the Selenium service to control a browser.
|
Required for the Selenium service to control a browser.
|
||||||
|
|
||||||
@@ -87,7 +122,7 @@ google-chrome --version
|
|||||||
|
|
||||||
> The `webdriver-manager` package (included in `requirements.txt`) automatically downloads the matching ChromeDriver — no manual driver setup needed.
|
> The `webdriver-manager` package (included in `requirements.txt`) automatically downloads the matching ChromeDriver — no manual driver setup needed.
|
||||||
|
|
||||||
### Step 5 — Install PostgreSQL
|
### Step 7 — Install PostgreSQL
|
||||||
|
|
||||||
Primary database for the application.
|
Primary database for the application.
|
||||||
|
|
||||||
@@ -125,7 +160,7 @@ psql -U postgres -d dentalapp -h 127.0.0.1 -W
|
|||||||
> DATABASE_URL="postgresql://postgres:mypassword@localhost:5432/dentalapp"
|
> DATABASE_URL="postgresql://postgres:mypassword@localhost:5432/dentalapp"
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
### Step 6 — Install Redis
|
### Step 8 — Install Redis
|
||||||
|
|
||||||
Used as the job queue for Selenium and OCR background tasks.
|
Used as the job queue for Selenium and OCR background tasks.
|
||||||
|
|
||||||
@@ -138,7 +173,7 @@ sudo systemctl start redis-server
|
|||||||
redis-cli ping # should print: PONG
|
redis-cli ping # should print: PONG
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 7 — Install rclone
|
### Step 9 — Install rclone
|
||||||
|
|
||||||
Required for cloud backup destinations (Google Drive, Dropbox, etc.).
|
Required for cloud backup destinations (Google Drive, Dropbox, etc.).
|
||||||
|
|
||||||
@@ -153,19 +188,19 @@ To verify it installed correctly, open a terminal and run:
|
|||||||
rclone version
|
rclone version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 8 — Install Node.js dependencies
|
### Step 10 — Install Node.js dependencies
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 9 — Install Python dependencies
|
### Step 11 — Install Python dependencies
|
||||||
|
|
||||||
Python dependencies are installed automatically by `npm install` (Step 8) via each service's `postinstall` script. Each service creates its own `.venv` virtual environment — no manual pip commands needed.
|
Python dependencies are installed automatically by `npm install` (Step 10) via each service's `postinstall` script. Each service creates its own `.venv` virtual environment — no manual pip commands needed.
|
||||||
|
|
||||||
> This approach is required on Debian 13+ where system-wide pip installs are blocked (PEP 668).
|
> This approach is required on Debian 13+ where system-wide pip installs are blocked (PEP 668).
|
||||||
|
|
||||||
### Step 10 — Set up environment variables
|
### Step 12 — Set up environment variables
|
||||||
|
|
||||||
Copy the `.env.example` files and fill in the required values.
|
Copy the `.env.example` files and fill in the required values.
|
||||||
|
|
||||||
@@ -173,9 +208,9 @@ Copy the `.env.example` files and fill in the required values.
|
|||||||
npm run setup:env
|
npm run setup:env
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 10a — Set the Cloudflare subdomain for this office
|
### Step 12a — Set the Cloudflare subdomain for this office
|
||||||
|
|
||||||
After running `npm run setup:env` (Step 10), open the two `.env` files and fill in this office's Cloudflare subdomain.
|
After running `npm run setup:env` (Step 12), open the two `.env` files and fill in this office's Cloudflare subdomain.
|
||||||
|
|
||||||
**`apps/Frontend/.env`**
|
**`apps/Frontend/.env`**
|
||||||
```env
|
```env
|
||||||
@@ -192,7 +227,7 @@ Replace `yoursubdomain` with this office's actual subdomain (e.g. `summitdentalc
|
|||||||
|
|
||||||
> If you skip this step, Cloudflare tunnel access will not work. LAN access still works without it.
|
> If you skip this step, Cloudflare tunnel access will not work. LAN access still works without it.
|
||||||
|
|
||||||
### Step 11 — Set up the database
|
### Step 13 — Set up the database
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Run migrations
|
# Run migrations
|
||||||
@@ -205,7 +240,7 @@ npm run db:generate
|
|||||||
npm run db:seed
|
npm run db:seed
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 12 — Configure nginx
|
### Step 14 — Configure nginx
|
||||||
|
|
||||||
Install nginx:
|
Install nginx:
|
||||||
|
|
||||||
@@ -234,7 +269,7 @@ sudo nginx -t && sudo systemctl reload nginx
|
|||||||
> **Important:** The `/api/` location block must include `proxy_set_header Authorization $http_authorization;`
|
> **Important:** The `/api/` location block must include `proxy_set_header Authorization $http_authorization;`
|
||||||
> Without it, nginx strips the Authorization header and the backend returns "Access denied. No token provided."
|
> Without it, nginx strips the Authorization header and the backend returns "Access denied. No token provided."
|
||||||
|
|
||||||
### Step 13 — Run the app
|
### Step 15 — Run the app
|
||||||
|
|
||||||
Open two terminals:
|
Open two terminals:
|
||||||
|
|
||||||
@@ -251,7 +286,7 @@ cd apps/SeleniumService
|
|||||||
.venv/bin/python3 agent.py
|
.venv/bin/python3 agent.py
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 14 — Create desktop shortcuts (optional)
|
### Step 16 — Create desktop shortcuts (optional)
|
||||||
|
|
||||||
Instead of opening two terminals manually every time, you can create desktop shortcuts that start and stop all services with a single double-click.
|
Instead of opening two terminals manually every time, you can create desktop shortcuts that start and stop all services with a single double-click.
|
||||||
|
|
||||||
@@ -582,7 +617,7 @@ In the Cloudflare dashboard for `mydentalofficemanagement.com` → DNS → Add r
|
|||||||
- Type: `A`, Name: `local-<office>` (e.g. `local-summit`), Content: this PC's LAN IP
|
- Type: `A`, Name: `local-<office>` (e.g. `local-summit`), Content: this PC's LAN IP
|
||||||
- **Proxy status: DNS only** (grey cloud) — required, Cloudflare can't proxy a private IP
|
- **Proxy status: DNS only** (grey cloud) — required, Cloudflare can't proxy a private IP
|
||||||
|
|
||||||
### Step 2 — Install nginx (if not already done in Step 12 above)
|
### Step 2 — Install nginx (if not already done in Step 14 above)
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt update
|
sudo apt update
|
||||||
|
|||||||
Reference in New Issue
Block a user