Skip to content

Commit d4951f4

Browse files
Merge branch 'main' into tests/issue-#103-integration-tests-for-SignUpResource
2 parents 7cf05b0 + 4769146 commit d4951f4

48 files changed

Lines changed: 8630 additions & 11662 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ updates:
1010
commit-message:
1111
prefix: chore
1212
include: scope
13+
allow:
14+
- dependency-type: direct
1315

1416
- package-ecosystem: maven
1517
directory: /timeless-api
@@ -32,3 +34,5 @@ updates:
3234
commit-message:
3335
prefix: chore
3436
include: scope
37+
allow:
38+
- dependency-type: direct
Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
name: Timeless CI
1+
name: Timeless CI - Build & Publish
22

33
on:
44
push:
55
branches: [ "main" ]
6+
paths-ignore:
7+
- 'infrastructure/**'
68
pull_request:
79
branches: [ "main" ]
10+
paths-ignore:
11+
- 'infrastructure/**'
812

913
permissions:
1014
contents: read
@@ -13,6 +17,9 @@ concurrency:
1317
group: ci-${{ github.ref }}
1418
cancel-in-progress: true
1519

20+
env:
21+
PUBLISH: ${{ github.repository == 'mcruzdev/timeless' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
22+
1623
jobs:
1724
timeless-api:
1825
name: Build & Publish - Timeless API (Java)
@@ -32,10 +39,13 @@ jobs:
3239
java-version: "21"
3340
cache: maven
3441

35-
- name: Setup Node.js 20
42+
- name: Build API
43+
run: mvn -B -ntp formatter:validate impsort:check package
44+
45+
- name: Setup Node.js 24
3646
uses: actions/setup-node@v4
3747
with:
38-
node-version: "20"
48+
node-version: "24"
3949
cache: npm
4050
cache-dependency-path: timeless-api/src/main/webui/package-lock.json
4151

@@ -51,27 +61,29 @@ jobs:
5161
working-directory: ./timeless-api/src/main/webui
5262
run: npm run prettier:check
5363

54-
- name: Ensure Maven wrapper is executable
55-
run: chmod +x mvnw
56-
5764
- name: Set up Podman
5865
uses: gacts/install-podman@v1
66+
if: env.PUBLISH == 'true'
5967
id: podman
6068

6169
- name: Login to Quay.io
70+
if: env.PUBLISH == 'true'
6271
uses: docker/login-action@v3
6372
with:
6473
registry: quay.io
6574
username: ${{ secrets.QUAY_USERNAME }}
6675
password: ${{ secrets.QUAY_PASSWORD }}
6776

68-
- name: Build with unit and integration tests
69-
run: mvn -B -ntp formatter:validate impsort:check package -Dquarkus.container-image.build=true -Dquarkus.container-image.registry=quay.io -Dquarkus.container-image.group=timeless -Dquarkus.container-image.name=timeless-api -Dquarkus.container-image.tag=${{ github.sha }}
70-
env:
71-
CHROME_BIN: ${{ steps.chrome.outputs.chrome-path }}
77+
- name: Create Docker image
78+
if: env.PUBLISH == 'true'
79+
run: docker build -f src/main/docker/Dockerfile.jvm -t quay.io/timeless/timeless-api:${GITHUB_SHA::7} .
80+
81+
- name: Push Docker image to Quay.io
82+
if: env.PUBLISH == 'true'
83+
run: docker push quay.io/timeless/timeless-api:${GITHUB_SHA::7}
7284

7385
whatsapp:
74-
name: Build & Publish - WhatsApp
86+
name: Build & Publish - WhatsApp Bot (Node.js)
7587
runs-on: ubuntu-latest
7688
defaults:
7789
run:
@@ -88,27 +100,24 @@ jobs:
88100
cache: npm
89101
cache-dependency-path: whatsapp/package-lock.json
90102

91-
- name: Install Dependencies
103+
- name: Install dependencies
92104
run: npm ci
93105

94106
- name: Check code formatting with Prettier
95107
run: npm run prettier:check
96-
97-
- name: Install pack CLI
98-
uses: buildpacks/github-actions/setup-pack@v5.0.0
99-
108+
100109
- name: Login to Quay.io
110+
if: env.PUBLISH == 'true'
101111
uses: docker/login-action@v3
102112
with:
103113
registry: quay.io
104114
username: ${{ secrets.QUAY_USERNAME }}
105115
password: ${{ secrets.QUAY_PASSWORD }}
106116

107-
- name: Build and publish WhatsApp image with Buildpacks
108-
run: |
109-
pack build quay.io/timeless/whatsapp:${{ github.sha }} \
110-
--path whatsapp \
111-
--builder paketobuildpacks/builder-jammy-base \
112-
--buildpack paketo-community/apt \
113-
--buildpack paketo-buildpacks/nodejs \
114-
--publish
117+
- name: Create Docker image
118+
if: env.PUBLISH == 'true'
119+
run: docker build -f Dockerfile -t quay.io/timeless/whatsapp:${GITHUB_SHA::7} .
120+
121+
- name: Push Docker image to Quay.io
122+
if: env.PUBLISH == 'true'
123+
run: docker push quay.io/timeless/whatsapp:${GITHUB_SHA::7}

.github/workflows/pull_request.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Timeless CI - Pull Request Build
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
paths-ignore:
7+
- 'infrastructure/**'
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
timeless-api:
18+
name: Build Timeless API (Backend)
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
working-directory: timeless-api
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v5
27+
28+
- name: Setup JDK 21
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: temurin
32+
java-version: "21"
33+
cache: maven
34+
35+
- name: Build Timeless API
36+
run: mvn -B -ntp formatter:validate impsort:check package
37+
38+
- name: Setup Node.js 24
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: "24"
42+
cache: npm
43+
cache-dependency-path: timeless-api/src/main/webui/package-lock.json
44+
45+
- name: Check code formatting with Prettier
46+
working-directory: ./timeless-api/src/main/webui
47+
run: npm run prettier:check
48+
49+
- name: Setup Chrome
50+
id: chrome
51+
uses: browser-actions/setup-chrome@v1
52+
53+
- name: Install Frontend Dependencies
54+
working-directory: ./timeless-api/src/main/webui
55+
run: npm ci
56+
57+
whatsapp:
58+
name: Build WhatsApp Bot (Node.js)
59+
runs-on: ubuntu-latest
60+
defaults:
61+
run:
62+
working-directory: whatsapp
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v5
67+
68+
- name: Setup Node.js 24
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: "24"
72+
cache: npm
73+
cache-dependency-path: whatsapp/package-lock.json
74+
75+
- name: Install Dependencies
76+
run: npm ci
77+
78+
- name: Check code formatting with Prettier
79+
run: npm run prettier:check

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ See our landing page: [**https://timeless.platformoon.com**](https://timeless.pl
88

99
This application monitors WhatsApp messages for signs of purchases (such as receipts, audio messages, transfers), extracts relevant information (amounts, descriptions), and automatically sends it to **Timeless**, helping you keep your finances organized — effortlessly.
1010

11+
## ⚠️ Project Intent
12+
13+
Timeless is primarily an educational project built to explore the intersection of automated messaging, NLP, and cloud infrastructure. While it mimics real-world financial tracking systems, its core goal is to demonstrate:
14+
15+
* **Production-like Architecture**: Integrating Java/Quarkus with AI and external messaging APIs.
16+
* **Continuous Improvement**: The codebase is designed to evolve. We encourage experiments with local LLMs and different cloud providers.
17+
* **Learning by Doing**: This is a sandbox for implementing "real-world" logic in a controlled environment. Feel free to refactor, break, and improve!
18+
1119
## 🚀 Features
1220

1321
- 📩 Automatic reading of WhatsApp messages
@@ -69,7 +77,7 @@ docker-compose up -d
6977
### Execute the whatsapp application
7078

7179
> [!NOTE]
72-
> Before you start, make sure to fill the `ALLOWED_USERS` and `OPENAI_API_KEY` variables in the `.env.local` file. This variable determines the number of users who can interact with the bot.
80+
> Before you start, make sure to fill the `ALLOWED_PHONE_NUMBERS` and `OPENAI_API_KEY` variables in the `.env.local` file. This variable determines the number of users who can interact with the bot.
7381
7482
1. Go to `whatsapp` directory and install all necessary packages:
7583

@@ -98,4 +106,4 @@ You should receive something like it:
98106

99107
### How to contribute
100108

101-
[CONTRIBUTING.md](CONTRIBUTING.md)
109+
[CONTRIBUTING.md](CONTRIBUTING.md)

RUNNING_TERRAFORM_AWS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ AWS_SECRET_ACCESS_KEY=
5757
OPENAI_API_KEY=
5858
SECURITY_KEY=
5959
INCOMING_MESSAGE_FIFO_URL=
60-
MESSAGES_PROCESSED_FIFO_URL=
60+
RECOGNIZED_MESSAGES_FIFO_URL=
6161
EOF
6262
```
6363

@@ -73,7 +73,7 @@ The table below explains the purpose of each variable along with suggested examp
7373
| `OPENAI_API_KEY` | Your OpenAI API key | `sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
7474
| `SECURITY_KEY` | Secret key used for AES encryption (must be exactly 16, 24, or 32 characters long, no accents) | `MySuperSecretAESKey12345678901234` |
7575
| `INCOMING_MESSAGE_FIFO_URL` | The URL of the SQS FIFO queue for incoming messages | `https://sqs.us-east-1.amazonaws.com/123456789/incoming-messages.fifo` |
76-
| `MESSAGES_PROCESSED_FIFO_URL`| The URL of the SQS FIFO queue for processed messages | `https://sqs.us-east-1.amazonaws.com/123456789/messages-processed.fifo` |
76+
| `RECOGNIZED_MESSAGES_FIFO_URL`| The URL of the SQS FIFO queue for processed messages | `https://sqs.us-east-1.amazonaws.com/123456789/messages-processed.fifo` |
7777

7878
4. Execute the application in Dev mode
7979

@@ -85,7 +85,7 @@ The table below explains the purpose of each variable along with suggested examp
8585

8686
6. Sign in at <http://localhost:8080>
8787

88-
7. Add the user phone number at <http://localhost:8080/home/user-configs>, this phone number must be set after on `ALLOWED_USERS`.
88+
7. Add the user phone number at <http://localhost:8080/home/user-configs>, this phone number must be set after on `ALLOWED_PHONE_NUMBERS`.
8989

9090
## Configuring and running the whatsapp application
9191

@@ -104,10 +104,10 @@ npm install
104104
| `AWS_ACCESS_KEY_ID` | Your AWS Access Key | `AKIAxxxxxxxxxxxxxxxxxx` |
105105
| `AWS_SECRET_ACCESS_KEY` | Your AWS Secret Key | `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
106106
| `ASSETS_BUCKET` | The name of the bucket where audio and images will be stored (created via Terraform) | `my-assets-bucket` |
107-
| `ALLOWED_USERS` | Comma-separated list of phone numbers allowed to interact with the bot | `5511999999999,5511888888888` |
107+
| `ALLOWED_PHONE_NUMBERS` | Comma-separated list of phone numbers allowed to interact with the bot | `5511999999999,5511888888888` |
108108
| `OPENAI_API_KEY` | Your OpenAI API Key used to access GPT and Whisper APIs | `sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` |
109109
| `INCOMING_MESSAGE_QUEUE` | URL of the SQS queue that receives incoming messages | `https://sqs.us-east-1.amazonaws.com/123456789/incoming-messages.fifo` |
110-
| `MESSAGES_PROCESSED_FIFO_URL`| URL of the SQS FIFO queue where processed messages are sent | `https://sqs.us-east-1.amazonaws.com/123456789/messages-processed.fifo` |
110+
| `RECOGNIZED_MESSAGES_FIFO_URL`| URL of the SQS FIFO queue where processed messages are sent | `https://sqs.us-east-1.amazonaws.com/123456789/messages-processed.fifo` |
111111

112112
4. Start the application
113113

@@ -127,7 +127,7 @@ npm run start
127127
2. Fill out the registration form with your details and submit it.
128128
3. Log in to your account at [http://localhost:8080](http://localhost:8080).
129129
4. Add your phone number on the [User Configs page](http://localhost:8080/home/user-configs).
130-
⚠️ Make sure the phone number matches one of the values defined in the `ALLOWED_USERS` environment variable.
130+
⚠️ Make sure the phone number matches one of the values defined in the `ALLOWED_PHONE_NUMBERS` environment variable.
131131
5. After connected the device with the scanned QR Code, send the following message: `"Achei mil reais no chão da praia"`.
132132

133133
You should receive something like it:

0 commit comments

Comments
 (0)