From 282fdb4f6a371f9f934075c5ab0b6f316e7f65b0 Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Mon, 25 Mar 2024 11:22:58 +0300 Subject: [PATCH 1/6] Start work on README --- LICENSE.txt | 7 ++ README.md | 321 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..ce3a742 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright (c) 2024 Nigel Nindo + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 1821690..3f0347e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,324 @@ + + + + + + + + +[![Contributors][contributors-shield]][contributors-url] +[![Forks][forks-shield]][forks-url] +[![Stargazers][stars-shield]][stars-url] +[![Issues][issues-shield]][issues-url] +[![MIT License][license-shield]][license-url] +[![LinkedIn][linkedin-shield]][linkedin-url] + + + + +
+
+ + Logo + + +

Best-README-Template

+ +

+ An awesome README template to jumpstart your projects! +
+ Explore the docs » +
+
+ View Demo + · + Report Bug + · + Request Feature +

+
+ + + + +
+ Table of Contents +
    +
  1. + About The Project + +
  2. +
  3. + Getting Started + +
  4. +
  5. Usage
  6. +
  7. Roadmap
  8. +
  9. Contributing
  10. +
  11. License
  12. +
  13. Contact
  14. +
  15. Acknowledgments
  16. +
+
+ + + + +## About The Project + +[![Product Name Screen Shot][product-screenshot]](https://example.com) + +There are many great README templates available on GitHub; however, I didn't find one that really suited my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need -- I think this is it. + +Here's why: +* Your time should be focused on creating something amazing. A project that solves a problem and helps others +* You shouldn't be doing the same tasks over and over like creating a README from scratch +* You should implement DRY principles to the rest of your life :smile: + +Of course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed to expanding this template! + +Use the `BLANK_README.md` to get started. + +

(back to top)

+ + + +### Built With + +This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples. + +* [![Next][Next.js]][Next-url] +* [![React][React.js]][React-url] +* [![Vue][Vue.js]][Vue-url] +* [![Angular][Angular.io]][Angular-url] +* [![Svelte][Svelte.dev]][Svelte-url] +* [![Laravel][Laravel.com]][Laravel-url] +* [![Bootstrap][Bootstrap.com]][Bootstrap-url] +* [![JQuery][JQuery.com]][JQuery-url] + +

(back to top)

+ + + + +## Getting Started + +This is an example of how you may give instructions on setting up your project locally. +To get a local copy up and running follow these simple example steps. + +### Prerequisites + +This is an example of how to list things you need to use the software and how to install them. +* npm + ```sh + npm install npm@latest -g + ``` + +### Installation + +_Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services._ + +1. Get a free API Key at [https://example.com](https://example.com) +2. Clone the repo + ```sh + git clone https://github.com/your_username_/Project-Name.git + ``` +3. Install NPM packages + ```sh + npm install + ``` +4. Enter your API in `config.js` + ```js + const API_KEY = 'ENTER YOUR API'; + ``` + +

(back to top)

+ + + + +## Usage + +Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources. + +_For more examples, please refer to the [Documentation](https://example.com)_ + +

(back to top)

+ + + + +## Roadmap + +### TODO +- [x] Remove long polling in creation of an order +- [x] Instead of repeating try/catch error handling for each service method, refactor the try catch to wrap all controller methods. TODO: Does this this also propagate to the service methods? This will be interesting to find out! +- [x] Add Zod for handling API validations +- [x] Use snake_case for all DB columns (Untested across the board, unit tests would have been nice right now :-)) +- [x] Add DB indexes +- [x] Improve logging with ts-log and create standard semantics for logs +- [x] For HTMX sections where we replace all content(hx-target="outerHTML"), would be a good practice to place these sections in constants sine they are referenced in multiple locations. Should we then choose to rename them, we'll then just need to change once reference (DRY) +- [x] Ensure once order item added to an order, it's price is immutable +- [x] Fix bug with updated at not correctly propagating on DB level (a workaround is currently being used). Was not working because updated_at on date functionality is only supported on Postgres for TypeORM. So the workaround is the solution. +- [x] Remove hardcoding of base url +- [x] Return BAD REQUEST on failed Zod validations +- [X] API tests +- [ ] HTMX input white listing (Maybe important to avoid XSS attacks) +- [ ] Timezone awareness +- [ ] Proper handling of amounts with decimals + +### Updcoming Features +- [x] Authentication (username & password) to prevent unauthorized access +- [x] Add staff details to an order to know who completed an order. Staff can log in with their dedicated credentials. +- [x] Restriction of sensitive sections of the service to admin users only i.e Inventory Section (which can change pricing of items) +- [ ] Ability to filter for payments according to date and time interval +- [ ] Pagination of data (currently fetching all rows from the DB, this isn't feasible for a real world project) +- [ ] Store when a user last logged in +- [ ] Manual reconciliation via CSV and/or Excel/Google Sheets +- [ ] IP Address white listing (help for example ensure the service can only be accessed when connected to the store's WiFi) + +### Would be nice +- [ ] End to end tests with Puppeteer +- [ ] MetaBase for more in depth BI analysis +- [ ] Automated daily backups of all transactions to CSV files (stored on S3 buckets) +- [ ] Allow for changes to a confirmed order +- [ ] Add partial and deferred payments, together with tracking of the same +- [ ] Maybe to be added, but also tracking of how many inventory items are coming in. This together with order tracking can automate knowing how many inventory items are left in stock +- [ ] Mobile App? + + +See the [open issues](https://github.com/othneildrew/Best-README-Template/issues) for a full list of proposed features (and known issues). + +

(back to top)

+ + + + +## Contributing + +Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. + +If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". +Don't forget to give the project a star! Thanks again! + +1. Fork the Project +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the Branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request + +

(back to top)

+ + + + +## License + +Distributed under the MIT License. See `LICENSE.txt` for more information. + +

(back to top)

+ + + + +## Contact + +Your Name - [@your_twitter](https://twitter.com/your_username) - email@example.com + +Project Link: [https://github.com/your_username/repo_name](https://github.com/your_username/repo_name) + +

(back to top)

+ + + + +## Acknowledgments + +Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off! + +* [Choose an Open Source License](https://choosealicense.com) +* [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet) +* [Malven's Flexbox Cheatsheet](https://flexbox.malven.co/) +* [Malven's Grid Cheatsheet](https://grid.malven.co/) +* [Img Shields](https://shields.io) +* [GitHub Pages](https://pages.github.com) +* [Font Awesome](https://fontawesome.com) +* [React Icons](https://react-icons.github.io/react-icons/search) + +

(back to top)

+ + + + + +[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge +[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors +[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge +[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members +[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge +[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers +[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge +[issues-url]: https://github.com/othneildrew/Best-README-Template/issues +[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge +[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt +[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 +[linkedin-url]: https://linkedin.com/in/othneildrew +[product-screenshot]: images/screenshot.png +[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white +[Next-url]: https://nextjs.org/ +[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB +[React-url]: https://reactjs.org/ +[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D +[Vue-url]: https://vuejs.org/ +[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white +[Angular-url]: https://angular.io/ +[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00 +[Svelte-url]: https://svelte.dev/ +[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white +[Laravel-url]: https://laravel.com +[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white +[Bootstrap-url]: https://getbootstrap.com +[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white +[JQuery-url]: https://jquery.com + + + + + + + + + + + +# Tafsiri + +Tafsiri in Swahili means to translate, or as more applicable in the context, understand. + + + + + + + + # Elysia with Bun runtime ## Getting Started From 2f3486ba80f7424bca2b7d6d66e5a53ae21e64d2 Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Mon, 25 Mar 2024 12:49:55 +0300 Subject: [PATCH 2/6] More changes to README --- README.md | 249 ++++++++++++++++-------------------------------------- 1 file changed, 71 insertions(+), 178 deletions(-) diff --git a/README.md b/README.md index 3f0347e..9219851 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,8 @@ - - - - - - - -[![Contributors][contributors-shield]][contributors-url] -[![Forks][forks-shield]][forks-url] + [![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] -[![LinkedIn][linkedin-shield]][linkedin-url] - @@ -85,16 +63,18 @@ [![Product Name Screen Shot][product-screenshot]](https://example.com) -There are many great README templates available on GitHub; however, I didn't find one that really suited my needs so I created this enhanced one. I want to create a README template so amazing that it'll be the last one you ever need -- I think this is it. -Here's why: -* Your time should be focused on creating something amazing. A project that solves a problem and helps others -* You shouldn't be doing the same tasks over and over like creating a README from scratch -* You should implement DRY principles to the rest of your life :smile: +Tafsiri in Swahili means to translate, or as more applicable in the context, understand. + +This project was born from some observations I made when visiting a friend's business establishment: +- Payments are recorded by hand in a ledger book. This is quite common in Kenya. This has some downsides that I saw: + - Sometimes it was difficult to know who made a payment recording. This is was being eye balled using on of the cashier's handwriting at times, and it just turned out two of the cashiers have similar handwriting, leading to confusion. + - + + +Tafsiri is a web based platform where small and medium sized businesses can keep track of their inventory, incoming payments and track credit extended to customers. -Of course, no one template will serve all projects since your needs may be different. So I'll be adding more in the near future. You may also suggest changes by forking this repo and creating a pull request or opening an issue. Thanks to all the people have contributed to expanding this template! -Use the `BLANK_README.md` to get started.

(back to top)

@@ -104,18 +84,11 @@ Use the `BLANK_README.md` to get started. This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples. -* [![Next][Next.js]][Next-url] -* [![React][React.js]][React-url] -* [![Vue][Vue.js]][Vue-url] -* [![Angular][Angular.io]][Angular-url] -* [![Svelte][Svelte.dev]][Svelte-url] -* [![Laravel][Laravel.com]][Laravel-url] -* [![Bootstrap][Bootstrap.com]][Bootstrap-url] -* [![JQuery][JQuery.com]][JQuery-url] - -

(back to top)

- - +* [![Bun][Bun]][Bun-url] +* [![Cheerio][Cheerio]][Cheerio-url] +* [![Docker][Docker]][Docker-url] +* [![ElysiaJS][ElysiaJS]][ElysiaJS-url] +* [![TypeORM][TypeORM]][TypeORM-url] ## Getting Started @@ -133,25 +106,46 @@ This is an example of how to list things you need to use the software and how to ### Installation -_Below is an example of how you can instruct your audience on installing and setting up your app. This template doesn't rely on any external dependencies or services._ - -1. Get a free API Key at [https://example.com](https://example.com) -2. Clone the repo - ```sh - git clone https://github.com/your_username_/Project-Name.git - ``` -3. Install NPM packages - ```sh - npm install - ``` -4. Enter your API in `config.js` - ```js - const API_KEY = 'ENTER YOUR API'; - ``` +Multiple ways to get started are supported. But they all start with cloning the repo: +```sh +git clone https://github.com/nigelnindodev/Tafsiri.git +``` -

(back to top)

+#### Local Installation +A local installation assumes you have a local PostgreSQL Server running, and are running Linux, MacOS or Windows Subsystem for Linux (WSL). +Install the latest version of Bun: +```sh +curl -fsSL https://bun.sh/install | bash +``` + +Install project dependencies +```sh +bun install --frozen-lockfile +``` + +Add a `.env` file with the following properties: +```sh +APPLICATION_PORT=3000 +BASE_URL="http://localhost:3000" +JWT_SECRET="some_jwt_secret" +POSTGRES_USER="your_local_postgres_user" +POSTGRES_PASSWORD="your_local_postgres_password" +POSTGRES_HOST="localhost" +POSTGRES_PORT="5432" +POSTGRES_DATABASE_NAME="your_local_postgres_database_name" +``` + +Run the project in development mode +```sh +bun run dev +``` +Open http://localhost:3000/ with your browser to see the result. + +#### Docker Installation + +TBA ## Usage @@ -204,7 +198,8 @@ _For more examples, please refer to the [Documentation](https://example.com)_ - [ ] Mobile App? -See the [open issues](https://github.com/othneildrew/Best-README-Template/issues) for a full list of proposed features (and known issues). +See the [open issues](https://github.com/nigelnindodev/Tafsiri/issues) for a full list of proposed features (and known issues). +See the [project roadmap](https://github.com/users/nigelnindodev/projects/4) for what's currently being worked on, and future work.

(back to top)

@@ -213,10 +208,7 @@ See the [open issues](https://github.com/othneildrew/Best-README-Template/issues ## Contributing -Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. - -If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". -Don't forget to give the project a star! Thanks again! +Contributions are much welcome! 1. Fork the Project 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) @@ -240,9 +232,9 @@ Distributed under the MIT License. See `LICENSE.txt` for more information. ## Contact -Your Name - [@your_twitter](https://twitter.com/your_username) - email@example.com +Your Name - [@nigelnindo](https://twitter.com/nigelnindo) - nigelnindodev@gmail.com -Project Link: [https://github.com/your_username/repo_name](https://github.com/your_username/repo_name) +Project Link: [https://github.com/nigelnindodev/Tafsiri](https://github.com/nigelnindodev/Tafsiri)

(back to top)

@@ -253,14 +245,7 @@ Project Link: [https://github.com/your_username/repo_name](https://github.com/yo Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off! -* [Choose an Open Source License](https://choosealicense.com) -* [GitHub Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet) -* [Malven's Flexbox Cheatsheet](https://flexbox.malven.co/) -* [Malven's Grid Cheatsheet](https://grid.malven.co/) -* [Img Shields](https://shields.io) -* [GitHub Pages](https://pages.github.com) -* [Font Awesome](https://fontawesome.com) -* [React Icons](https://react-icons.github.io/react-icons/search) +* [HTMX for Impatient Devs](https://www.youtube.com/watch?v=TT7SV-bAZyA)

(back to top)

@@ -268,112 +253,20 @@ Use this space to list resources you find helpful and would like to give credit -[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge -[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors -[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge -[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members [stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge -[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers +[stars-url]:https://github.com/nigelnindodev/Tafsiri/stargazers [issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge -[issues-url]: https://github.com/othneildrew/Best-README-Template/issues +[issues-url]:https://github.com/nigelnindodev/Tafsiri/issues [license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge -[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt -[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 -[linkedin-url]: https://linkedin.com/in/othneildrew +[license-url]:https://github.com/nigelnindodev/Tafsiri/blob/master/LICENSE.txt [product-screenshot]: images/screenshot.png -[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white -[Next-url]: https://nextjs.org/ -[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB -[React-url]: https://reactjs.org/ -[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D -[Vue-url]: https://vuejs.org/ -[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white -[Angular-url]: https://angular.io/ -[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge&logo=svelte&logoColor=FF3E00 -[Svelte-url]: https://svelte.dev/ -[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge&logo=laravel&logoColor=white -[Laravel-url]: https://laravel.com -[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white -[Bootstrap-url]: https://getbootstrap.com -[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white -[JQuery-url]: https://jquery.com - - - - - - - - - - - -# Tafsiri - -Tafsiri in Swahili means to translate, or as more applicable in the context, understand. - - - - - - - - -# Elysia with Bun runtime - -## Getting Started - -To get started with this template, simply paste this command into your terminal: - -```bash -bun create elysia ./elysia-example -``` - -## Development - -To start the development server run: - -```bash -bun run dev -``` - -Open http://localhost:3000/ with your browser to see the result. - -## TODO - -- [x] Remove long polling in creation of an order -- [x] Instead of repeating try/catch error handling for each service method, refactor the try catch to wrap all controller methods. TODO: Does this this also propagate to the service methods? This will be interesting to find out! -- [x] Add Zod for handling API validations -- [x] Use snake_case for all DB columns (Untested across the board, unit tests would have been nice right now :-)) -- [x] Add DB indexes -- [x] Improve logging with ts-log and create standard semantics for logs -- [x] For HTMX sections where we replace all content(hx-target="outerHTML"), would be a good practice to place these sections in constants sine they are referenced in multiple locations. Should we then choose to rename them, we'll then just need to change once reference (DRY) -- [x] Ensure once order item added to an order, it's price is immutable -- [x] Fix bug with updated at not correctly propagating on DB level (a workaround is currently being used). Was not working because updated_at on date functionality is only supported on Postgres for TypeORM. So the workaround is the solution. -- [x] Remove hardcoding of base url -- [x] Return BAD REQUEST on failed Zod validations -- [ ] API tests -- [ ] HTMX input white listing (Maybe important to avoid XSS attacks) -- [ ] Timezone awareness -- [ ] Proper handling of amounts with decimals - -## Upcoming features - -- [x] Authentication (username & password) to prevent unauthorized access -- [x] Add staff details to an order to know who completed an order. Staff can log in with their dedicated credentials. -- [x] Restriction of sensitive sections of the service to admin users only i.e Inventory Section (which can change pricing of items) -- [ ] Ability to filter for payments according to date and time interval -- [ ] Pagination of data (currently fetching all rows from the DB, this isn't feasible for a real world project) -- [ ] Store when a user last logged in -- [ ] Manual reconciliation via CSV and/or Excel/Google Sheets -- [ ] IP Address white listing (help for example ensure the service can only be accessed when connected to the store's WiFi) - -## Would be nice - -- [ ] End to end tests with Puppeteer -- [ ] MetaBase for more in depth BI analysis -- [ ] Automated daily backups of all transactions to CSV files (stored on S3 buckets) -- [ ] Allow for changes to a confirmed order -- [ ] Add partial and deferred payments, together with tracking of the same -- [ ] Maybe to be added, but also tracking of how many inventory items are coming in. This together with order tracking can automate knowing how many inventory items are left in stock -- [ ] Mobile App? +[Bun]: https://img.shields.io/badge/:badgeContent?style=for-the-badge&logo=bun&link=https%3A%2F%2Fbun.sh%2F +[Bun-url]: https://bun.sh +[Cheerio]: +[Cheerio-url]: +[Docker]: +[Docker-url]: +[ElysiaJS]: +[ElysiaJS-url]: +[TypeORM]: +[TypeORM-url]: From 3dc69dba55b297fa515c5f5f4b6f18517c129a4d Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Mon, 25 Mar 2024 13:10:25 +0300 Subject: [PATCH 3/6] Push latest changes --- README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9219851..0cfeb3d 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ This section should list any major frameworks/libraries used to bootstrap your p * [![Cheerio][Cheerio]][Cheerio-url] * [![Docker][Docker]][Docker-url] * [![ElysiaJS][ElysiaJS]][ElysiaJS-url] +* [![HTMX][HTMX]][HTMX-url] * [![TypeORM][TypeORM]][TypeORM-url] @@ -113,7 +114,7 @@ git clone https://github.com/nigelnindodev/Tafsiri.git #### Local Installation -A local installation assumes you have a local PostgreSQL Server running, and are running Linux, MacOS or Windows Subsystem for Linux (WSL). +A local installation assumes you have a local PostgreSQL Server running, docker installed, and are running Linux, MacOS or Windows Subsystem for Linux (WSL). Install the latest version of Bun: ```sh @@ -141,8 +142,17 @@ Run the project in development mode ```sh bun run dev ``` + Open http://localhost:3000/ with your browser to see the result. +##### Run Test +To run tests, use the command from `package.json`: +```sh +bun run setup-run-test +``` + +That will use the `compose.yaml` file to create a testing PostgreSQL server instance using docker, and ensure it's volume is correctly cleared up after running tests. + #### Docker Installation TBA @@ -243,8 +253,6 @@ Project Link: [https://github.com/nigelnindodev/Tafsiri](https://github.com/nige ## Acknowledgments -Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off! - * [HTMX for Impatient Devs](https://www.youtube.com/watch?v=TT7SV-bAZyA)

(back to top)

@@ -263,10 +271,12 @@ Use this space to list resources you find helpful and would like to give credit [Bun]: https://img.shields.io/badge/:badgeContent?style=for-the-badge&logo=bun&link=https%3A%2F%2Fbun.sh%2F [Bun-url]: https://bun.sh [Cheerio]: -[Cheerio-url]: +[Cheerio-url]: https://cheerio.js.org/ [Docker]: -[Docker-url]: +[Docker-url]: https://www.docker.com/ [ElysiaJS]: -[ElysiaJS-url]: +[ElysiaJS-url]: https://elysiajs.com/ +[HTMX]: +[HTMX-url]: https://htmx.org [TypeORM]: -[TypeORM-url]: +[TypeORM-url]: https://typeorm.io/ From a3174d4928232da888acb78701d8e702994d9c34 Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Tue, 26 Mar 2024 04:31:42 +0300 Subject: [PATCH 4/6] Fix showing build statuses --- README.md | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index fcc5d85..59123a7 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,30 @@ +
-[![Stargazers][stars-shield]][stars-url] [![Issues][issues-shield]][issues-url] [![MIT License][license-shield]][license-url] +
+ +
+ +[![Build][build-shield]][build-url] +[![Test][test-shield]][test-url] + +

- - Logo - - -

Best-README-Template

+

Tafsiri

- An awesome README template to jumpstart your projects! + Payments and inventory management web platform powered by HTMX.
- Explore the docs » + Swagger Documentation »

- View Demo + View Demo · Report Bug · @@ -66,15 +70,16 @@ Tafsiri in Swahili means to translate, or as more applicable in the context, understand. -This project was born from some observations I made when visiting a friend's business establishment: -- Payments are recorded by hand in a ledger book. This is quite common in Kenya. This has some downsides that I saw: - - Sometimes it was difficult to know who made a payment recording. This is was being eye balled using on of the cashier's handwriting at times, and it just turned out two of the cashiers have similar handwriting, leading to confusion. - - - +This project was born from some observations I made at a friend's business establishment: -Tafsiri is a web based platform where small and medium sized businesses can keep track of their inventory, incoming payments and track credit extended to customers. +- Payments are recorded manually in a ledger book. This is quite common in Kenya, though with has some downsides: + - Difficult to know who made a payment recording. This was being eye balled using the cashier's handwriting at times, it just turned out two of the cashiers have similar handwriting, leading to confusion. +- Impossible to know the day's running sales unless the ledger book is reviewed +- It takes a lot of time to calculate the total sales for an particular day/week/month, as all slaes have to painstakingly be gone through one by one + - This is also prone to human error +Tasfiri automates recording of sales and keeping track of inventory via a web based platform. Care has been taken to add a good UX and create a flow where there is as little input by cashiers as possible.

(back to top)

@@ -89,6 +94,7 @@ This section should list any major frameworks/libraries used to bootstrap your p * [![Docker][Docker]][Docker-url] * [![ElysiaJS][ElysiaJS]][ElysiaJS-url] * [![HTMX][HTMX]][HTMX-url] +* [![PicoCSS][PicoCSS]][PicoCSS-url] * [![TypeORM][TypeORM]][TypeORM-url] @@ -282,12 +288,14 @@ Project Link: [https://github.com/nigelnindodev/Tafsiri](https://github.com/nige -[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge -[stars-url]:https://github.com/nigelnindodev/Tafsiri/stargazers -[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge -[issues-url]:https://github.com/nigelnindodev/Tafsiri/issues -[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge -[license-url]:https://github.com/nigelnindodev/Tafsiri/blob/master/LICENSE.txt +[build-shield]: https://github.com/nigelnindodev/Tafsiri/actions/workflows/build.yml/badge.svg +[build-url]: https://github.com/nigelnindodev/Tafsiri/actions/workflows/build.yml +[test-shield]: https://github.com/nigelnindodev/Tafsiri/actions/workflows/test.yml/badge.svg +[test-url]: https://github.com/nigelnindodev/Tafsiri/actions/workflows/build.yml +[issues-shield]: https://img.shields.io/github/issues/nigelnindodev/Tafsiri.svg?style=for-the-badge +[issues-url]: https://github.com/nigelnindodev/Tafsiri/issues +[license-shield]: https://img.shields.io/github/license/nigelnindodev/Tafsiri.svg?style=for-the-badge +[license-url]: https://github.com/nigelnindodev/Tafsiri/blob/master/LICENSE.txt [product-screenshot]: images/screenshot.png [Bun]: https://img.shields.io/badge/:badgeContent?style=for-the-badge&logo=bun&link=https%3A%2F%2Fbun.sh%2F [Bun-url]: https://bun.sh @@ -298,5 +306,7 @@ Project Link: [https://github.com/nigelnindodev/Tafsiri](https://github.com/nige [ElysiaJS-url]: https://elysiajs.com/ [HTMX]: [HTMX-url]: https://htmx.org +[PicoCSS]: +[PicoCSS-url]: https://picocss.com/ [TypeORM]: [TypeORM-url]: https://typeorm.io/ From 17e6596b3c67c3a8ed839fe0da3e75b2960089c1 Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Tue, 26 Mar 2024 05:02:29 +0300 Subject: [PATCH 5/6] Some icons working --- README.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 59123a7..04f3022 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,11 @@

+
+ +*Initial load time to view demo and swagger documentation may take up to one minute due to cold booting.* +
@@ -297,16 +301,17 @@ Project Link: [https://github.com/nigelnindodev/Tafsiri](https://github.com/nige [license-shield]: https://img.shields.io/github/license/nigelnindodev/Tafsiri.svg?style=for-the-badge [license-url]: https://github.com/nigelnindodev/Tafsiri/blob/master/LICENSE.txt [product-screenshot]: images/screenshot.png -[Bun]: https://img.shields.io/badge/:badgeContent?style=for-the-badge&logo=bun&link=https%3A%2F%2Fbun.sh%2F +[Bun]: https://img.shields.io/badge/Bun-35495E?style=for-the-badge&logo=bun&logoColor=4FC08D [Bun-url]: https://bun.sh -[Cheerio]: -[Docker]: +[Cheerio]: https://img.shields.io/badge/Cheerio.js-35495E?style=for-the-badge&logo=cheerio&logoColor=4FC08D +[Cheerio-url]: https://cheerio.js.org/ +[Docker]: https://img.shields.io/badge/Docker-35495E?style=for-the-badge&logo=docker&logoColor=4FC08D [Docker-url]: https://www.docker.com/ -[ElysiaJS]: +[ElysiaJS]: https://img.shields.io/badge/ElysiaJS-35495E?style=for-the-badge&logo=htmx&logoColor=4FC08D [ElysiaJS-url]: https://elysiajs.com/ -[HTMX]: +[HTMX]: https://img.shields.io/badge/HTMX-35495E?style=for-the-badge&logo=htmx&logoColor=4FC08D [HTMX-url]: https://htmx.org -[PicoCSS]: +[PicoCSS]: https://img.shields.io/badge/PicoCSS-35495E?style=for-the-badge&logo=css3&logoColor=4FC08D [PicoCSS-url]: https://picocss.com/ -[TypeORM]: +[TypeORM]: https://img.shields.io/badge/TypeORM-35495E?style=for-the-badge&logo=htmx&logoColor=4FC08D [TypeORM-url]: https://typeorm.io/ From 07e09661eeaa6c3923e8c559b039228d74e2fbab Mon Sep 17 00:00:00 2001 From: Nigel Nindo Date: Tue, 26 Mar 2024 05:53:19 +0300 Subject: [PATCH 6/6] Formatting of the README looks good now --- README.md | 53 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 04f3022..77514ba 100644 --- a/README.md +++ b/README.md @@ -69,37 +69,50 @@ ## About The Project -[![Product Name Screen Shot][product-screenshot]](https://example.com) +### Inspiration +Tafsiri in Swahili means to translate, or as more applicable in this context, understand. -Tafsiri in Swahili means to translate, or as more applicable in the context, understand. +This tackles inefficiencies in manual payment recording observed at a friend's business: +- Lack of real time sales data for busy owners +- Difficulty attributing who made a payment recording and when this happened +- Time consuming manual reconciliation of daily/weekly/monthly payments, especially factoring in extended credit facilities -This project was born from some observations I made at a friend's business establishment: +Tasfiri automates recording of sales & inventory tracking via a web based platform, allowing cashiers to easily start, suspend and resume payment orders with inventory details readily available to them. -- Payments are recorded manually in a ledger book. This is quite common in Kenya, though with has some downsides: - - Difficult to know who made a payment recording. This was being eye balled using the cashier's handwriting at times, it just turned out two of the cashiers have similar handwriting, leading to confusion. -- Impossible to know the day's running sales unless the ledger book is reviewed -- It takes a lot of time to calculate the total sales for an particular day/week/month, as all slaes have to painstakingly be gone through one by one - - This is also prone to human error +Most of the work is open sourced under an MIT license, and will be using this as a basis to create a bespoke web platform for use in said business (majorly changing the look from Pico CSS to Tailwind CSS). +### Technical Details -Tasfiri automates recording of sales and keeping track of inventory via a web based platform. Care has been taken to add a good UX and create a flow where there is as little input by cashiers as possible. +This is a hands on learning project for working with HTMX on real world project. The code is a culmination of improvements/refactors made over time to work better with HTMX. -

(back to top)

+Typescript was chosen over Go/Rust because of the ease of working with JSX for templating. This means that there isn't any need to learn any templating language, which I think is a huge productivity boost. + +ElysisJS was chosen as the web framework as it is optimized for Bun and out performs Go and Rust frameworks in some benchmarks. Through usage, I've found it's still not as mature, but workable. + +TypeORM was used as the database connector (been using it for years), but I would personally recommend replacing TypeORM with [Drizzle](https://orm.drizzle.team/). +### Checking Out The Demo + +TBA + +

(back to top)

### Built With -This section should list any major frameworks/libraries used to bootstrap your project. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples. +
+ +[![Bun][Bun]][Bun-url] +[![Cheerio][Cheerio]][Cheerio-url] +[![Docker][Docker]][Docker-url] +[![ElysiaJS][ElysiaJS]][ElysiaJS-url] +[![HTMX][HTMX]][HTMX-url] +[![PicoCSS][PicoCSS]][PicoCSS-url] +[![TypeORM][TypeORM]][TypeORM-url] + +
-* [![Bun][Bun]][Bun-url] -* [![Cheerio][Cheerio]][Cheerio-url] -* [![Docker][Docker]][Docker-url] -* [![ElysiaJS][ElysiaJS]][ElysiaJS-url] -* [![HTMX][HTMX]][HTMX-url] -* [![PicoCSS][PicoCSS]][PicoCSS-url] -* [![TypeORM][TypeORM]][TypeORM-url] ## Getting Started @@ -307,11 +320,11 @@ Project Link: [https://github.com/nigelnindodev/Tafsiri](https://github.com/nige [Cheerio-url]: https://cheerio.js.org/ [Docker]: https://img.shields.io/badge/Docker-35495E?style=for-the-badge&logo=docker&logoColor=4FC08D [Docker-url]: https://www.docker.com/ -[ElysiaJS]: https://img.shields.io/badge/ElysiaJS-35495E?style=for-the-badge&logo=htmx&logoColor=4FC08D +[ElysiaJS]: https://img.shields.io/badge/ElysiaJS-35495E?style=for-the-badge [ElysiaJS-url]: https://elysiajs.com/ [HTMX]: https://img.shields.io/badge/HTMX-35495E?style=for-the-badge&logo=htmx&logoColor=4FC08D [HTMX-url]: https://htmx.org [PicoCSS]: https://img.shields.io/badge/PicoCSS-35495E?style=for-the-badge&logo=css3&logoColor=4FC08D [PicoCSS-url]: https://picocss.com/ -[TypeORM]: https://img.shields.io/badge/TypeORM-35495E?style=for-the-badge&logo=htmx&logoColor=4FC08D +[TypeORM]: https://img.shields.io/badge/TypeORM-35495E?style=for-the-badge [TypeORM-url]: https://typeorm.io/