# Koyo - getting started

**URL:** <https://racket.discourse.group/t/koyo-getting-started/1088>\
**Category:** Questions & Answers\
**Tags:** question, koyo\
**Created:** [June 17, 2022, 11:50pm UTC](https://racket.discourse.group/t/koyo-getting-started/1088 "2022-06-17T23:50:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertpostill](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robertpostill/32/53_2.png) [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Post date:** [June 17, 2022, 11:50pm UTC](https://racket.discourse.group/t/koyo-getting-started/1088/1 "2022-06-17T23:50:32Z")

</div>

I'm having a go at my first koyo project. So far I've got an app up and running with a `raco koyo console` using the default credentials. I'm now attempting to get koyo to use the .env file for configuration. In the documentation, variables should be named \<APP\_NAME\>\_. However, I'm getting authentication issues with postgres because the app user has a non-default password. It looks like the .env file isn't getting loaded.

I edited the config.rkt and sure enough, it connected successfully. Obviously, I don't want to commit the actual credentials in the config.rkt. So how do I make sure the .env file is getting loaded?

---

<div class="post-metadata">

**Author:** ![bogdan](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bogdan/32/8_2.png) [@bogdan](https://racket.discourse.group/u/bogdan)\
**Post date:** [June 18, 2022, 5:24am UTC](https://racket.discourse.group/t/koyo-getting-started/1088/2 "2022-06-18T05:24:28Z")

</div>

`raco koyo serve` and `raco koyo console` don't attempt to load the `.env` file. If you created your project with `raco koyo new`, you'll have a `Procfile` in your root folder, which you can run with `raco chief start` (see the `README.md` in your generated project). [chief](https://github.com/Bogdanp/racket-chief/) loads the `.env` file and runs each entry in the `Procfile`. If you want to run `raco koyo console` with your `.env` file specifically, you can run `raco chief run raco koyo console`.

---

<div class="post-metadata">

**Author:** ![robertpostill](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robertpostill/32/53_2.png) [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Post date:** [June 19, 2022, 7:50am UTC](https://racket.discourse.group/t/koyo-getting-started/1088/3 "2022-06-19T07:50:48Z")

</div>

OK, so if I understand correctly, for development you're expecting config.rkt to hold the credentials and then for production you'd switch to chief and let that load off the .env?

In terms of testing on CI do you see that coming from the config.rkt too?

BTW if there's a better place for me to ask these questions I'm happy to go there. I just figured this was better than leaving you a bag of Github issues.

---

<div class="post-metadata">

**Author:** ![bogdan](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bogdan/32/8_2.png) [@bogdan](https://racket.discourse.group/u/bogdan)\
**Post date:** [June 19, 2022, 9:24am UTC](https://racket.discourse.group/t/koyo-getting-started/1088/4 "2022-06-19T09:24:21Z")

</div>

> OK, so if I understand correctly, for development you're expecting config.rkt to hold the credentials and then for production you'd switch to chief and let that load off the .env?

The reverse. `chief` is intended to be used for development (see the `Development environment` and `Running the app locally` sections of the generated `README.md`) and `config.rkt` itself shouldn't contain any secrets, only config definitions and defaults. For production, I typically generate a distribution with `raco koyo dist`, ship it to a server and then use systemd to run it and set environment variables.

> In terms of testing on CI do you see that coming from the config.rkt too?

Those should also be set by env vars. Here's an example:

> <https://github.com/MarcKaufmann/congame/blob/d11f196058f00faee98167480a1b4b88f5d8aafe/.github/workflows/ci.yml#L68-L76>

In all cases, configuration is intended to come through `config.rkt`, but the actual configuration values are intended to be overwritten at runtime via environment variables depending on the context.

In that same file you can also see how a production distribution is packaged up and deployed (though using docker images instead of systemd in that particular case).

> BTW if there's a better place for me to ask these questions I'm happy to go there. I just figured this was better than leaving you a bag of Github issues.

Anywhere is fine with me!

---

<div class="post-metadata">

**Author:** ![robertpostill](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robertpostill/32/53_2.png) [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Post date:** [June 21, 2022, 6:21am UTC](https://racket.discourse.group/t/koyo-getting-started/1088/5 "2022-06-21T06:21:17Z")

</div>

Ah so I had it plain backwards then 🙂 I appreciate you explaining it to me.
