GithubHelp home page GithubHelp logo

dashr's Introduction

Dashr logo

A dashboard based web app template for quick prototyping

Why

I always think of new personal project ideas. A lot of them require a dashboard, and it's a pain to rewrite the same Node/Express/Passport/JWT/MongoDB backend logic and React/Redux/Dashboard Layout frontend every time. So this example project is the very bare bones starting point for a full stack web app.

Stack

  • React
    • Redux ( w/ Redux Thunk/Logger middleware)
    • Material UI (core/icons/lab)
  • Node
    • Express
    • Winston (Logging)
    • Passport (Local Authentication)
    • JWT Token Cookie Sessions
    • Mongoose (for MongoDB)

To use/run

  1. Clone the repo
  2. in /app/config/ create a file named .env
  3. Open .env.sample and copy over the contents to .env
  4. Add all of your environment variables here are explanations on it:
# PORT - what port you want your backend to run on
PORT=8888

# COOKIE_KEY: the secret you use to sign your cookies
COOKIE_KEY=blahblahblahblah

# Logging: main configuration is in config/winston.js
# LOG_LEVEL: what level you want winston to print out
# LOG_PATH: where you want your log files written to
LOG_LEVEL=debug
LOG_PATH=log

# JWT_SECRET_KEY the secret used to sign jwt tokens
JWT_SECRET_KEY=blahblahblaghblah

# DASHR DB: Database variables
# URI_PREFIX: before your username and password
# URI_SUFFIX: after your username and password
DASHR_DB_URI_PREFIX=mongodb+srv://
[email protected]/dbname?retryWrites=true&w=majority
DASHR_DB_USERNAME=username
DASHR_DB_PASSWORD=password

5 . Run your backend and frontend together with this command.

$ npm run both

Included Functionality

Authentication

Login screen with username + password. Passport Local Authentication Strategy. JWT Token stored in production secure session cookie.

Middleware

I included an example of an "admin check" middleware that checks if the user is an admin before allowing certain endpoints.

MongoDB & Mongoose

Model examples with mongoose. Connection setup to Atlas cloud coming soon.

Redux

Redux store is set up with Redux Thunk and Redux Logger. Multiple asynchronous dispatch examples and combined reducer examples.

Frontend security

HOC wrapped dashboard to push out users without proper session.

Backend Tests

Folder with example tests + test coverage scripts.

Frontend Tests

Gotta work on this one.

Stripe Payment System

Gotta also work on this one, but the idea is to include routes to easily integrate stripe payments. Id like to set up both single purchase and recurring subscriptions.

Building + Deploying (Heroku Example)

Build scripts included. I need to add a Heroku hosting example. Will add docker example later too.

Any Questions?

email: [email protected]

dashr's People

Contributors

jdstregz avatar

Stargazers

Shoaib Bhimani avatar

Watchers

 avatar

Forkers

stregerdevinc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.