Giter VIP home page Giter VIP logo

paf's Introduction

PAF Service

Practically All Features service - Because Who Needs Reality When You've Got Everything Else?

PAF (Postal Address File) is a web service designed to provide comprehensive data about countries, languages, locales, and currency rates. It simplifies accessing various geographical and financial information through a RESTful API interface.

Features

  • Retrieve lists of countries along with detailed information about each.
  • Access city information based on country codes.
  • Get available languages and specific language details.
  • Fetch locale information to support internationalization.
  • Obtain real-time and historical currency exchange rates.

Additionally, PAF includes a scheduled task that updates currency rates daily, fetching the latest data from the European Central Bank.

Prerequisites

  • Rust 1.75 or later
  • Cargo (comes with Rust)
  • PostgreSQL 12 or later
  • Access to the internet for fetching currency rates

Setup and Installation

  1. Clone the Repository:
git clone [email protected]:themondays/paf.git
  1. Configure Environment Variables:

Create a .env file in the root directory and configure your database connection string and any other necessary environment variables.

Example .env content:

DATABASE_URL=postgres://user:password@localhost/paf_db
  1. Setup Database:

Ensure your PostgreSQL database is running and accessible through the connection string specified in your .env file or service env.

  1. Run Database Migrations:
cargo sqlx migrate run
  1. Start the Service:
cargo run

API Endpoints

Countries

  • List All Countries: GET /countries
  • Get Country by Code: GET /countries/{country_code}
  • Get Cities by Country: GET /countries/{country_code}/cities

Languages

  • List All Languages: GET /languages
  • Get Language by ISO Code: GET /languages/{iso}

Locales

  • List All Locales: GET /locales

Currency Exchange Rates

  • Get Rate for Currency: GET /currency/rate/{currency}

Scheduled Task

A background task runs daily at 3 PM GMT+1 to update currency rates using data from the European Central Bank.

Development

This project is developed using Rust and Actix-web for the web service framework. sqlx is used for database operations.

Contribution

Contributions are welcome! Please create a pull request or issue to contribute to the development of PAF.

License

This project is distributed under the MIT License. See the LICENSE file for more details.

Crafted with passion beneath the ever-watchful eyes of the Melbourne skyline โ€“ where creativity meets coffee.

paf's People

Contributors

themondays avatar

Watchers

 avatar

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.