/WM145-SDS-CW2

Primary LanguageRustMIT LicenseMIT

ACME Automotive Finance's internal notes system

A simple notes system for use internally within a company, all notes are stored in a central SQLite3 database

This repo contains 3 implementations of the notes system. The orginial, using javascript an implementation in Rust using the Rocket.rs framework & an implementation using GO

Dependencies

Cloud Architecture Diagram

Architecture Design

Getting started

In the cloud

  • Install terraform and the AWS CLI
  • Set up the AWS CLI
aws configure
# When prompted enter your acces key, secret key, and region
# More info can be found here --> https://docs.aws.amazon.com/cli/latest/reference/configure/
  • Clone the repo and navigate to the terraform directory
 git clone https://github.com/oSharpey/sds-cw2
 cd sds-cw2/terraform
  • To launch the cloud infrustructre run:
terraform init
terraform plan # this lets you check the resources that will be created
terraform apply # --auto-approve if you feel like
  • To tear down the infrustructre run:
terraform destroy # --auto-approve if you feel like

Navigate to the URL of the implementation of your choice

Running & Building locally

Rust

  • Clone the repo
git clone https://github.com/oSharpey/sds-cw2
cd sds-cw2
  • Navigate to the rust-notebook directory
  • Build and run the binary
cd rust-notebook/
cargo run  # For full debug info
# OR
cargo run --release  # For optimised release version

Go to http://localhost:8080 and enjoy!


GO

  • Clone the repo
git clone https://github.com/oSharpey/sds-cw2
cd sds-cw2
  • Navigate to the go-notebook/app directory
  • Build and run the binary
cd go-notebook/app
go run main.go

Go to http://localhost:8080 and enjoy!


JavaScript

  • Clone the repo
git clone https://github.com/oSharpey/sds-cw2
cd sds-cw2
  • Navigate to the js-notebook/app directory
  • Install dependencies
  • Run the server
cd js-notebook/app
npm i
npm start

Go to http://localhost:8080 and enjoy!

Running through docker

Pulling the package from the repo

  • Download your chosen implementation
docker pull osharpey/go-notes:latest
docker pull osharpey/rust-notes:latest
  • List all the images on your system
  • Run the docker container with the image id of your chosen package
docker images
docker run <image id>

Go to http://localhost:8080 and enjoy!


Building the docker image locally

  • Clone the repo
git clone https://github.com/oSharpey/sds-cw2
cd sds-cw2
  • Navigate to the directory containing the docker file of the implementaion you want to build
  • Build the docker image
  • Run the container
cd <dir>  # rust-notebook/ js-notebook/ go-notebook
docker build .  # optionally add '-t <name>' to add a tag to the image
docker run <image id>  # run with the docker image id of the image you just built

To-Do

  • Architecture Diagram
  • ADRs
  • Funcional locally
  • Deploy to cloud
  • Scripted Cloud Creation
  • Automation
    • Testing
    • Building
    • Deploying
  • Tear down command
  • Message Logging
    • Design Message Logging algorithm
    • Implement Message Logging