{"id":19684019,"url":"https://github.com/bastidood/hatid","last_synced_at":"2025-05-06T22:22:25.420Z","repository":{"id":184138929,"uuid":"668532446","full_name":"BastiDood/hatid","owner":"BastiDood","description":"Helpdesk and Ticketing Dashboard","archived":false,"fork":false,"pushed_at":"2024-08-30T11:00:03.000Z","size":1272,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T03:32:10.827Z","etag":null,"topics":["docker","docker-compose","postgresql","skeleton-ui","svelte","sveltekit"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BastiDood.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-20T03:21:05.000Z","updated_at":"2024-08-30T11:00:07.000Z","dependencies_parsed_at":"2023-07-27T08:37:05.959Z","dependency_job_id":null,"html_url":"https://github.com/BastiDood/hatid","commit_stats":null,"previous_names":["bastidood/hatid"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastiDood%2Fhatid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastiDood%2Fhatid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastiDood%2Fhatid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BastiDood%2Fhatid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BastiDood","download_url":"https://codeload.github.com/BastiDood/hatid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252777365,"owners_count":21802590,"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","postgresql","skeleton-ui","svelte","sveltekit"],"created_at":"2024-11-11T18:16:29.073Z","updated_at":"2025-05-06T22:22:25.392Z","avatar_url":"https://github.com/BastiDood.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HATiD\n\n\u003cp align=\"center\"\u003e\u003cimg alt=\"HATiD Logo\" src=\"src/lib/assets/logo-type.svg\" width=\"50%\" /\u003e\u003c/p\u003e\n\n**HATiD** is a **H**elpdesk **A**nd **Ti**cketing **D**ashboard written in [TypeScript] and [Svelte]. It is a full-stack web application on top of the [SvelteKit] framework. In the back end, it uses PostgreSQL as the database.\n\n[TypeScript]: https://www.typescriptlang.org/\n[Svelte]: https://svelte.dev/\n[SvelteKit]: https://kit.svelte.dev/\n[PostgreSQL]: https://www.postgresql.org/\n\n\u003e \"Hatid\" [hɐˈtid] is a Filipino word which means \"to deliver\".\n\n# Development\n\n## Initialize the Database Folder\n\n```bash\n# Creates the `data/` folder in which PostgreSQL stores all rows.\npnpm db:init\n\n# Starts Postgres in the terminal's foreground. We may want\n# to open a new terminal session elsewhere after this point.\npnpm db:start\n```\n\n```bash\n# Initialize the template/blueprint database. This allows us to\n# create and tear down multiple instantiations of the template.\npnpm db:schema\n\n# Also create the functions for the template database. This can be\n# rerun # as many times as needed without reinitializing the `data`\n# folder. Note that existing databases must be reinstantiated (i.e.,\n# drop then create again).\npnpm db:func\n\n# Instantiate a single instance of the template named `hatid`.\n# Of course, we may change this into any name we want.\npnpm db:create hatid\n\n# OPTIONAL: Tear down the `hatid` instance whenever we want.\npnpm db:drop hatid\n\n# OPTIONAL: Open a dedicated PostgreSQL shell into the `hatid` instance (usually for debugging purposes).\npnpm db:shell hatid\n```\n\nWe should now have a properly initialized PostgreSQL database running in the foreground in some terminal session. We may, of course, opt to run PostgreSQL as a background service, but that is beyond the scope of this `README`.\n\n## Running the SvelteKit Application\n\n```bash\n# Install the dependencies.\npnpm install\n```\n\n### Environment Variables\n\nThe following environment variables are typically added to a `.env` file. Although SvelteKit allows us to embed environment variables at compile-time, we instead opt to always dynamically load the variables at runtime. This is mainly for security reasons so that credentials cannot be leaked should a Docker image be pushed to a public registry.\n\n| **Name**         | **Description**                                             | **Required** |                      **Default** |\n| ---------------- | ----------------------------------------------------------- | :----------: | -------------------------------: |\n| `HOST`           | Hostname on which the server will be hosted.                |   \u0026#x274c;   |                        `0.0.0.0` |\n| `PORT`           | Port on which the server will be hosted.                    |   \u0026#x274c;   |                           `3000` |\n| `GOOGLE_ID`      | Client ID obtained from the [Google Cloud Console].         |   \u0026#x2714;   |                                  |\n| `GOOGLE_SECRET`  | Client secret obtained from the [Google Cloud Console].     |   \u0026#x2714;   |                                  |\n| `OAUTH_REDIRECT` | OAuth 2.0 redirect URI set from the [Google Cloud Console]. |   \u0026#x274c;   | `http://127.0.0.1/auth/callback` |\n| `PGHOST`         | IP host name of the [PostgreSQL] instance.                  |   \u0026#x274c;   |                      `127.0.0.1` |\n| `PGPORT`         | Port number of the [PostgreSQL] instance.                   |   \u0026#x274c;   |                           `5432` |\n| `PGUSER`         | Provided username when logging into [PostgreSQL].           |   \u0026#x274c;   |                       `postgres` |\n| `PGPASSWORD`     | Provided password when logging into [PostgreSQL].           |   \u0026#x2714;   |                                  |\n| `PGDATABASE`     | Default database in the [PostgreSQL] instance.              |   \u0026#x274c;   |                          `hatid` |\n\nNote that [`@sveltejs/adapter-node`] also respects additional environment variables.\n\n[PostgreSQL]: https://www.postgresql.org/\n[Google Cloud Console]: https://console.cloud.google.com/\n[`@sveltejs/adapter-node`]: https://kit.svelte.dev/docs/adapter-node\n\n### Development Server\n\nIn another terminal session, we may run the development server (i.e., without optimizations) as follows:\n\n```bash\n# Start the development server with live reloading + hot module replacement.\npnpm dev\n```\n\n### Production Preview Server\n\nIn another terminal session, we may run the production preview server (i.e., with optimizations) as follows:\n\n```bash\n# Compile the production build (i.e., with optimizations).\npnpm build\n\n# Start the production preview server.\npnpm preview\n```\n\n# Production Deployment with Docker Compose\n\nThe [`postgres`][docker-postgres] image inspects the following environment variables for first-time builds. Observe that some variables in the documentation have been omitted for brevity. Also note that this project's [`docker-compose.yml`] configures these variables via a `.env.postgres` file.\n\n[docker-postgres]: https://github.com/docker-library/docs/blob/9f75f251347c82b06483d47b14bcca79ad077fcd/postgres/README.md#environment-variables\n[`docker-compose.yml`]: ./docker-compose.yml\n\n| **Name**            | **Description**                                                                   | **Required** | **Default** |\n| ------------------- | --------------------------------------------------------------------------------- | :----------: | ----------: |\n| `POSTGRES_USER`     | Sets the superuser name.                                                          |   \u0026#x274c;   |  `postgres` |\n| `POSTGRES_PASSWORD` | Sets the superuser password.                                                      |   \u0026#x2714;   |             |\n| `POSTGRES_DB`       | Sets the name for the default database. Defaults to the value of `POSTGRES_USER`. |   \u0026#x274c;   |  `postgres` |\n\nOnce the `.env` and `.env.postgres` files are ready, we may now run Docker Compose.\n\n```bash\n# Run the PostgreSQL and Node.js server in the background.\ndocker compose up -d\n\n# OPTIONAL: Tear down the containers.\ndocker compose down\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastidood%2Fhatid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbastidood%2Fhatid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastidood%2Fhatid/lists"}