Skip to content

DjedAlliance/Gluon-Ergo-Backend-Contracts

Repository files navigation

Ergo-Play-Boilerplate

This is an application that is built on the Scala and Play framework.

Table of contents

Running this app

Build exle-dot:

git clone https://github.com/ergo-play-boilerplate
cd ergo-play-boilerplate
sbt assembly

Update the environment variables for your db by running by creating a .env file with the values filled up for:

JDBC_DB_URL="jdbc:postgresql://localhost:{port}/{tablename}"
POSTGRES_PASSWORD={database password}
POSTGRES_USER={database user}
SECRET_KEY={Play app secret}

Run the debug environment by running:

sbt -jvm-debug 9000 run

Docker quick start

You'll need to have Docker installed.

Copy a few example files because the real files are git ignored:

cp .env.example .env
cp docker-compose.override.yml.example docker-compose.override.yml

If you have a database set up and would like to use your own db. Change POSTGRES_PASSWORD in docker-compose.yml and POSTGRES_USER in your new .env file.

Build everything:

The first time you run this it's going to take a while depending on your internet connection speed and computer's hardware specs. That's because it's going to download a few Docker images and build the sbt dependencies

docker compose up --build

Now that everything is built and running, you can call the API at localhost:9000. As this is only the backend service of the app, a web frontend is not included.

To efficiently test it, we highly recommend Postman

And when you're done, use this command to close out everything.

docker compose down

Note: This build uses a volume on your machine. And when you first run it, it will initialize all the db required in the postgres container and save to that volume. If it's running db errors, please check logs via:

docker compose logs -f # -f to follow the logs

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published