killjaqular / picasso

Image database hosting.
0 stars 0 forks source link

Picasso

Problem:

Ability to host images on a networked service.

Solution:

HTTP Server to host image storage. A user will create an account, save, delete, and download their images.

Development Notes:

Golang documentation can be found at: Golang
PostgreSQL documentation can be found at: PostgreSQL

Summary of solution (Requirements)

We will be using Docker containers to host 2 services:

  1. Database, postgresql:
  2. The Database will receive data from:
    1. The HTTP Server.
  3. Server, Custom HTTP Server written in Golang:
  4. The Server will:
    1. Require a user to register an account.
    2. Require a user to sign-in to their account.
    3. Allow users to upload images.
    4. Allow users to see a list of their saved images on their account.
    5. Allow users to delete an image on their account.
    6. Allow users to download an image on their account to their machine.

database

Building

Use the make recipe:

user@host:$>make database

Developing

All related material for the development of the Database will be found in the database/ directory.
Some configurations required during the runtime of Database will be found in the configs/ directory.
Most configurations for the Database are found in the database/ directory.

  1. initDatabase.sql:
  2. This file is used to create the database, schemas, and tables.
  3. initUser.sql
  4. This file is used to create the users that will have permissions for the tables.
  5. wait-for-it.sh
  6. Used to announce to other Docker containers if the Database has started.

Testing

Minimum testing is required for:

  1. Logging into accounts that do not exist.
  2. Inserting images into valid paths.
  3. Inserting images into invalid paths.
  4. Deleting images that do not exist.
  5. Downloading images that do not exist.
  6. TODO: Add to the list as test cases are created.

server

Building

Use the make recipe:

user@host:$>make server

Developing

All related material for the development of the Server will be found in the server/ directory.
All configurations required during the runtime of Server will be found in the configs/ directory.

Testing

Minimum testing is required for:

  1. Logging into accounts that do not exist.
  2. Inserting images into valid paths.
  3. Inserting images into invalid paths.
  4. Inserting images of 0 bytes.
  5. Inserting images of 1 Gigabyte. (1,073,741,824 bytes)
  6. Deleting images that do not exist.
  7. Downloading images that do not exist.
  8. TODO: Add to the list as test cases are created.

Integration

Deployment

Use the make recipe:

user@host:$>make all
user@host:$>make run

Testing

Minimum testing is required for:

  1. Logging into accounts that do not exist.
  2. Inserting images of 0 bytes.
  3. Inserting images of 1 Gigabyte. (1,073,741,824 bytes)
  4. Deleting images that do not exist.
  5. Downloading images that do not exist.
  6. TODO: Add to the list as test cases are created.

Makefile

Recipes:

database - Pulls the Docker image of a postgresql free to use database and includes the project's tables, triggers, configurations, etc.
server - Builds our HTTP Server solution.