Skip to content

Adam014/Econiqq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Econiqq

Ecnoniqq is your personal passport to the planet's price tags. It's not just a web app; it's a whisperer for your wallet. Real-time data, tailor-made recommendations, and a community of kindred travelers make Econiqq your go-to guide for worldly adventures without the financial fuss.

Badges

MIT License

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying app/page.js. The page auto-updates as you edit the file.

Run Locally

Clone the project

  git clone https://github.com/Adam014/Econiqq.git

Go to the project directory

  cd Econiqq

Install dependencies

  npm install

Start the server

  npm run dev

Color Reference

Color Hex
Background_color #00000 #000000
Button_color #F13E51 #F13E51
Hover_color #E08C9C #E08C9C

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

NEXT_PUBLIC_RAPIDAPID_KEY = your_RAPIDAPI_key

NEXT_PUBLIC_SUPABASE_ANON_KEY = your_SUPABASE_key

NEXT_PUBLIC_SUPABASE_APP_URL = your_SUPABASE_url

API Reference

Get the Cost to Live of the capital city

  GET /map/${country}/${capital}

Summary

The fetchData function is responsible for fetching data from the Supabase database. It first checks if the data exists in Supabase by querying the CountryAndCapitalCollection table. If the data is found, it is returned. If the data is not found, the function calls the fetchCostOfLiving function to fetch the data from an external API. The fetched data is then saved to Supabase and returned.

Example Usage

const data = await fetchData('USA', 'Washington');
console.log(data);
// Output: The fetched data from Supabase or the external API

Code Analysis

Inputs

  • decodedCountry (string): The decoded country name.
  • decodedCapital (string): The decoded capital name.

Flow

  1. The function queries the CountryAndCapitalCollection table in Supabase to check if the data exists for the given country and capital.
  2. If the data is found, it is returned.
  3. If the data is not found, the function calls the fetchCostOfLiving function to fetch the data from an external API.
  4. The fetched data is then saved to Supabase using the upsert method.
  5. If the data is successfully saved, it is returned.
  6. If any errors occur during the process, appropriate error messages are thrown.

Outputs

  • The fetched data from Supabase or the external API.

It also works, when u type:

Get the Cost to Live of the city you enter

  GET /map/${country}/${another_city_you_can_think_of}

Authors

Tech Stack

Client: Next.js (both Typescript and Javascript for the map), TailwindCSS, Jest

Database: Supabase

🔗 Links

linkedin twitter

Contributing

Contributions are always welcome!

Support

For support, email adam.stadnik@seznam.cz or contact me via the web!

Feedback

If you have any feedback, please reach out to me at adam.stadnik@seznam.cz