Categorygithub.com/DaniilKalts/recipe-rest-api
repositorypackage
0.0.0-20240523162521-ad1debc58f76
Repository: https://github.com/daniilkalts/recipe-rest-api.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Recipe-Rest-API

⚙️ Tech Stack:

  • Go
  • Docker
  • Postgres
  • pgAdmin

❗❗ Prerequisites:

🧾 Instruction:

  1. Clone the repository.
git clone https://github.com/DaniilKalts/recipe-rest-api
  1. Create .env (environment variables) file and fill it with your values.
DB_USER=db_user
DB_PASSWORD=db_password
DB_NAME=db_name
DB_PORT=db_port
DB_HOST=db_host

PGADMIN_DEFAULT_EMAIL=pgdmin_default_email
PGADMIN_DEFAULT_PASSWORD=pgadmin_deffault_password
  1. Run docker compose up to create and start containers.
docker-compose up
  1. Open localhost:5050 and paste values from the .env file to log in in pgAdmin.

  2. Create a new server in pgAdmin.

  3. Go to CMD (Command Prompt) and execute these queries to intialize and insert values into Recipes Table.

docker exec -it postgres-db sh
psql -U db_user -d db_name -f /docker-entrypoint-initdb.d/create_recipe_table.sql
psql -U db_user -d db_name -f /docker-entrypoint-initdb.d/insert_recipe_table.sql
  1. Run the following query (highlighted with red pencil) in pgAdmin to make sure, the table is created and populated.

  2. Open Postman (or any other API platform) and send CRUD requests.