Giter Club home page Giter Club logo

todo-application's Introduction

Todolist

This repository provides a base project to implemet Todolist application.

docker-compose.yml provides Go 1.17 build tool, MySQL server and phpMyAdmin.

Dependencies

How to run the application

First, you need to start Docker containers.

$ docker-compose up -d

When you finish exercise, please don't forget to stop the containers.

$ docker-compose down

Advanced: How to initialize database

When you modify the database schema, you will need to discard the current DB volumes for creating a new one. It will be easier to rebuild everything than to rebuild only DB container. Following command helps you to do it.

$ docker-compose down --rmi all --volumes --remove-orphans
$ docker-compose up -d

sqlx

Official site: https://jmoiron.github.io/sqlx/

Gin

URL parameters

  • Query Parameters: /user?id=123

    router.GET("/user", func(ctx *gin.Context) {
      id := ctx.Query("id")
    })
  • Path Parameters: /user/123

    router.GET("/user/:id", func(ctx *gin.Context) {
      id := ctx.Param("id")
    })

    ちなみに以下のような場合でも path parameter は正しく動作する

    tasks/:id/edit

    router.GET("/tasks/:id/edit", func(ctx *gin.Context) {
      id := ctx.Param("id")
    })

Directory structure

.
├── Dockerfile
├── Makefile
├── README.md
├── assets
│   ├── script.js
│   └── style.css
├── db
│   ├── conn.go
│   └── entity.go
├── docker
│   └── db
├── docker-compose.yml
├── go.mod
├── go.sum
├── main.go
├── service
│   ├── default.go
│   ├── task.go
│   └── user.go
├── tmp
│   ├── build-errors.log
│   └── main
└── views
    ├── _footer.html
    ├── _header.html
    ├── change_password_form.html
    ├── error.html
    ├── form_edit_task.html
    ├── form_new_task.html
    ├── index.html
    ├── new_user_form.html
    ├── task.html
    └── task_list.html

todo-application's People

Contributors

okoge-kaz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.