bitip/docs/tech-stack.md

2.7 KiB

Tech stack

Source code:

  • backend:

  • frontend

    • React + Vite
      • Single web page that will automatically detect the IP from where it is accessed and will query it to get the location data.
      • The current IP will be displayed in a text field that can be changed later by the user.
      • The entire location data obtained from the api will be displayed in this page in a professional style.

Build:

  • Dockerfile => Docker image

Release:

  • Docker container

Extra features

  • BasePath support

    • This should be set at runtime as a configuration or a environment variable
  • Seq logging

    • Seq url and secrets also in config

Service description

  • Simple REST API built with Express + TypeScript in Node.js to serve in the network the geoip date based on the IP received in the input. Also, the API should have different methods for a single IP or for a list of IPs. The API structure can be inspired from the api in @maxmind/geoip2-node npm package.

  • To read the data from the GeoIp databases, the library @maxmind/geoip2-node will be used. To access the databases, there will be used a configurable directory path because the databases are downloaded and maintained by the geoipupdate official service.

  • This service will have a simple UI. A single page I think is enough. The page design can be inspired from the other GeoIp services online and will contain a textfield there at the first start will auto detect and write the client IP. This field will be editable and the user will have the possibility to write any other IP in it. With a debounce, the written IP will be queried via the API methods and the received data will be displayed in a professional way.

  • The location will be displayed on a simple and free map based on the API data.

  • For the infrastructure part, the application will share the same repository for both backend and frontend. Also, add for it a dockerfile that will build both frontend and backend in the same image. I want the application to be a single program accessible on a single port.

  • For the development environment, add packages that will help the developer to write the code as linters or prettier, put keep the structure simple because this service wil remain very lite.

  • In the end, this service will be built as a docker image and started in the same docker-compose with geoipupdate service and they will share the same docker volume for the databases.