{"id":28974819,"url":"https://github.com/plcoster/fcc_rel_db_project3","last_synced_at":"2025-07-17T18:12:57.973Z","repository":{"id":299016123,"uuid":"545201390","full_name":"PLCoster/fcc_rel_db_project3","owner":"PLCoster","description":"FreeCodeCamp Relational Database Project 3: Salon Appointment Scheduler","archived":false,"fork":false,"pushed_at":"2022-10-04T00:39:16.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-14T06:32:58.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/PLCoster.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,"zenodo":null}},"created_at":"2022-10-04T00:38:09.000Z","updated_at":"2022-10-04T00:39:20.000Z","dependencies_parsed_at":"2025-06-14T06:33:04.153Z","dependency_job_id":"12c9c9dc-7239-4984-9e06-89e2847bc68c","html_url":"https://github.com/PLCoster/fcc_rel_db_project3","commit_stats":null,"previous_names":["plcoster/fcc_rel_db_project3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PLCoster/fcc_rel_db_project3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_rel_db_project3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_rel_db_project3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_rel_db_project3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_rel_db_project3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PLCoster","download_url":"https://codeload.github.com/PLCoster/fcc_rel_db_project3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PLCoster%2Ffcc_rel_db_project3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261669002,"owners_count":23192362,"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":[],"created_at":"2025-06-24T12:07:06.419Z","updated_at":"2025-06-24T12:07:07.348Z","avatar_url":"https://github.com/PLCoster.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Code Camp: Relational Database Project 3\n\n## Salon Appointment Scheduler\n\nThe aim of this project was to create an interactive Salon Appointment Scheduling program using a PostgreSQL database to store customers and appointments.\n\n### Project Requirements:\n\n- **User Story #1:** You should create a database named `salon`\n\n- **User Story #2:** You should connect to your database, then create tables named `customers`, `appointments`, and `services`\n\n- **User Story #3:** Each table should have a primary key column that automatically increments\n\n- **User Story #4:** Each primary key column should follow the naming convention, `table_name_id`. For example, the `customers` table should have a `customer_id` key. Note that there’s no `s` at the end of `customer`\n\n- **User Story #5:** Your `appointments` table should have a `customer_id` foreign key that references the `customer_id` column from the `customers` table\n\n- **User Story #6:** Your `appointments` table should have a `service_id` foreign key that references the `service_id` column from the `services` table\n\n- **User Story #7:** Your `customers` table should have `phone` that is a `VARCHAR` and must be unique\n\n- **User Story #8:** Your `customers` and `services` tables should have a `name` column\n\n- **User Story #9:** Your `appointments` table should have a `time` column that is a `VARCHAR`\n\n- **User Story #10:** You should have at least three rows in your `services` table for the different services you offer, one with a `service_id` of `1`\n\n- **User Story #11:** You should create a script file named `salon.sh` in the `project` folder\n\n- **User Story #12:** Your script file should have a “shebang” that uses bash when the file is executed (use `#! /bin/bash`)\n\n- **User Story #13:** Your script file should have executable permissions\n\n- **User Story #14:** You should not use the `clear` command in your script\n\n- **User Story #15:** You should display a numbered list of the services you offer before the first prompt for input, each with the format `#) \u003cservice\u003e`. For example, `1) cut`, where `1` is the `service_id`\n\n- **User Story #16:** If you pick a service that doesn't exist, you should be shown the same list of services again\n\n- **User Story #17:** Your script should prompt users to enter a `service_id`, phone number, a name if they aren’t already a customer, and a time. You should use `read` to read these inputs into variables named `SERVICE_ID_SELECTED`, `CUSTOMER_PHONE`, `CUSTOMER_NAME`, and `SERVICE_TIME`\n\n- **User Story #18:** If a phone number entered doesn’t exist, you should get the customers name and enter it, and the phone number, into the `customers` table\n\n- **User Story #19:** You can create a row in the `appointments` table by running your script and entering `1`, `555-555-5555`, `Fabio`, `10:30` at each request for input if that phone number isn’t in the `customers` table. The row should have the `customer_id` for that customer, and the `service_id` for the service entered\n\n- **User Story #20:** You can create another row in the `appointments` table by running your script and entering `2`, `555-555-5555`, `11am` at each request for input if that phone number is already in the `customers` table. The row should have the `customer_id` for that customer, and the `service_id` for the service entered\n\n- **User Story #21:** After an appointment is successfully added, you should output the message `I have put you down for a \u003cservice\u003e at \u003ctime\u003e, \u003cname\u003e.` For example, if the user chooses `cut` as the service, `10:30` is entered for the time, and their name is `Fabio` in the database the output would be `I have put you down for a cut at 10:30, Fabio.` Make sure your script finishes running after completing any of the tasks above, or else the tests won't pass\n\n### Project Writeup:\n\nThe third Free Code Camp: Relational Database project is an interactive Salon Appointment Booking script. Upon running the script, users can:\n\n- Select desired service from a list of services (defined in the salon database)\n- Enter a phone number as a unique identifier of the customer.\n  - If the user is already registered with the salon, then they will be greeted by their name, otherwise their information will be requested to register a new user as a customer.\n- Input their desired appointment time. The appointment information is then stored in the salon database.\n\n### Usage\n\nThe database can be interacted with using `psql` in linux. First start up a PostgreSQL server using:\n\n`$sudo service postgresql start`\n\nThe salon database should then be loaded from the `salon.sql` file using:\n\n`$psql --dbname=postgres \u003c salon.sql`\n\nOptionally the database can be interacted with directly using:\n\n`$psql --dbname=postgres`\n\nOnce loaded, the bash script can be run for the Salon appointment booker. (Note that you will have to change the `--username=freecodecamp` option on line 4 of the script to your linux username or remove this entirely):\n\n`$./salon.sh`\n\nSave a dump of the live database using:\n\n`$pg_dump -cC --inserts salon \u003e salon.sql`\n\nInstructions for building the project can be found at https://www.freecodecamp.org/learn/relational-database/build-a-salon-appointment-scheduler-project/build-a-salon-appointment-scheduler\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_rel_db_project3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplcoster%2Ffcc_rel_db_project3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplcoster%2Ffcc_rel_db_project3/lists"}