{"id":13627972,"url":"https://github.com/josephspurrier/gomithriltsapp","last_synced_at":"2026-01-22T06:28:07.326Z","repository":{"id":39044025,"uuid":"282736693","full_name":"josephspurrier/gomithriltsapp","owner":"josephspurrier","description":"Sample notepad application in Mithril (TypeScript and Hyperscript) and Go showing good practices and integrations with modern tools. This project uses Bulma, Cypress, Docker, ESLint, gvt, make, Mock Service Worker, Rove, Storybook, Swagger, and Travis-CI.","archived":false,"fork":false,"pushed_at":"2023-01-07T20:33:41.000Z","size":33021,"stargazers_count":6,"open_issues_count":22,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T22:41:42.770Z","etag":null,"topics":["bulma","cypress","docker","golang","hyperscript","makefile","mithril","notepad-application","storybook","swagger","typescript","vscode"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/josephspurrier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-26T21:31:34.000Z","updated_at":"2024-05-20T14:33:31.000Z","dependencies_parsed_at":"2023-02-08T01:01:31.182Z","dependency_job_id":null,"html_url":"https://github.com/josephspurrier/gomithriltsapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephspurrier%2Fgomithriltsapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephspurrier%2Fgomithriltsapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephspurrier%2Fgomithriltsapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josephspurrier%2Fgomithriltsapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josephspurrier","download_url":"https://codeload.github.com/josephspurrier/gomithriltsapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223735221,"owners_count":17194065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bulma","cypress","docker","golang","hyperscript","makefile","mithril","notepad-application","storybook","swagger","typescript","vscode"],"created_at":"2024-08-01T22:00:41.855Z","updated_at":"2026-01-22T06:28:07.297Z","avatar_url":"https://github.com/josephspurrier.png","language":"Go","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# gomithriltsapp\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/josephspurrier/gomithriltsapp)](https://goreportcard.com/report/github.com/josephspurrier/gomithriltsapp)\n[![Build Status](https://travis-ci.org/josephspurrier/gomithriltsapp.svg)](https://travis-ci.org/josephspurrier/gomithriltsapp)\n[![Coverage Status](https://coveralls.io/repos/github/josephspurrier/gomithriltsapp/badge.svg?branch=master\u0026timestamp=20200313-01)](https://coveralls.io/github/josephspurrier/gomithriltsapp?branch=master)\n\n[![Swagger Validator](https://online.swagger.io/validator?url=https://raw.githubusercontent.com/josephspurrier/gomithriltsapp/master/src/app/ui/static/swagger.json)](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/josephspurrier/gomithriltsapp/master/src/app/ui/static/swagger.json)\n\nThis is a sample notepad application that uses Mithril with TypeScript (and HyperScript) on the front-end (UI) and Go on the back-end (API). It does also support JSX (.tsx file extension) if you want to use it. This project is designed to show good development and CI/CD practices as well as integrations between modern development tools.\n\nThis project uses a [Makefile](Makefile) to centralize frequently used commands. The code coverage badge above is only for the back-end API - not the front-end.\n\n![Demo gif](https://user-images.githubusercontent.com/2394539/76177148-ac753e00-6189-11ea-963b-bff38b29e8ed.gif)\n\n## Quick Start with Docker Compose\n\nTo test the application locally, you can run these commands. You don't need any of the the dev tools (Go/npm) installed, you only need Docker (and Docker Compose). The Go application serves both the UI and the API depending on the request URL.\n\n```bash\n# Clone the repo.\ngit clone git@github.com:josephspurrier/gomithriltsapp.git\n\n# CD to the project directory.\ncd gomithriltsapp\n\n# Build the docker containers.\nmake docker-build\n\n# Run the docker containers: DB and app.\ndocker-compose up -d\n\n# Open your browser to the UI: http://localhost\n# Open your browser to the API: http://localhost/api\n# Open your MySQL tool to the DB: localhost:3306 (root:password)\n\n# Stop and remove the docker containers.\ndocker-compose down\n```\n\n# Environment Prep\n\nOnce you have cloned the repo, you will need the following tools for local development.\n\n## Go\n\nYou should use Go 1.11 or newer. We recommend [gvm](https://github.com/moovweb/gvm) for installing and managing your versions of Go.\n\nAll of the commands below assume you have your `GOPATH` set to the root of the project directory. This is by design because we found (after many projects) it is much easier for you to clone the repo and make changes without having to rewrite imports if they are all contained within the project.\n\n## Node and npm\n\nYou should install [NodeJS and npm](https://nodejs.org/).\n\nThese are the current versions on the front-end components:\n\n- Mithril [v2.0.4](https://github.com/MithrilJS/mithril.js/releases/tag/v2.0.4) - [docs](https://mithril.js.org/)\n- Bulma [v0.8.2](https://www.npmjs.com/package/bulma/v/0.8.2) - [docs](https://bulma.io/documentation/)\n\n## Visual Studio Code (VSCode) Setup\n\nYou can use any IDE, but here is what you need for VSCode. It was quite a challenge getting ESLint to work properly when the .eslintrc.js file is not in the root of the project - the trick was the \"eslint.workingDirectories\" setting. All the settings are included in the .vscode/settings.json file. I use VSCode open only to the root of the project with no other projects. I recommend the following VSCode extensions:\n\n- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)\n- [Go](https://marketplace.visualstudio.com/items?itemName=ms-vscode.Go)\n\n## Environment Variables\n\nYou can also use [direnv](https://direnv.net/) which sets your environment variables based on your current directory. For instance, you can install direnv, create a file in the root of this project called `.envrc`, and paste in the following:\n\n```bash\n# Set $GOPATH for Go.\nexport GOPATH=`pwd`\n# Add the local Go bin directory and the npm bin directory to $PATH.\nexport PATH=$PATH:`pwd`/bin:`pwd`/src/app/ui/node_modules/.bin\n```\n\nSave the file and type `direnv allow`. That will automatically set environment variables when you `CD` into the project root and child folders.\n\n## Makefile Commands\n\n### Start Services\n\nYou can run these commands from different terminals to start the services.\n\n```bash\n# Create and run the database container.\nmake db-init\n\n# Start the UI in local dev mode after installing dependencies.\nmake ui-dep\nmake ui-dev\n\n# Start the API in local dev mode after installing the dependencies.\nmake api-dep\nmake api-dev\n\n# Start the documentation service in local dev mode after install the dependencies.\nmake doc-dep\nmake doc-dev\n```\n\n### Database Control\n\nThese are other database commands you can use:\n\n```bash\n# Start the DB container.\nmake db-start\n\n# Stop the DB container.\nmake db-stop\n\n# Drop the database, create a new database, and apply new migrations.\nmake db-reset\n\n# Delete the DB container.\nmake db-rm\n```\n\n### UI and API Tests\n\nRun tests for UI:\n\n```bash\n# Run the UI tests.\nmake ui-test\n```\n\nRun tests for the API:\n\n```bash\n# Create and run the database container.\nmake db-init\n\n# Run the API tests.\nmake api-test\n```\n\n# Additional Documentation\n\nThis is one repository of a few that demonstrate with different front-end frameworks how to build a notepad application with authentication. A few of the other repositories are:\n\n- [Vue and Go](https://github.com/josephspurrier/govueapp)\n- [Mithril and Go](https://github.com/josephspurrier/gomithrilapp)\n- [Mithril (TypeScript) and Go](https://github.com/josephspurrier/gomithriltsapp)\n- [React (TypeScript) and Go](https://github.com/josephspurrier/goreactapp)\n\nYou can reference some off the documention here, though it's specific to the non-TypeScript Mithril repository:\nhttps://josephspurrier.github.io/gomithrilapp/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephspurrier%2Fgomithriltsapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosephspurrier%2Fgomithriltsapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosephspurrier%2Fgomithriltsapp/lists"}