{"id":18326028,"url":"https://github.com/mthaler/bookings","last_synced_at":"2026-05-08T17:39:48.198Z","repository":{"id":146920081,"uuid":"353598080","full_name":"mthaler/bookings","owner":"mthaler","description":"Bookings web app from Udemys Building Modern Web Applications with Go course","archived":false,"fork":false,"pushed_at":"2021-05-22T16:28:33.000Z","size":10441,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T15:57:43.020Z","etag":null,"topics":["golang","pgx","postgres","postgresql","udemy","udemy-course","udemy-course-project","web-app","web-application"],"latest_commit_sha":null,"homepage":"","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mthaler.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-01T06:29:07.000Z","updated_at":"2021-05-22T16:29:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"75f38348-ed06-4e45-85fb-067b0983cb0e","html_url":"https://github.com/mthaler/bookings","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mthaler/bookings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthaler%2Fbookings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthaler%2Fbookings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthaler%2Fbookings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthaler%2Fbookings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mthaler","download_url":"https://codeload.github.com/mthaler/bookings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mthaler%2Fbookings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32791105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","pgx","postgres","postgresql","udemy","udemy-course","udemy-course-project","web-app","web-application"],"created_at":"2024-11-05T19:05:31.558Z","updated_at":"2026-05-08T17:39:48.177Z","avatar_url":"https://github.com/mthaler.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bookings and Reservations\n\nThe bookings web application from the [Building Modern Web Applications with Go](https://www.udemy.com/course/building-modern-web-applications-with-go/?referralCode=0415FB906223F10C6800) course on Udemy.\n\nThe web application provides basic functionality to make reservations and manage reservations. It uses Postgres to store reservations.\n\nHome page:\n\n![Home page](screenshots/home.jpg)\n\nOne of the two available accommodations:\n\n![General's quarter](screenshots/generals_quarter.jpg)\n\nMake reservation:\n\n![Make reservation](screenshots/make_reservation.jpg)\n\nAn administrator dashboard is available to display all reservations:\n\n![All reservations](screenshots/all_reservations.jpg)\n\nReservation calendar:\n\n![Reservation calendar](screenshots/reservation_calendar.jpg)\n\n## Install PostgreSQL\n\nOn Debian Linux, PostgreSQL can be installed with the following command:\n\n```bash\n# apt-get install postgresql postgresql-doc\n```\n\nBoth the default database user and default database are called postgres\n\n### Create a user and database for the system user\n\nBy default, Postgres uses a concept called “roles” to handle authentication and authorization.\nAfter installation Postgres is set up to use ident authentication, meaning that it associates Postgres roles with a matching Unix/Linux system account.\n\nUse su to swith to the postgres acount and create a user with the same name as the system user:\n\n```\n$ su -\n# su -s /bin/bash postgres\npostgres@debian:/root$ createuser -s username\n```\nThe -s option grants superuser privileges.\n\nNext we need to create a database for the user:\n\n```bash\npostgres@debian:/root$ createdb -O username username\n```\n\nNow try to start psql as a normal user:\n\n```bash\n$ psql\nusername=# \\q\n```\n\n### Create bookings user and database\n\nAfter setting up a user for the local system user, we no longer need to switch to the postgres account to run postgres commands.\nAdd an bookings postgres user:\n\n```bash\n$ createuser -P bookings\n```\n\nThis creates an istagram user that is not allowed to create new databases or roles and is not superuser. The -P flag will display a password prompt to set a password for the user.\n\nTo create the bookings database, run the follwing command:\n\n```bash\n$ createdb -O bookings bookings \n```\n### Install PGAdmin\n\n[pgAdmin](https://www.pgadmin.org/) is a popular feature-rich open source database administration tool for PostgreSQL. \nFollow the instructions on the web site to install it.\n\nOn Debian Linux, pgAdmin is installed in `/usr/pgadnmin4`. Start pgAdmin and create a new Server by right-clicking on Servers and selecting Create -\u003e Server...\nThe name should be localhost, switch to the connection tab and enter the required information:\n\n![Database Connection](screenshots/connection.jpg)\n\n## Install Soda\n\n[Soda](https://gobuffalo.io/en/docs/db/getting-started/) (which is also called Pop) can be used to run SQL migrations.\n\nTo install Soda, run the following command:\n\n```bash\n$ go get github.com/gobuffalo/pop/...\n```\n\nRun soda from the Goland terminal:\n\n```bash\n$ soda -v\nv5.3.1\n```\nIf the output is `soda: command not found`, at it to `PATH`.\n\n### Configure Soda\n\nCopy the `database.yml.example` to `database.yml` and fill out username and password.\n\n### Create users table\n\nRun the following command to create a migrations file:\n\n```bash\n$ soda generate fizz CreateUserTable\nv5.3.1\n\nDEBU[2021-05-10T11:07:23+02:00] Step: 9bf35aef\nDEBU[2021-05-10T11:07:23+02:00] Chdir: /home/johndoe/go/src/bookings\nDEBU[2021-05-10T11:07:23+02:00] File: /home/johndoe/go/src/bookings/migrations/20210510090723_create_user_table.up.fizz\nDEBU[2021-05-10T11:07:23+02:00] File: /home/johndoe/go/src/bookings/migrations/20210510090723_create_user_table.down.fizz\n```\n\nRun the migration using the following command:\n\n```bash\n$ soda migrate\n```\n\npgAdmin should now show the users table:\n\n![users table](screenshots/users_table.jpg)\n\n## PGX\n\n[pgx](https://github.com/jackc/pgx) is a pure Go driver and toolkit for PostgreSQL.\n\n### Installation\n\n```bash\n$ go get github.com/jackc/pgx/v4\n```\n\n## Mail\n[Go Simple Mail](https://github.com/xhit/go-simple-mail) is a Golang package to send email. It support keep alive connection, TLS and SSL.\n\n### Installation\n\n```bash\n$ go get github.com/xhit/go-simple-mail/v2\n```\n\n## MailHog\n\nMailHog is an email testing tool for developers\n\n### Installation\n\nFrom a terminal run:\n\n```bash\n$ go get github.com/mailhog/MailHog\n```\n\n## Admin template\n\n\n\nStart MailHog by running\n\n```bash\n$ ~/go/bin/MailHog\n```\n\nOpen `http://localhost:8025/` in a browser to show the web UI.\n\n## Styling emails\n\n[Foundation for Emails](https://get.foundation/emails.html) is a CSS framework to style emails. Download the CSS version.\n\n## Admin dashboard\n\n[RoyalUI](https://github.com/BootstrapDash/RoyalUI-Free-Bootstrap-Admin-Template) is a highly responsive template built with the latest version of Bootstrap, CSS, HTML5, jQuery, and SASS that can be used for a dashboard.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthaler%2Fbookings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmthaler%2Fbookings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmthaler%2Fbookings/lists"}