Install these software:
- Go (tested with 1.12.7)
- Node.js (tested with 10.8.0)
- Yarn (tested with 1.9.4)
- Dep (tested with 0.5.0)
- Docker (tested with 18.06.0-ce)
- Docker Compose (tested with 1.19.0)
-
Install the Node dependencies
yarn install
-
Then start the server with autorestart on file changes (reload is still manual).
yarn start
The application is available at http://localhost:5000/.
-
Build the assets for production.
yarn run build
-
Then build the server.
go build
-
Now a binary called
onetimesecret
should exist and the frontend content should be located in the.build
folder.
- Keep the software simple
- Ease the deployment and monitoring by following the 12-factor app principles
- Web Cryptography API : Firefox 61, Chrome 49
- Async functions : Firefox 61, Chrome 63
The forms use traditional HTTP POST requests so that the application can work without JavaScript on the client side. JavaScript enables client-side encryption so it is recommended though not enforced.
Pug is used to simplify the markup language and ease the developments of pages.
Stylus is used as a CSS preprocessor.
Usage of the BEM methodology is recommended by leveraging the &
keyword of Stylus.
The pages are currently very simple so each page is viewed as a BEM component.
Traditionnal HTML elements such as links and buttons usually have their own style because they are used in multiple pages.
- Edit the vector images in frontend/src with Inkscape.
- Then, inside the project root, use the following commands to export the images to png.
inkscape -z frontend/src/logo-icon.svg --export-png frontend/public/images/icon-512.png -w 512 -h 512
inkscape -z frontend/src/logo-icon.svg --export-png frontend/public/images/icon-192.png -w 192 -h 192
inkscape -z frontend/src/logo-icon.svg --export-png frontend/public/images/icon-32.png -w 32 -h 32
inkscape -z frontend/src/icon-lock.svg --export-plain-svg frontend/public/images/icon-lock.svg
- .build: temporary folder containing the compiled assets
- common: contains interfaces that are used by other packages
- conf: contains the configuration of the application and its default values
- frontend: contains all frontend-related stuff
- public: contains all assets that directly served to the browser
- templates: contains the pug pages that are rendered in the browser
- src: contains images in the source format (svg)
- styles: contains the stylus files for styling the pages
- helpers: contains some helper functions that have no external dependencies and can be used by any package
- httpserver: contains the HTTP layer that serves the static content, render the pages and expose an API to interact with the store
- node_modules: contains the Node dependencies, managed with yarn
- store: contains the business and database layer responsible of persisting and retrieving the data from redis
- tests: contains End-to-End tests
- vendor: contains the go dependencies fetched by dep