Skip to content

The most basic version of our Time App possible to start *using* it internally!

License

Notifications You must be signed in to change notification settings

dwyl/time-mvp-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time App Minimum Viable Product ("MVP")

Try it: https://time-mvp.herokuapp.com

Build Status

MVP

The simplest version possible of Time
written in the least sophisticated language
in the shortest amount of time
to get something working fast
so that I can start testing it on myself
(and other "early adopters")
so that we can iterate on features fast!
AKA
"plan to throw one away".

Why?

To get something I can start using myself and measure my own usage while retaining control of my (personal) data.
(I'm tired of using closed-source time/task trackers while we're building the "Real" version of Time!)

buildmeasurelearn

What?

The Time application written in JavaScript/Node.js without any "frameworks" or "libraries" just to get something working as fast as possible!

This code is to "scratch my own itch" so please don't "judge" it for "quality"! However it is meant to be "readable" so if there is anything unclear, please feel free to post a question: https://github.com/nelsonic/time-mvp/issues (I don't "byte"! and usually reply within a couple of hours...)

See: Implementation Notes (below)

How?

The code in this project/MVP is meant to be: (in order of priority)

  • Functional - it works well enough for me to start using it!
  • Human-readable so anyone with basic HTML/JavaScript knowledge can read and understand it.

We are not making any attempt to make the code: "High Performance", "Scalable" or "Elegant" in any way.

The best way to get started is to run this example locally.

_As always, if you have any questions or get stuck, we are here to help! Open an issue/question: https://github.com/nelsonic/time-mvp/issues

0. Pre-Requisites

You will need to have two things installed before trying to run the code:

  • Node.js (with NPM)
  • PostgreSQL

Please ensure you have PostgreSQL Installed and Running on your local machine before you attempt to run this example. see: https://wiki.postgresql.org/wiki/Detailed_installation_guides

1. Clone the repo:

git clone https://github.com/nelsonic/time-mvp.git
cd time-mvp

2. Install Dependencies from NPM

npm install

3. Environment Variables

Ensure you have the Required Environment Variables:

create an .env file in root of the project

and add a line for your DATABASE_URL. e.g:

export PORT=4000
export DATABASE_URL=postgres://postgres:@localhost/test
export TEMPLATE_DIRECTORY=./server/email_templates
export [email protected]
export AWS_REGION=eu-west-1
export AWS_ACCESS_KEY_ID=YOURKEY
export AWS_SECRET_ACCESS_KEY=YOURSUPERSECRET

The default on Mac is: export DATABASE_URL=postgres://postgres:@localhost/test
if you don't already have a database called test on your system,
create it now by running this command in your psql/pgadmin: CREATE DATABASE test;

Most of these environment variables are for sending emails via AWS SES using sendemail if you are only trying this out on your localhost you won't need to set these and the email sending feature will degrade gracefully.

4. Run the Tests

npm test

Note: running npm test will first execute npm run create which creates the necessary Database Tables to run the app. see: /test/database_setup.sql

5. Run the Server

npm run faster

Implementation Notes

Absolute Bare Minimum Dependencies

Most people are lead to believe that they need to learn/use the latest & greatest framework in order to build anything.

This complete has Exactly Five Dependencies.
see: https://github.com/nelsonic/time-mvp/blob/master/package.json
i.e: No React, Redux, Babel, Webpack, Express/Hapi, etc.
This is not a "coincidence". It's certainly not because we (reasonably experienced developers) don't know how to use these frameworks/libraries ...

While we have attempted to make this MVP as simple as possible by not using any server-side or client frameworks, we have opted to use a couple of tools for the following reasons:

  • They are in the spirit of MVP (no bloat)
  • They are in our chosen "stack" so we will be able to re-use code in the "Real" version of the Time app.
  • Most people in our organization are familiar/experienced with these tools so the code in this MVP will be easy to understand.
  • We have a "Beginner Level" Tutorial forEach one (see links in each sub-section below) so the learning curve is shallower.

Tachyons for UI Consistency

Rather than writing a lot of CSS by-hand/from-scratch we are using the awesome Tachyons
because it's fast/small & functional! If you have never heard of it and are curious (you should be!),
see: github.com/dwyl/learn-tachyons

PostgreSQL for Persistence (Saving/Storing Data)

PostgreSQL is the not the fastest Datastore, (that would be Redis ...) However PostgreSQL is the 4th most popular Database in the world (not that you should base decisions on "Popularity Contests" but in this case it means that many people will understand the MVP and can re-use/extend it if they chose to!) also PostgreSQL is the default database in Phoenix (Ecto) so we will be able to re-use the Database (or at least easily migrate) in the "Real" version of Time. If you are new to PostgreSQL, please see: github.com/dwyl/learn-postgresql

Deployed to Heroku

The fastest way we know to ship an application is using Heroku (5 mins).
You can too: github.com/dwyl/learn-heroku

Answers! (FAQ)

Q: Why Build a Minimum Viable Product ("MVP") if you know it's not the "Real" thing?
A: If you are unfamiliar with why we build MVPs please read "The Lean Startup".

Q: Why JavaScript?
A: Because for better-or-worse it's the language everyone knows!
(and annyoningly it's what I have the most practice with so can write faster than Elixir/Erlang, for now...).

Q: Why aren't you using any "Frameworks"?
A: I am! Tachyons & Fontawesome! but no JS frameworks/libraries because we don't need them for an MVP!

About

The most basic version of our Time App possible to start *using* it internally!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published