This repo shows a sample for how to create a todo application with GoLang, MySQL and Svelte.
To run the system:
- Install prerequisites
- Run
npm run all
- Install golang
- Install gcc build-essential (gcc)
- Install docker, also can run script
sh scripts/get_docker.sh
. - Install
NodeJs
andnpm
Link. - Install
SvelteKit
which supports local development withSvelte
. Link: https://kit.svelte.dev/
- Install golang
- Install gcc build-essential (gcc)
- Run
mkdir demo_todo_golang
to create a directory for the project. - Run
cd demo_todo_golang
to enter the project directory. - Run
go mod init training/demo_todo
to create the dependencies filego.mod
. - Run
go get .
to download dependencies. - Run
go run .
to run the program.
- Install docker, also can run script
sh scripts/get_docker.sh
. - Run
docker compose up
to startmysql
container. Also you can rundocker compose down -v
to stopmysql
container. Note: when facing issues withmysql
container just follow:
$ docker compose down -v
...
$ docker compose up
...
https://github.com/sveltejs/svelte
- Install
NodeJs
andnpm
Link. Note: You can check ifNodeJs
andnpm
are installed using below commands:
$ node -v
v18.13.0
$ npm -v
8.19.3
- Install
SvelteKit
which supports local development withSvelte
. Link: https://kit.svelte.dev/ - You can a good guidance https://svelte.dev/blog/svelte-for-new-developers
- To creat a Svelte project based on a template after installing SvelteKit:
npm create vite@latest app-name -- --template svelte
cd app-name
npm install
npm run dev