Dev Setup - acstech/corkboard GitHub Wiki

Be sure to clone this repository into your preexisting Go Path.

Dev Tools

  • API Layer Language: Go 1.8.3
  • Image Storage Interface: AWS S3 Storage
  • Database: Couchbase 4.6.2 Enterprise Edition

Couchbase

CorkBoard uses the NoSql database Couchbase to store data in both development and production stages. The API requires a local Couchbase data bucket to run its test file, but it will clean up all the data it uses. Find information regarding CouchBase setup here

Environment Variables

A .env file must include the following environment variables. This file should be saved in the "acstech/corkboard" directory

  • CB_CONNECTION: Couchbase connection string (e.g. "couchbase://localhost")
  • CB_BUCKET: Name of your CouchBase data bucket
  • CB_PRIVATE_RSA: Name of file of private RSA key in PEM format (If this is missing, one should be automatically generated)
  • CB_PORT: API port number for server connection
  • CB_ENVIRONMENT: Tells API what stage you are working in for AWS storage configuration; "dev" if working in development

Startup

To run the API, the "main.go" file is located in "cmd/corkboard/main.go"

API Data Standards

Users

  • User passwords must be between 8 and 20 characters.
  • Email addresses must be in the following format: "[email protected]", where "a" is at least one character and "b" is at least two characters; emails must be less than 150 characters. This field is required.
  • First and last name fields cannot be more than 30 characters.
  • Various phone number formats are supported, including: "1 8034328484" and "(803) 321 - 3245". Length is enforced.
  • Zip code fields cannot extend 5 characters.

Items

  • Item name (name) must be no more than 180 characters. This is a required field.
  • Item category (category)must be no more than 25 characters. This is a required field.
  • Item description (description) must be no more than 500 characters. This is a required field.
  • Item price (price) cannot be more than '10000000'.
  • The Item picture array (picid) cannot contain more than 5 pictures.
  • Item status (status) cannot contain more than 20 characters.