Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cashshare-Telegram V1.0.0 #22

Merged
merged 29 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
11f7720
fix: abstract sendMessage function
ivanleekk Sep 20, 2024
f7341a5
feat: add transactions works
ivanleekk Sep 22, 2024
0a7f7c6
fix: refactor handlers to own files
ivanleekk Sep 22, 2024
b1828a4
feat: add userGroupBalance Table
ivanleekk Sep 22, 2024
269099a
feat: add group balance checker and balance validation when transacti…
ivanleekk Sep 22, 2024
b0d0277
Merge pull request #10 from ivanleekk/feat/add-transaction
ivanleekk Sep 22, 2024
6761745
feat: add repayment to any individual
ivanleekk Sep 22, 2024
05e32d1
Merge pull request #12 from ivanleekk/feat/add-repayments
ivanleekk Sep 22, 2024
9b4beb9
Create codecov.yml
ivanleekk Sep 22, 2024
f752e30
Merge pull request #15 from ivanleekk/ivanleekk-patch-1
ivanleekk Sep 22, 2024
89a1453
feat: able to view transactions in the group
ivanleekk Sep 27, 2024
2092b45
feat: added transaction type to the schema
ivanleekk Sep 27, 2024
90d9e0c
Merge pull request #17 from ivanleekk/feat/add-transaction-logs
ivanleekk Sep 27, 2024
df1745c
feat: update return values and add serverless deployment
ivanleekk Sep 28, 2024
05bea6f
Merge pull request #18 from ivanleekk/feat/aws-deployment
ivanleekk Sep 28, 2024
22f5a64
docs: update README
ivanleekk Sep 28, 2024
789169c
docs: update README
ivanleekk Sep 28, 2024
9e26863
Merge pull request #19 from ivanleekk/docs/update-readme
ivanleekk Sep 28, 2024
3ecd5ca
feat: add serverless offline
ivanleekk Sep 28, 2024
dbe7aa9
Merge pull request #20 from ivanleekk/docs/update-readme
ivanleekk Sep 28, 2024
5cecc49
feat: remove res from all files
ivanleekk Sep 28, 2024
1c96cdc
feat: add globalHandler.test.ts
ivanleekk Sep 28, 2024
2471abd
feat: add addHandler.test.ts
ivanleekk Sep 28, 2024
bf16cbc
feat: add balanceHandler.test.ts
ivanleekk Sep 28, 2024
6a663e5
feat: add payHandler.test.ts
ivanleekk Sep 28, 2024
40182b5
feat: add startHandler.test.ts
ivanleekk Sep 28, 2024
bcff888
feat: add transactionsHandler.test.ts
ivanleekk Sep 28, 2024
928c282
feat: add vitest coverage
ivanleekk Sep 28, 2024
c3983c1
Merge pull request #21 from ivanleekk/feat/add-test
ivanleekk Sep 28, 2024
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
31 changes: 31 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run tests and upload coverage

on:
pull_request:
branches:
- main
- development

jobs:
test:
name: Run tests and collect coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install

- name: Run tests
run: npx vitest run --coverage

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules
.env
.idea
.serverless
dist
coverage
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# cashshare-telegram
A telegram bot that can be added to groups to share costs with people in the group

## Deployment
1. Clone the repository
2. Install the requirements
3. Create a `.env` file with the following content:
```
TELEGRAM_BOT_API_KEY="your-telegram-bot-api-key"
TELEGRAM_BOT_REQUEST_URL="https://api.telegram.org/bot{bot-api-key}"

# Connect to Supabase via connection pooling with Supavisor.
DATABASE_URL="your-database-url"

# Direct connection to the database. Used for migrations.
DIRECT_URL="your-database-url"

SERVERLESS_ACCESS_KEY="your-serverless-access-key"

PRISMA_CLIENT_ENGINE_TYPE="binary"
```

4. Run the following commands:
```bash
npx prisma migrate dev
npx prisma generate
```

5. Run the bot using the following command:
```bash
npx serverless deploy
```
Loading