Skip to content

prest/prest

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
January 13, 2023 00:41
January 16, 2023 09:40
cmd
October 19, 2022 17:03
January 16, 2023 09:40
October 19, 2022 17:03
January 16, 2023 09:40
etc
January 16, 2023 09:40
January 13, 2023 00:41
January 5, 2023 16:06
January 5, 2023 16:06
January 16, 2023 09:40
January 13, 2023 00:41
November 8, 2022 12:13
September 28, 2020 09:54
December 30, 2021 07:24
September 2, 2021 07:25
January 16, 2023 09:40
November 25, 2021 15:08
January 12, 2023 09:06
December 17, 2022 05:05
January 16, 2023 09:40
March 30, 2021 12:09

RESTful API prestd

Build Status GoDoc Go Report Card codecov Homebrew Slack

pREST (PostgreSQL REST), simplify and accelerate development, instant, realtime, high-performance on any Postgres application, existing or new

PostgreSQL version 9.5 or higher

Contributor License Agreement - CLA assistant

pREST - instant, realtime, high-performance on PostgreSQL | Product Hunt

Problem

There is PostgREST written in Haskell, but keeping Haskell software in production is not an easy job. With this need prestd was born. Read more.

Test using Docker

To simplify the process of bringing up the test environment we will use docker-compose

# Download docker compose file
wget https://raw.githubusercontent.com/prest/prest/main/docker-compose-prod.yml -O docker-compose.yml

# Up (run) PostgreSQL and prestd
docker-compose up
# Run data migration to create user structure for access (JWT)
docker-compose exec prest prestd migrate up auth

# Create user and password for API access (via JWT)
## user: prest
## pass: prest
docker-compose exec postgres psql -d prest -U prest -c "INSERT INTO prest_users (name, username, password) VALUES ('pREST Full Name', 'prest', MD5('prest'))"
# Check if the user was created successfully (by doing a select on the table)
docker-compose exec postgres psql -d prest -U prest -c "select * from prest_users"

# Generate JWT Token with user and password created
curl -i -X POST http://127.0.0.1:3000/auth -H "Content-Type: application/json" -d '{"username": "prest", "password": "prest"}'
# Access endpoint using JWT Token
curl -i -X GET http://127.0.0.1:3000/prest/public/prest_users -H "Accept: application/json" -H "Authorization: Bearer {TOKEN}"

Want to contribute to the project and don't know where to start? See our contribution guide here.

1-Click Deploy

Heroku

Deploy to Heroku and instantly get a realtime RESTFul API backed by Heroku Postgres:

Deploy to Heroku

Documentation

https://docs.prestd.com/ (content source and template source)

run locally

You can use the db from our docker-compose.yml file and disable the prestd image pull, then just use the following commands:

$ prest git:(main) cd cmd/prestd

$ prestd git:(main) PREST_CACHE=false \
PREST_PG_HOST=localhost  \
PREST_SSL_MODE=disable   \
PREST_JWT_DEFAULT=false  \
PREST_PG_PORT=5432       \
PREST_PG_PASS=prest      \
PREST_PG_USER=prest      \
PREST_DEBUG=true  \
go run main.go