beegone

RESTful app in Beego & React

Stars
1
Committers
2

Beegone

Beegone is a CRUD app built to manage vehicle licence plate registrations.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Installing

  • Clone the project to any directory outside GOPATH
$ git clone https://github.com/ICanHaz/beegone.git
$ cd beegone

Project's structure

The project's structure follows conventions as described in Standard Go Project Layout

App is split into 2 binaries with entry points located at:

cmd/
├── api
│   └── main.go
├── server
    └── main.go

Api endpoints

Api consists of 5 endpoints:

  • (GET) /api/carplates - Gets all carplates
curl -X GET \
  http://localhost:9090/api/carplates \
  -H 'Content-Type: application/json'
  • (POST) /api/carplates - Adds a new carplate
curl -X POST \
  http://localhost:9090/api/carplates \
  -H 'Content-Type: application/json'
  -d '{
	"plateId": "AAA-300",
	"modelName": "Batmobile Outback",
	"modelYear": "1990",
	"owner": "Driver 2"
}
  • (GET) /api/carplates/:id - Retrieves carplate with given id
curl -X GET \
  http://localhost:9090/api/carplates/1Q4GX5yPW3KxDuJ9k9XIplGwCTh \ 
  -H 'Content-Type: application/json' 
  • (PUT) /api/carplates - Updates carplate
curl -X PUT \
  http://localhost:9090/api/carplates \
  -H 'Content-Type: application/json' 
  -d '{
    "id": "1PLaFaOOuyXv3ja3eLfUPyDy3de",
    "plateId": "AAA-201",
    "modelName": "Old car",
    "modelYear": "2000",
    "owner": "Driver 2"
}'
  • (DELETE) /api/carplates/:id
curl -X DELETE \
  http://localhost:9090/api/carplates/1PLaC8WRVwz08V0ZUEekSSQViUP \
  -H 'Content-Type: application/json'  

Running

The simplest way to run the app is with Docker Compose:

$ docker-compose up -d

Go to http://localhost:9000/ to see results

If you wish to run app components separately:

To run api:

make run-api

To run server:

make run-server

Testing

  • To run integration tests, run:
make run-integration-tests
  • To run unit tests, run:
make run-unit-tests

Built With