Sign inSign up

waduphaitian/mural_server

By waduphaitian

•Updated over 6 years ago

Mural Server image for DigiMural

Image
0

184

waduphaitian/mural_server repository overview

⁠MuralServer

An image server for mural in public locations. Done using Mongo for image rui, and nodejs/expresjs for filesystem and http server.

⁠Branch Naming Convention

Based on: https://nvie.com/posts/a-successful-git-branching-model/⁠

⁠Master

Naming: master

Contains production ready code.

Accepts pull requests from hotfix and development

⁠Development

Naming: development

Contains features to be added to the next release of master.

Accepts pull requests from all branches

Merges to master

⁠Feature

Naming: feat/"feature-name"/*:

Feature branch with a short description of feature to be added

Branches from development

Merges to development

⁠Bugs

Naming: bug/"bug-name"/*: bug fix branch

Branches from development

Merges to development

⁠Hotfix

Naming: hotfix/"hotfix-name"/*:

bug fix branch to be added directly to master

Branches from master

Merges to master and development

⁠Docker

In order to execute any of the following steps, please ensure that you have docker and docker-compose installed.

⁠Running the application
⁠amd64(MacOs/Windows/Linux)

For production:

Copy production/docker-compose.yml file onto host, then run docker-compose up from terminal.

Todo: make production script to automate lauch

For development:

  • Running the application:

Clone the repo then from project root directory execute " docker-compose build" then "docker-compose up". When finished execute "docker-compose down"

  • Building images for the dockerhub repo

based on : https://collabnix.com/building-arm-based-docker-images-on-docker-desktop-made-possible-using-buildx/⁠ and https://engineering.docker.com/2019/04/multi-arch-images/⁠

From directory containing Dockerfile run docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t waduphaitian/mural_server:"TAG" --push .

As of 12/25/2019, you must install docker edge in order to have access to docker buildx (for building to different architectures like the pi)

⁠arm/v7 (Raspberry Pi)

For production:

Copy production/docker-compose-rpi.yml file onto host, then run docker-compose up from terminal.

As of 12/25/2019, there is an issue with running the container with pre-existing data, issue has been logged.

⁠Information on interacting with Mural Server

https://stackoverflow.com/questions/34485420/how-do-you-put-an-image-file-in-a-json-object⁠

Link to SRS: https://docs.google.com/document/d/1ZT2cZshSB1eGTFVNpefFdSbePj1-PGu5DbrCR10F6dI/edit?usp=sharing⁠

https://medium.com/@me_37286/yoni-goldberg-javascript-nodejs-testing-best-practices-2b98924c9347⁠

To start application: docker-compose build, docker-compose up https://www.youtube.com/watch?v=ACzMbQEq_tw⁠

for sending http posts for testing through terminal http://osxdaily.com/2017/01/30/curl-post-request-command-line-syntax/⁠

https://glebbahmutov.com/blog/how-to-correctly-unit-test-express-server/⁠

https://mochajs.org/⁠

https://codeburst.io/javascript-unit-testing-using-mocha-and-chai-1d97d9f18e71⁠

https://stackoverflow.com/questions/49534032/how-to-expect-http-error-and-response-using-chai-in-nodejs⁠

for resarting server on js edit "npx nodemon" https://medium.com/@xoor/building-a-node-js-rest-api-8-unit-testing-822c32a587df⁠

https://github.com/kriscfoster/express-mongo/blob/master/db/index.js⁠

https://www.youtube.com/watch?v=7VNgjfmv_fE⁠ testing upload commands:

For sending request withough body curl -X POST http://0.0.0.0:3000/upload/username⁠

https://samwize.com/2014/02/08/a-guide-to-mochas-describe-it-and-setup-hooks/⁠

for sending request with body curl -H "Content-Type: application/json" -X POST -d '{"data":"bob","key":"123"}' http://0.0.0.0:3000/upload/username⁠

for sending request with all params need for function data:image/png;base64,

Curl command for sending an artifact curl POST -F 'caption=yo' -F 'key=845b3f7b0a8439794a361e8079add0a1164195151b40755abb59dcb56d55e8f6' -F 'username=username' -F 'created_on=1989-10-19' -F 'tags[]=lit' -F 'tags[]=hellyea' -F 'image=@/Users/Patrick/Desktop/r.png' 0.0.0.0:3000/upload

curl command for requesting feed curl -H "Content-Type: application/json" -X GET -d '{"created_on":"2014-01-22T14:56:59.301Z"}' http://0.0.0.0:3000/feed⁠

Tag summary

Content type

Image

Digest

Size

370.7 MB

Last updated

over 6 years ago

docker pull waduphaitian/mural_server:dev-autobuild