{"id":20622298,"url":"https://github.com/guligon90/packiot-fsc","last_synced_at":"2026-04-09T08:05:04.718Z","repository":{"id":47464765,"uuid":"398408261","full_name":"guligon90/packiot-fsc","owner":"guligon90","description":"Technical assessment for the position of full-stack software developer at PackIOT","archived":false,"fork":false,"pushed_at":"2021-08-30T20:23:25.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T01:39:17.092Z","etag":null,"topics":["docker","docker-compose","pgadmin4","postgresql","prospector","python3","sql","sqlfluff"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guligon90.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-20T21:53:11.000Z","updated_at":"2021-08-30T20:23:31.000Z","dependencies_parsed_at":"2022-08-24T13:20:44.048Z","dependency_job_id":null,"html_url":"https://github.com/guligon90/packiot-fsc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guligon90%2Fpackiot-fsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guligon90%2Fpackiot-fsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guligon90%2Fpackiot-fsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guligon90%2Fpackiot-fsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guligon90","download_url":"https://codeload.github.com/guligon90/packiot-fsc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242300212,"owners_count":20105166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","pgadmin4","postgresql","prospector","python3","sql","sqlfluff"],"created_at":"2024-11-16T12:22:01.871Z","updated_at":"2025-12-06T08:02:23.203Z","avatar_url":"https://github.com/guligon90.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PackIOT FSC :: Challenge #1\n\nTechnical assessment for the position of full-stack software developer at [PackIOT](https://packiot.com/).\n\n\n\u003c!-- TOC --\u003e\n## 0. Table of contents\n\n- [1. Preliminaries](#1-preliminaries)\n    - [1.1. Installing pip and virtualenv](#11-installing-pip-and-virtualenv)\n    - [1.2. Virtual environment](#12-virtual-environment)\n- [2. Building and running](#2-building-and-running)\n    - [2.1. PostgreSQL server](#21-postgresql-server)\n        - [2.1.1 For building](#211-for-building)\n        - [2.1.2 For running](#212-for-running)\n    - [2.2. pgAdmin 4](#22-pgadmin-4)\n- [3. Where to now?](#3-where-to-now)\n\u003c!-- /TOC --\u003e\n\n## 1. Preliminaries\n\nIn order to build the project, you must have already installed and configured in your workspace:\n\n\n* [Docker](https://docs.docker.com/engine/install/ubuntu/)\n* [Docker Compose](https://docs.docker.com/compose/install/)\n* [Python (3.8)](https://www.python.org/downloads/release/python-3810/)\n* [pip](https://pip.pypa.io/en/stable/installation/)\n* [virtualenv](https://virtualenv.pypa.io/en/latest/) (or any other suitable virtual environment manager for Python)\n\n### 1.1. Installing pip and virtualenv\n\nWith the correct Python distribution, at the terminal, execute the following commands:\n```bash\n$ sudo apt install python3-pip python3-virtualenv\n```\n### 1.2. Virtual environment\n\nAfter you cloned this project, you must install its Python dependencies. So, at the project's root, execute in the terminal:\n```bash\n$ virtualenv --python=python3 venv                  # Creates the virtual env\n$ source venv/bin/activate                          # Make it active inside the project\n$ pip install --upgrade pip --no-cache-dir          # Upgrade the package manager\n$ pip install -r requirements.txt --no-cache-dir    # Install dependencies listed in the .txt file\n```\n\n## 2. Building and running\n\nTo construct the containers which encapsulate the [PostgreSQL](https://www.postgresql.org/) database server and the \n[pgAdmin 4](https://www.pgadmin.org/download/) web application, a suite of scripts was implemented in Python, in order\nto automate the users' interaction with the Docker and Compose actions. The documentation about these scripts can be found [here](./scripts/README.md).\n\nThe aforementioned containers and its associated images are built with Docker Compose, where the corresponding services are all declared\nin the [YAML file](./docker-compose.yaml), at the project's root. These services are:\n\n* `pgsqlserver`: Runs the container that encapsulates a proper PostgreSQL server. The image for this container (`Dockerfile`) was implemented locally, for reasons of database automation;\n* `pgadmin`: The web interface that consumes the PostgreSQL database, and for that it can not run without the previous service been built. It uses an officially distributed image, downloaded from [Docker Hub](https://hub.docker.com/r/dpage/pgadmin4/).\n\n### 2.1. PostgreSQL server\n\nWe use here the automation script to perform building and runnning. At the project's root, execute in the terminal:\n#### 2.1.1. For building: \n```bash\n$ ./scripts/devenv.py build pgsqlserver \n\n```\n#### 2.1.2. For running: \n```bash\n$ ./scripts/devenv.py startwlogs pgsqlserver # Starts the container in detached mode and shows the logs\n```\n\n**Note**: The database for this challenge (`packiotfscdb`) is created when the container is started (you can see in the logs). More information on how to interact with it can be found [here](./database/README.md#1-introduction).\n\n### 2.2. pgAdmin 4\n\nSimilarly, we use the automation script to build and run this service, with the difference that the building part is not done separatedly, because the image for this container is obtained externally, i.e., there is no `Dockerfile`. So, you just need to run in the terminal:\n```bash\n$ ./scripts/devenv.py startwlogs pgadmin\n```\n\nWith the container up and running, you can now access the pgAdmin's UI via [browser](http://localhost:15432). The credentials for signing in are defined in the container's [.env file](./database/pgadmin/docker/.pgadmin.env).\n\nTo access the database and its respective schema, you'll have to add a server and set up the connection to it. To do that, you can check out the official pgAdmin 4 [documentation](https://www.pgadmin.org/docs/pgadmin4/latest/connecting.html). It's pretty straightforward. The necessary database credentials are defined in the `pgsqlserver` container's [.env file](./database/postgresql/docker/.pgsql.env).\n\n**Note**: When specifying the hostname in the connection dialog, you must enter the name of the service listed in the Docker Compose YAML file, i.e., (`pgsqlserver`).\n\n## 3. Where to now?\n\n* [Database](./database/README.md) \n* [Scripts](./scripts/README.md) \n* [Table of contents](#0-table-of-contents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguligon90%2Fpackiot-fsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguligon90%2Fpackiot-fsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguligon90%2Fpackiot-fsc/lists"}