Skip to content

This is a lightweight Go application that allows you to easily log and record a journal or diary.

Notifications You must be signed in to change notification settings

encoredev/example-app-diary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Encore - Backend development engine

Diary Example App

This is a lightweight Go application that allows you to easily log and record a journal or diary. It contains two endpoints: one for listing the journal for a single day, and one for creating a new entry in the journal.

This was built in 30 minutes, with tests included, using Encore. It took 2 minutes to deploy, including with the database.

Endpoints

Listing all my entries for a specific date:

curl -X GET "http://localhost:4000/logbook/entries/2022-09-08" | jq
{
  "Entries": [
    {
      "Id": 1,
      "Time": "2022-09-08T16:25:21.409544Z",
      "Text": "I cooked fried eggs this morning. I forgot how much I loved them!"
    }
  ]
}

Create new diary entry:

curl -X POST --data '{"Text":"I cooked fried eggs this morning. I forgot how much I loved them!"}' "http://localhost:4000/logbook/entries"
{
  "Id": 6,
  "Time": "2022-09-08T16:25:21.409544Z",
  "Text": "I cooked fried eggs this morning. I forgot how much I loved them!"
}

Install

brew install [email protected]
brew install encoredev/tap/encore
git clone [email protected]:encoredev/example-app-diary.git
encore auth signup # or encore auth login (if you already have an account)
encore run

Deployment

encore app create my-diary-app-name
git push origin main

Then head over to https://app.encore.dev to find out your production URL, and off you go into the clouds!

Testing

encore test ./...

Contributing

All contributions are welcome! All we ask is that you adhere to the Code of Conduct

About

This is a lightweight Go application that allows you to easily log and record a journal or diary.

Topics

Resources

Stars

Watchers

Forks

Languages