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
NodeJsandnpmLink. - Install
SvelteKitwhich supports local development withSvelte. Link: https://kit.svelte.dev/
- Install golang
- Install gcc build-essential (gcc)
- Run
mkdir demo_todo_golangto create a directory for the project. - Run
cd demo_todo_golangto enter the project directory. - Run
go mod init training/demo_todoto 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 upto startmysqlcontainer. Also you can rundocker compose down -vto stopmysqlcontainer. Note: when facing issues withmysqlcontainer just follow:
$ docker compose down -v
...
$ docker compose up
...https://github.com/sveltejs/svelte
- Install
NodeJsandnpmLink. Note: You can check ifNodeJsandnpmare installed using below commands:
$ node -v
v18.13.0
$ npm -v
8.19.3- Install
SvelteKitwhich 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