Skip to content

Interactive Bash program that uses PostgreSQL for managing salon services and appointments. The Bash script interacts with the PostgreSQL database, executing SQL queries for data retrieval, insertion, and updating. The repository includes a detailed README with script analysis and output examples.

Notifications You must be signed in to change notification settings

emanoelcampos/salon-appointment-scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Salon Appointment Scheduler

Learning Documentation

This project was developed as part of the FreeCodeCamp's Relational Database certification. The main goal was to create an interactive Bash program that uses PostgreSQL to manage customers and appointments for a salon.

Database Diagram

salon-database-diagram.svg

This diagram provides a visual representation of the database structure, including tables and the relationships between them.

Script Analysis

The project includes a Bash script (script/appointment-script.sh) that interacts with the PostgreSQL database. Here's a brief overview of what I learned from this script:

  • Database Interaction: The script uses the psql command-line interface to interact with the PostgreSQL database. This includes executing SQL queries to retrieve, insert, and update data in the database.

  • User Interaction: The script prompts the user for input and uses this input to perform various operations. For example, it asks the user to select a service, provide their phone number, and specify a time for their appointment.

  • Data Validation: The script includes checks to validate the user's input. For example, it checks if the selected service ID is a number and if it exists in the database.

  • Data Manipulation: The script uses SQL queries to manipulate data in the database. For example, it inserts a new customer into the customers table if the provided phone number does not exist in the database.

  • Shell Scripting: The script demonstrates various shell scripting concepts, such as defining functions, using conditional statements, and reading user input.

This project provided valuable experience in using Bash scripting to interact with a PostgreSQL database, validating user input, and manipulating data based on this input.

Script Outpout

Output When the Customer Does Not Exist in the Database

$ ./appointment-script.sh 

~~~~~ MY SALON ~~~~~

Welcome to My Salon, how can I help you?

1) cut
2) color
3) perm
10

I could not find that service. What would you like today?
1) cut
2) color
3) perm
1

What's your phone number?
555-5555

I don't have a record for that phone number, what's your name?
Emanoel

What time would you like your cut, Emanoel?
10:30

I have put you down for a cut at 10:30, Emanoel.

Output When the Customer Does Exist in the Database

$ ./appointment-script.sh 

~~~~~ MY SALON ~~~~~

Welcome to My Salon, how can I help you?

1) cut
2) color
3) perm
2

What's your phone number?
555-555-5555

What time would you like your color, Emanoel?
11am

I have put you down for a color at 11am, Emanoel.

About

Interactive Bash program that uses PostgreSQL for managing salon services and appointments. The Bash script interacts with the PostgreSQL database, executing SQL queries for data retrieval, insertion, and updating. The repository includes a detailed README with script analysis and output examples.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages