Rebuild Shuffle structure for docker image builds

This commit is contained in:
frikky
2020-05-24 07:53:39 +02:00
parent f94ef2bffa
commit 62bc6708c1
43 changed files with 97 additions and 448 deletions
+13 -56
View File
@@ -1,61 +1,18 @@
# Backend setup
1 Go to https://console.cloud.google.com/apis/credentials?project=shuffle-241517&folder&organizationId and get credentials
2. Move the file to current folder (or make step 3 be your download folder or w/e)
3. export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/Shuffle-2a19ff64af66.json
# Backend
This folder has all parts necessary for the backend to run locally and in Docker
# Backend run testserver (appengine)
1. Set up gcloud locally
```bash
dev_appserver.py go-app/ --port=5001 --host=0.0.0.0 --enable_host_checking=false
```
## Structure
* go-app: The backend. Modify these to edit the backend API.
* database: The datastore database.
* app_sdk: The app_sdk for apps. MIT licensed.
* app_gen: Code used when generating docker images. MIT licensed
* tests: A bunch of cronscripts. There are no real, good tests yet
# Backend deploy
* I created a simple script that moves the data into your GOPATH and deploys for you. This will require more tests in the future.
## Development
Shuffle's backend is written in Go, with apps being python (for now). More about local development can be seen in the main README.
# OpenAPI spec checks
Paths:
* /path/{variablename}?queryvar= <-- variable
* ^variablename needs to be part of parameters too.
* ^queryvar needs to be part of parameters too.
Running the backend:
```
parameters:
- name: variablename
in: path
description: Blah blah
required: true/false
schema:
type: string
enum: [a, b, c] # <-- not necessary, but could be great
- name: queryvar
in: query
description: blah blah
required: true/false
schema:
type: string
enum: [a, b, c]
```
* requestBody? Not in GET, DELETE & HEAD. Can consume JSON, XML, form data, plai ntext & others. Can use markdown for the description.
* Do I care about the response? Maybe :o
```
requestBody:
description: Optional kind of description
required: false/true
content:
application/json:
schema:
type: object
additionalProperties: true
properties:
name:
type: string
fav_number:
type: integer
required:
- name
- email
encoding:
color:
style: form
explode: false
cd go-app
go run *.go
```