Skip to content

A Simple personnal Discord bot to manage my groceries expenses every month ! Also an excuse to try out a light and quick project with bun !

License

Notifications You must be signed in to change notification settings

Eric-Philippe/Groceries-Cards-Managemet

Repository files navigation

Logo

Groceries Cards Management Bot

This bot is a simple discord bot in order to easily manage my groceries budget for each month. With this bot, I can easily setup an amount for my credit card and lunch card, and then follow what I've spent on each card, with a complete history of each month.

Tech' Context

This project was also meant to discover Bun. Bun fits perfectly for this project, as a quick, simple bot, enjoying the built-in TypeScript support and also the dotenv one and even more, the sqlite3 support.

SQLite that I've never used before, but also perfect for a light and simple project like this one.

Table of Contents

How to use it

Technologies

Name Version
Bun 1.0.2
TypeScript 5.2.2
SQLite 3.43.1

Setup

  1. Install Bun globally
# For Mac, Linux, WSL
curl -fsSL https://bun.sh/install | bash

# For Windows
# Still under development
  1. Clone the repository
git clone https://github.com/Eric-Philippe/Groceries-Cards-Managemet.git
  1. Install dependencies
bun i
  1. Create a .env file at the root of the project and fill it with the following variables following the .env.example file
nano .env
| DISCORD_TOKEN=<YOUR_TOKEN>
| CLIENT_ID=<YOUR_CLIENT_ID>
| GUILD_ID=<YOUR_GUILD_ID>
  1. Run the bot
bun start
# or
bun start & # to run it in background

Database

As previously stated, this bot uses SQLite. I've left the artefact file mydb.sqlite with all the tables and cards created in the repository, but you can delete it and run the bot, it will create a new one. The schema file is in the src/database/create_tables.ts file. In order to launch it, just do as follow:

bun run src/database/create_tables.ts

> Table cards created successfully
> Table history created successfully
> Default values inserted successfully

About

A Simple personnal Discord bot to manage my groceries expenses every month ! Also an excuse to try out a light and quick project with bun !

Topics

Resources

License

Stars

Watchers

Forks

  NODES
COMMUNITY 1
Project 10
todo 2
USERS 1