GithubHelp home page GithubHelp logo

nigelnindodev / tafsiri Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 553 KB

Web platform for payments and inventory management powered by Typescript and HTMX.

Home Page: https://bunhtmxfullstack.onrender.com

License: MIT License

TypeScript 97.76% CSS 0.50% JavaScript 1.45% Dockerfile 0.29%
bun bun-test cheeriojs docker docker-compose elysiajs htmx typescript

tafsiri's Introduction

Hello There!

  • Currently working with Typescript(both Node & Bun runtime), Python & Go.

  • Spent majority of my time most writing Scala, and learning Rust in my spare time.

  • I specialize in architecture and coding of asynchronous distributed systems, but talk to me about anything tech. Currently also working on full stack development with HTMX.

  • Find my pre-2022 work here (2FA locked profile)

tafsiri's People

Contributors

nigelnindodev avatar

Stargazers

 avatar

Watchers

 avatar

tafsiri's Issues

Investigate: Change Elysia Status Code For Successful Requests

Seems something trivial to change in Elysia isn't working. Setting status code using ctx.set.status = [code] isn't working.

Discovered while attempting to change the successful POST status code from 200 to 201.

Error status code changes work though.

This issue will track investigation, and PR will be closed once we return correct status code (201) fro created items.

Add Pagination

Currently, we load all the data from the backend for payments and order history. This isn't feasible in a real-world application due to causing performance issues on the DB, network bandwidth ie.

This issue will track adding pagination functionality.

Acceptance Criteria:

  • Add limit/offset db queries for all API endpoints requiring pagination
  • Add UI components to manage the pagination state

Create Standardized Logging

Acceptance Criteria:

  • Remove all calls to console.log
  • Create structure for all application log levels

Logging transports will be handled as a separate issue #5

Refactor Swagger Documentation & Request Body Validation Outside Of Routes Index Files

While the additions in #32 are great, the routes files are quite large now, containing a lot of Swagger and request validation data.

The routes files should be made much smaller than they are by adding two new files on top of the index.ts routes we currently have, validations.ts and swagger.ts.

The validation and swagger objects already exist in index.ts, so it's minor code refactor.

This will however have a large impact:

  • Much easier to follow API routing without getting distracted by the metadata
  • We can easily expand metadata information much more than we currently do, especially the Swagger documentation. it will be in it's own module, so there won't be any issues with creating any bloat on the routes file.

Ensure this is done only after addition of unit tests #16

Add User Control Functionality

Admin accounts should be able to:

  • View all users
  • Deactivate non-admin accounts

This ticket encompasses the UI and backend implementation for this.

Standardize Linting

NeoVim's default postgres linter is quite buggy. Fix the project after updating Typescript linting.

Fix Vercel Code Deploy

Placeholder ticket to get the app running on Vercel.

Know issues:

  • Vercel returning 404 not found
  • Need to provision a remote Postgres database (both for live and testing environments)
  • Need to add application secrets to env vars

Purge Tailwind CSS

For this project, we're aiming to highlight HTMX integration on the front and back end.

Configuring tailwind would be a win, but will add more complexity to understanding the essence of the desired outcome, rendering dynamic HTML on the front end without a conventional JavaScript framework doing the heavy lifting.

Pico CSS already has decent styling for the UI, no need to complicate things further in this regard.

This ticket tracks progress to purge any tailwind-related JS, CSS, and configurations.

Sanitize API Input

This ticket is to check for any potential security vulnerabilities the API may be exposed to with regard to the use of HTMX.

Will be majorly looking at sanitizing API data from clients, if any current vulnerabilities.

Conduct Logging Audit

Instead of adding transport #5, more importantly, we need to perform a logging audit.

After this audit:

  • There should be a set format for all application logs (on top of the default tslog formating)
  • Any necessary logs should be purged
  • All logs should have the appropriate log levels
  • Confirm secret data is being written to the logs

To be done after the addition of unit tests #16 as it will be easier to view logs generated for different edge cases automatically.

Add Authentication Verification For All Routes

Currently, once logged in, a user has access to the application even if the 3-minute logged-in session has not expired.

A/C

  • Once the session is expired, a user is redirected back to the login page.

Add Swagger Documentation

We have swagger enabled, but no metadata describing request body and descriptions of what the API endpoints do.

This should be added to the wagger documentation as well to make it easier to understand the API specification.

Remove Hardcoded Dynamic Values In Code Base

In the spirit of moving this project from only working locally, hardcoded values that should be dynamic should be moved to env vars.

This list currently has:

  • Base URL of the application
  • Application Port
  • JWT Secret

Add User Details To Completed Payments

Since user's data is now available, the application should also record who completed a payment. This ticket also includes listing of who completed the payments in the payment details list.

Add Unit Tests

Ticket to track the addition of unit tests. Bun has a builtin test runner that will be used for this.

Acceptance Criteria:

  • Add unit tests with least 70% test coverage to start
  • Configure Github Actions to run unit tests on every PR

Better Styling For View User Profile Page

Viewing users is functional, although the pages styling wasn't well thought out at the time due to an emphasis on completing functionality.

Let's make the view user page look much nicer.

Update Project README

This ticket is to track the updating of the README of the project.

  • Add details and motivation for working on the project
  • Add local install instructions
  • Add project structure definitions
  • Add testing instructions
  • Add Deployment Instructions

Elegantly Handle Failed Zod Validations

Currently, Zod validations are failing because query params and bodies that expect numbers to be sent are numbers wrapped as strings, so Zod numbers validation is failing.

Would also be great if we can handle this at the top level so that we don't have to repeat the logic in every route.

Setup Test Database

Before starting on unit tests, we need to also set up the testing database where we'll create fixtures.

A hard requirement is to use PostgreSQL for this database, as we have some columns defined in TypeORM that are only supported by Postgres.

Leaving implementation open, but it also goes without saying that setup and teardown of test cases should be fully automated.

Bad Request For Failed Zod Validations

We fixed the runtime and compile time parsing of query params and request bodies in #10

However, theoretically, we're still not returning BAD REQUEST status codes for failed Zod validations, we'll get an internal server error, and the response will be JSON with the Zod validation errors.

This should be changed to a bad request and instead of JSON, an info-wrapped HTML component may be injected into the document markup.

Stays in the backlog for now as not a blocker for next release phase.

Maintain User Session While Active

Currently, the user will be logged out after 3 minutes, then they have to log in again.

It would be ideal to keep the user session alive and log them out only after say 10 mins of inactivity.

Add Logging Transports

Not yet decided on the best live transports, we may not add anything on top of outputting to stdout & stderr.

Ticketing so that it isn't forgotten.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.