8000 GitHub - thinh9e/exercise-validation: Create a simple website to allow user to validate their implementation for Go exercise
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 17, 2022. It is now read-only.

thinh9e/exercise-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VALIDATE EXERCISE

Create a simple website to allow user to validate their implementation for Go exercise during the time they learn Go

Admin create/update/delete exercise with:

  • Title
  • Description
  • Upload solution_test.go

Candidate upload solution.go, system validate their solution by running with solution_test.go

Requirement

  • Lang: Go
  • Web library: gorialla/mux
  • UI: HTML - Go server side rendering (using template/html)
  • DB: MongoDB
  • Deployment: Docker
  • Run/build go code: use API from play.golang.org

Structure

Routing:

  • /: show list all exercises
  • /admin: show list all exercises
  • /exercise:
    • /{id}: show an exercise with id in database
    • /create/: create an new exercise
    • /edit/{id}: edit an exercise
    • /delete/{id}: delete an exercise

API:

  • /api/exercise GET: get all exercises
  • /api/exercise POST: create a new exercise
    • /{id} GET: get an exercise with id in database
    • /{id} PUT: update an exercise
    • /{id} DELETE: delete an exercise

Execute:

  • Using API "/fmt" and "/complie" on webstie play.golang.org to reformat and run test code

Library:

Build

Import libraries

Enable and using go module in current terminal

$ export GO111MODULE=on
$ go mod vendor

Docker

Build the docker image

$ make docker

Run project in docker. Open your browser and access to link localhost:8080. Press Ctrl+C to stop

$ make compose

Clean temporary data from docker

$ make docker_prune

About

Create a simple website to allow user to validate their implementation for Go exercise

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0