🐦 Twitter clone – an assignment for the node.js course at OTH Regensburg
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
lib
static
test
types
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
index.js
less-watch-compiler.config.json
nodemon.json
package.json
tsconfig.json
tslint.json
yarn.lock

README.md

tweetr

Build Status codecov GitHub license GitHub tag

tweetr is a small Twitter-like application for the node.js webdev course at the OTH Regensburg by Eamonn de Leastar.

Users can sign up, login and start tweeting text and images. Tweets can be viewed in a global timeline called "firehose", and in a customized feed, which displays all tweets created by people a user follows. Furthermore, admin users exist, which are able to add and remove any user and tweet.

tweetr is currently deployed to Heroku, using Cloudinary for image storage and mLab's hosted MongoDB. It's built on hapi and TypeScript and, as mentioned, purely educational. There are two accounts by default, root (password p4ssw0rd!) and michaelneu (password password). If you just want to take a quick look around, feel free to use those two.

Setup

tweetr is built on node.js, so you'll need to install its dependencies first:

$ yarn install

Environment variables

All external services in tweetr (e.g. Cloudinary for image uploads and MongoDB for storage) need to be configured using environment variables:

Variable Description
MONGO_URI a MongoDB connection uri, something like mongodb://mongo
CLOUDINARY_CLOUD_NAME the name of your Cloudinary cloud
CLOUDINARY_API_KEY your Cloudinary api key
CLOUDINARY_API_SECRET your Cloudinary api passphrase
JWT_SECRET a passphrase for JWT tokens (generated if not present)
COOKIE_SECRET a passphrase for cookies (generated if not present)
PORT the port tweetr should listen on (defaults to 8080)
NODE_ENV production or dev (see Context)

Context

When running tweetr, you need to decide which context you want to start it in:

  • dev: no template-caching, isSecure not set for hapi-auth-cookie, seeding
  • production: template-caching, isSecure set for hapi-auth-cookie, no seeding

Seeding

When tweetr is started in dev context, all MongoDB collections will be dropped and default data will be seeded.

Usage

tweetr comes with a set of handy scripts built-in:

  • build: builds TypeScript to JavaScript and LESS to CSS
  • clean: deletes build artifacts
  • start: starts tweetr; requires built JavaScript (see build)
  • dev: runs an auto-restarting dev-server without building tweetr
  • test: runs all tests from the test directory

License

tweetr is released under the MIT license.