Skip to content

Moontary/email-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go & Vue.js Web app


Screenshot 2022-08-17 at 22 56 48

This is a simple web application with a Go server/backend and a Vue.js frontend.

The app is designed to make it easy to use any storage, using Hexagonal architecture. Organized based on containers, in order to provide a real working application for development/deployment. Something more than "hello-world" but with the minimum of pre-reqs.

Currently ready for local build using Golang, Vue.js, MongoDB, Docker.

  • The Frontend written in Vue.js 3
  • The Go component is a Go HTTP server based on Chi routing

Features:

  • View data
  • Add to DB
  • Delete object from list
  • Docker compose wrapped
Email-viewer.mov

DONE


Front-end:

  • Input field
  • Add/remove button
  • Validation for non-empty input
  • Validation for deletion of non-existent item
  • Clearing input after adding/deleting the item
  • Comma separated output

Back-end:

  • Implemented POST end-point
  • Validation for non-empty input
  • Validation for existing data input
  • Implemented core logic for GET and DELETE end-points
  • MongoDB storage
  • Communication with MongoDB
  • Docker compose

TODO


Front-end:

  • Validation clean
  • Fetching.
  • Separate view list option to another component.
  • CSV rendering.

Back-end:

  • Fix validation
  • Fix GET and DELETE end-points.
  • Fix architecture, folder structures.
  • Apply clean code.
  • Edit status codes view.
  • Implement unified entrance.
  • Add Makefile.
  • Apply hexagonal architecture.

General:

  • Add lintering to Makefile.
  • Refactor REST.
  • Add tests.
  • Apply CI/CD.
  • Add Swagger.

Repo Structure


├── frontend            Root of the Vue.js project
│ └── src               Vue.js source code
└── server              Go backend server
  ├── cmd               Server main / exec
  ├── internal          Storage packages
  └── pkg               Supporting packages

Building & Running Locally


Pre-reqs

  • Be using Linux, WSL or MACOS, with bash, make etc
  • Vue.js - run frontend
  • Vite - tooling for frontend
  • Go 1.16+ - for running locally
  • Docker - for running as a container, or image build
  • MongoDB Compass - view collection data after applying changes

Clone the project to any directory where you do development work

git clone https://github.com/moontary/email-viewer.git

Makefile

Current version GNU Make file is provided to help with running and building locally.

up          Start Build
down        Stop an remove containers
logs        View logs
  • The server will listen on port 9090 by default, change this by setting the config/config.go variable.

Config

Environmental variables

Frontend:

  • VITE_URL - Port for serving connection between containers.

Backend:

  • Port - Port to listen on (default: 9090)
  • URI - Port for DB to listen on (default: 27017)