A RESTful API for generating appealing 5 colour, colour palettes.
# Download this project
git clone https://github.com/MattiasHenders/palette-town-api.git
# Build and Run on MacOS/Linux
make run-server
# Build and Run on Windows
make run-server-windows
# API Endpoint : http://localhost:8080
# Create .env in root, see .env.example for needed variables
{
"message": "Successfully got colour palette from given word",
"givenInput": "forest",
"code": 200,
"data": {
"colours": [
"#747f41",
"#538443",
"#4f632d",
"#8f995d",
"#d4cc7d"
]
},
"coolorsLink": "https://coolors.co/747f41-538443-4f632d-8f995d-d4cc7d"
}
GET
: Get a random colour palette
GET
: Get a colour palette based on an input of colours
GET
: Get a colour palette based on an input of words
Endpoint: /api/colour/random
Endpoint: /api/colour/colours
Input: colours=#fe34a1
Endpoint: /api/colour/words
Input: words=flame
Endpoint: /api/colour/words
Input: words=mango icecream
- Support basic REST APIs.
- Support Authentication with user for securing the APIs.
- Write the tests for all APIs.
- Organize the code with packages
- Make docs with GoDoc
- Building a deployment process
- Connect to a database for users
- Host the Colourminds API on own server
- Allow for rgb inputs
├── src
│ ├── main.go
│ ├── handlers
│ │ ├── colours.go // Common response functions for colour endpoints
│ │ └── users.go // Common response functions for user endpoints
│ ├── internal
│ │ ├── errors
| │ │ └── errors.go // Internal error models and functions
│ │ └── server_helpers
| │ └── server_helpers.go // Internal error models and functions
│ ├── model
│ | ├── colours.go // Models for colours
│ | ├── users.go // Models for users
│ | └── server.go // Models for the server
│ └── pkgs
│ └── colours.go // Functions for generating colour palettes
├── config
│ └── config.go // Configuration
├── tests
│ └── colours
│ └── colours_test.go // Tests for colour functions
└── main.go