# README
Recipe-Rest-API
⚙️ Tech Stack:
- Go
- Docker
- Postgres
- pgAdmin
❗❗ Prerequisites:
- Download Docker Desktop to run the project.
- Download Postman to play around with API.
🧾 Instruction:
- Clone the repository.
git clone https://github.com/DaniilKalts/recipe-rest-api
- 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
- Run docker compose up to create and start containers.
docker-compose up
-
Open localhost:5050 and paste values from the .env file to log in in pgAdmin.
-
Create a new server in pgAdmin.
-
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
-
Run the following query (highlighted with red pencil) in pgAdmin to make sure, the table is created and populated.
-
Open Postman (or any other API platform) and send CRUD requests.