Skip to content

Commit 6a5ac8c

Browse files
authored
CI/Deploy for PNPM (#68)
* update readme w/ logo * run npm package audit * update package lock after fix * some random changes I don't know about... merge? * update pnpm lock * update to run pnpm only * add lint to ci
1 parent 0cb78ab commit 6a5ac8c

File tree

8 files changed

+304
-7680
lines changed

8 files changed

+304
-7680
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ jobs:
3434
working-directory: website
3535
run: pnpm install --frozen-lockfile
3636

37-
- name: Run build
37+
- name: Lint
38+
working-directory: website
39+
run: pnpm run lint
40+
41+
- name: Type check
42+
working-directory: website
43+
run: pnpm exec tsc --noEmit
44+
45+
- name: Build
3846
working-directory: website
3947
run: pnpm run build

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
3232
# =========== BUILD & DEPLOY WEBSITE ===========
3333
cd /home/ali/loglife-dev/website &&
34-
npm ci &&
35-
npm run build &&
34+
pnpm install --frozen-lockfile &&
35+
pnpm run build &&
3636
sudo systemctl restart loglife-website.service
3737
"
3838
@@ -49,7 +49,7 @@ jobs:
4949
5050
# =========== BUILD & DEPLOY WEBSITE ===========
5151
cd /home/ali/loglife-prod/website &&
52-
npm ci &&
53-
npm run build &&
52+
pnpm install --frozen-lockfile &&
53+
pnpm run build &&
5454
sudo systemctl restart loglife-website.service
5555
"

README.md

Lines changed: 16 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
**Log life. Live better.**
77

88
<p align="center">
9-
<img src="https://img.shields.io/badge/Python-3.11+-3776AB?style=flat-square&logo=python&logoColor=white" alt="Python Version" />
10-
<img src="https://img.shields.io/badge/Node.js-16+-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node Version" />
9+
<img src="https://img.shields.io/badge/Next.js-15-000000?style=flat-square&logo=next.js&logoColor=white" alt="Next.js Version" />
10+
<img src="https://img.shields.io/badge/Node.js-24+-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node Version" />
1111
<img src="https://img.shields.io/badge/WhatsApp-Supported-25D366?style=flat-square&logo=whatsapp&logoColor=white" alt="WhatsApp Integration" />
1212
<img src="https://img.shields.io/badge/Telegram-Soon...-0088CC?style=flat-square&logo=telegram&logoColor=white" alt="Telegram Integration" />
1313
<img src="https://img.shields.io/badge/iMessage-Soon...-0A84FF?style=flat-square&logo=apple&logoColor=white" alt="iMessage Integration" />
@@ -21,7 +21,7 @@
2121

2222
**LogLife** is an audio-first, chat-native tool for people who need a frictionless way to journal and think about their lives. Living inside your favorite chat app, LogLife helps you capture daily notes, see behavior patterns, and turn those insights into steady progress.
2323

24-
It combines a minimalist interface with powerful backend processing to help you **Capture** thoughts instantly, **Reflect** on your day, and **Grow** by tracking your goals without the guilt.
24+
It combines a minimalist interface with powerful AI processing to help you **Capture** thoughts instantly, **Reflect** on your day, and **Grow** by tracking your goals without the guilt.
2525

2626
---
2727

@@ -36,108 +36,36 @@ It combines a minimalist interface with powerful backend processing to help you
3636

3737
---
3838

39-
## 📂 Repository Structure
40-
41-
This repository acts as a **Monorepo** containing three distinct components:
42-
43-
| Component | Path | Description |
44-
| :--- | :--- | :--- |
45-
| **Core Framework** | `src/loglife/core` | A reusable, unopinionated Python library for building WhatsApp bots. It handles **Threading**, **Queues**, and **Transport Adapters**. Use this if you want to build *your own* bot. |
46-
| **Reference App** | `src/loglife/app` | The "LogLife" product (Journaling & Goal Tracking) built *on top* of the Core Framework. It implements **Business Logic**, **Database Models**, and **AI Processing**. |
47-
| **Website** | `website/` | The Next.js landing page (loglife.co) that showcases the product and hosts blogposts. |
48-
49-
```text
50-
loglife/
51-
├── src/loglife/
52-
│ ├── core/ # The reusable Bot Framework
53-
│ │ ├── messaging.py # Threading Engine w/ Queues (Receiver & Sender)
54-
│ │ ├── transports.py # Transport Adapters (WhatsApp/Emulator)
55-
│ │ ├── startup.py # App Bootstrap Logic
56-
│ │ └── interface.py # Public API (recv_msg, send_msg)
57-
│ └── app/ # The Journaling App Logic
58-
│ ├── logic/ # Business Logic (Text/Audio handlers)
59-
│ ├── db/ # SQLite Models & Schema
60-
│ └── services/ # Background Workers (Reminders, UI)
61-
├── website/ # The Next.js Landing Page
62-
└── whatsapp-client/ # The Node.js WhatsApp Bridge
63-
```
64-
65-
---
66-
67-
## 🚀 How It Works
68-
69-
### The User Experience (App)
70-
This diagram shows the high-level flow of how a user interacts with the LogLife Journaling App:
71-
72-
<div align="center">
73-
<img src="docs/figures/png/user-flow.png" alt="LogLife User Flow" width="800" />
74-
</div>
75-
76-
1. **Chat:** You interact with the bot via text or audio.
77-
2. **Process:** The system processes your input (transcribing audio, updating database).
78-
3. **Respond:** LogLife replies with confirmations, summaries, or next steps.
79-
80-
### The Internals (Core)
81-
This diagram shows how the `loglife.core` library handles the threading and message queues under the hood:
82-
83-
<div align="center">
84-
<img src="docs/figures/png/system-overview.png" alt="LogLife Architecture" width="800" />
85-
</div>
86-
87-
* **Producer-Consumer Architecture:** Ensures the web server (Webhook) is never blocked by slow processing tasks.
88-
* **Transport Layer:** Decouples logic from the specific delivery mechanism (WhatsApp vs. Emulator).
89-
90-
---
91-
9239
## 🏁 Getting Started
9340

94-
Follow these steps to set up LogLife on your local machine.
95-
9641
### Prerequisites
97-
* Python 3.11+ and Node.js 16+
98-
* A WhatsApp account
42+
* Node.js 24+
43+
* pnpm
9944

100-
### Installation
45+
### Running the Website
10146

10247
1. **Clone the repository:**
10348
```bash
104-
git clone https://github.com/jmoraispk/life-bot.git
105-
cd loglife
49+
git clone https://github.com/jmoraispk/loglife.git
50+
cd loglife/website
10651
```
10752

108-
2. **Configure API Keys:**
109-
Copy the example environment file and add your keys:
53+
2. **Install dependencies:**
11054
```bash
111-
cp .env.example .env
112-
# Edit .env to add OPENAI_API_KEY and ASSEMBLYAI_API_KEY
55+
pnpm install
11356
```
11457

115-
3. **Run the Backend (Python):**
58+
3. **Run the development server:**
11659
```bash
117-
uv run src/loglife/main.py
60+
pnpm dev
11861
```
119-
*The server will start at `http://localhost:8080`.*
62+
*The site will be available at `http://localhost:3000`.*
12063

121-
4. **Run the Client (Node.js):**
122-
Open a new terminal window:
64+
4. **Build for production:**
12365
```bash
124-
cd whatsapp-client
125-
npm install && node index.js
66+
pnpm build
67+
pnpm start
12668
```
127-
*Scan the QR code with your WhatsApp mobile app (Linked Devices).*
128-
129-
---
130-
131-
## 📚 Documentation
132-
133-
For deep dives into specific topics, check the `docs/` folder:
134-
135-
| Section | Description |
136-
| :--- | :--- |
137-
| [**User Manual**](docs/usage/overview.md) | How to use the bot (Journaling, Goals, Reminders). |
138-
| [**Developer Guide**](docs/developer/overview.md) | Detailed Setup, Tech Stack, and Testing. |
139-
| [**Core Architecture**](docs/core/architecture.md) | Deep dive into Threads, Queues, and Transports. |
140-
| [**Quickstart**](docs/core/quickstart.md) | Guide to building your own custom bot. |
14169

14270
---
14371

docs/figures/svg/loglife_static_dynamic.drawio.svg

Lines changed: 3 additions & 3 deletions
Loading

0 commit comments

Comments
 (0)