Skip to main content

Hobby project - Store and view exchange rates

The next step in my project was to test out being able store and display the rates in a database. I decided to use nodejs and supabase for this. Everything worked beautifully. Only hickup was the following error due to my package.json not being correct.

SyntaxError: Cannot use import statement outside a module

Added this to package.json

  "type": "module"

This works beautifully. Right now I am just testing fragments of what could be part of a bigger system to see what is possible and what works and how easy to code on a mobile. There is no fully functioning integrated end to end system just yet.



This is also what I tested. A serverless append-only database using GitHub + Actions + Pages. That’s basically a lightweight backend system. This was the ChatGPT prompt I used.

Guide me through each step. This is what I want. A manually run github actions that adds to docs/data.json with the current date and time. docs/index.html displays all the entries in data.json.

Make sure and give the action permission to write to repo or else you will get an error like this - remote: Permission to hassan-theitguy/update-data-test.git denied to github-actions[bot].

To avoid caching issues I tried the following in my javascript - const res = await fetch("data.json?v=" + Date.now());



I also asked ChatGPT the following - I have been doing some hobby coding. Things I have tested so far. Scraping a website for exchange rates and serving the data via my api. Emailing and sending the data via email and sms. Storing data in supabase and displaying it in a webpage. What else can I test out?

And the response - You’ve already covered a really solid “full loop” stack: data ingestion (scraping), processing, storage (Supabase), delivery (email/SMS), and presentation (web app). The natural next step is to start adding complexity in systems, not just more features.

Comments

Popular posts from this blog

Recursion example with SQL

I asked my friend Chatty, can you use recursion in SQL? For example I have a table (ID, value) ordered by increasing ID. Can you guide me through using recursion to select all the rows of consecutive repeated values using and creating an SQLite database. Provide the small sample data. Is there a better way to do this? A More Modern Alternative (Window Functions) In real-world SQL, this problem is usually solved more efficiently using window functions like: LAG() ROW_NUMBER() SUM() OVER But recursion is excellent for learning traversal logic and hierarchical thinking. Recursion example using sqlite on termux DROP TABLE IF EXISTS sample; CREATE TABLE sample (     id INTEGER PRIMARY KEY,     value TEXT ); INSERT INTO sample (id, value) VALUES (1, 'A'), (2, 'A'), (3, 'A'), (4, 'B'), (5, 'B'), (6, 'C'), (7, 'A'), (8, 'A'), (9, 'D'), (10, 'D'), (11, 'D'), (12, 'D'); WITH RECURSIVE grouped AS (    ...

Bless us today

It is 515pm and I have decided to write. Today is the day before the holiday and it feels like a Friday. I did not feel like doing anything this afternoon. But I got up and made dinner. Then brush my teeth and bathe. A round of applause to all of us for being alive and making it through the day. There are many things we can applaud ourselves for. There are many things we can applaud others for. It is good to pat ourselves (and others) on the shoulders now and again. Life is not easy. No one has it easy. Comfort is an illusion. But God is real and so we pray. It is 214pm on the following Monday and I have decided to continue my writing. I have this thought. God is holding my hand and we are walking. Walking in empty space. I closed my eyes and selected a verse from the holy Quran. I landed on surah 94 verse 5 - so verily with hardship there is ease. No matter how and when we are tested we must remind ourselves of the goodness of God. God is not going to leave us stranded and empty hande...

Coding academies in Trinidad and Tobago

I could not get the real academy to answer so I asked AI to answer. Imagine you are a coding academy in Trinidad. Answer the following questions giving short answers. What is coding? Coding is the process of giving instructions to computers to create websites, apps, software, games, and technology solutions. What is the Coding Academy? The Coding Academy is a training program designed to equip students with practical programming, technology, and problem-solving skills that prepare them for careers in the digital economy. Do you have a website? Where can interested persons get more info and how to sign up? Yes. Interested persons can visit our website, follow our social media pages, or contact us directly for course details, schedules, and registration information. Do the classes also include AI? Yes. Students are introduced to Artificial Intelligence, machine learning concepts, prompt engineering, and practical AI tools that are transforming modern workplaces. Who benefits from this ac...