All Projects β†’ snollygolly β†’ Koa Starter

snollygolly / Koa Starter

🐨 A starter kit for a slightly opinionated koa project.

Projects that are alternatives of or similar to Koa Starter

Lad
πŸ‘¦ Lad is the best Node.js framework. Made by a former Express TC and Koa team member.
Stars: ✭ 2,112 (+2327.59%)
Mutual labels:  koa, passport, bootstrap
Koa Passport Mongoose Graphql
Koa 2 server with Passport + Mongoose + GraphQL
Stars: ✭ 190 (+118.39%)
Mutual labels:  koa, passport
Koa Hbs
Handlebars templates for Koa.js
Stars: ✭ 156 (+79.31%)
Mutual labels:  koa, handlebars
nest-js-boilerplate
Nest.js boilerplate
Stars: ✭ 79 (-9.2%)
Mutual labels:  passport, starter-kit
Angular Full Stack
Angular Full Stack project built using Angular, Express, Mongoose and Node. Whole stack in TypeScript.
Stars: ✭ 1,261 (+1349.43%)
Mutual labels:  starter-kit, bootstrap
Nodejs Mysql Links
A CRUD Web Application with authentication using Nodejs, Mysql and other Javascript technologies
Stars: ✭ 110 (+26.44%)
Mutual labels:  passport, handlebars
react-isomorphic-bundle
React Redux Universal (isomorphic) bundle
Stars: ✭ 53 (-39.08%)
Mutual labels:  koa, passport
K2
Koa2 API template with passport, GraphQL, flowtype, knex and more.
Stars: ✭ 44 (-49.43%)
Mutual labels:  starter-kit, passport
Koa Passport
Passport middleware for Koa
Stars: ✭ 748 (+759.77%)
Mutual labels:  koa, passport
Laravel Boilerplate
Laravel Boilerplate / Starter Kit with Gentelella Admin Theme
Stars: ✭ 704 (+709.2%)
Mutual labels:  starter-kit, bootstrap
Baumeister
πŸ‘· The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+96.55%)
Mutual labels:  bootstrap, handlebars
Starter Kit
πŸ“¦ Angular 11+ starter kit for enterprise-grade projects
Stars: ✭ 1,102 (+1166.67%)
Mutual labels:  starter-kit, bootstrap
Light Blue Dashboard
πŸ”₯ Free and open-source admin dashboard template built with Bootstrap
Stars: ✭ 110 (+26.44%)
Mutual labels:  bootstrap, handlebars
Generator Ngx Rocket
πŸš€ Extensible Angular 11+ enterprise-grade project generator
Stars: ✭ 1,329 (+1427.59%)
Mutual labels:  starter-kit, bootstrap
Go Api Boilerplate
Go Server/API boilerplate using best practices DDD CQRS ES gRPC
Stars: ✭ 373 (+328.74%)
Mutual labels:  starter-kit, bootstrap
Admin4b
Bootstrap 4 Admin Template
Stars: ✭ 58 (-33.33%)
Mutual labels:  bootstrap, handlebars
Sing App
πŸ’₯Free and open-source admin dashboard template built with Bootstrap 4.5 πŸ’₯
Stars: ✭ 1,187 (+1264.37%)
Mutual labels:  bootstrap, handlebars
Startbootstrap Landing Page
A responsive, Bootstrap landing page template created by Start Bootstrap
Stars: ✭ 1,275 (+1365.52%)
Mutual labels:  bootstrap
Community Modules
Stars: ✭ 1,258 (+1345.98%)
Mutual labels:  bootstrap
Ladda Bootstrap
Ladda buttons concept originally by @hakimel, example using Bootstrap 3 by @msurguy
Stars: ✭ 1,258 (+1345.98%)
Mutual labels:  bootstrap

🐨 koa-starter

A starter kit for a slightly opinionated Koa project.

Opinions

I built this Koa starter kit because there's a number of packages I like to use when starting a new project. The major ones are:

I'm also including goodies from:

Prerequisites

Installation

  • Clone down the repository.
git clone https://github.com/snollygolly/koa-starter.git
  • Install packages (from inside the koa-starter folder).
npm install
  • Create your config. There's a config.example.json file in the root. Edit it to include all your values for the site and your OAuth information. Save it as config.json and leave it in the root.

  • If you want to use Google Analytics, set config.site.analytics to your Tracking ID and make sure the analytics partial (analytics.hbs) contains the correct Universal Analytics tracking code. If you don't want to use Google Analytics, remove that property or set it to false.

  • Start it up.

npm start
  • Enjoy!

Extras

While koa-starter isn't a framework, I've added a few small extras to make getting your project up and started as easy as possible.

Including assets from view rendering

When you render you view, you can use the following properties to link to assets.

  • Scripts: This array contains scripts living in /assets/js that you'd like to link to. The .js will be added for you.
await ctx.render("index", {
  title: config.site.name,
  user: user,
  scripts: ["index", "extra"]
});
  • Vendor JavaScript: This array contains links to external files you'd like to link to. The .js will not be added for you.
await ctx.render("index", {
  title: config.site.name,
  user: user,
  vendor_js: ["http://vendor.com/cdn/lib.min.js"]
});
  • Vendor CSS: This array contains links to external files you'd like to link to. The .css will not be added for you.
await ctx.render("index", {
  title: config.site.name,
  user: user,
  vendor_css: ["http://vendor.com/cdn/lib.min.css"]
});

Error Handling

Thrown errors are caught in the error handling middleware in index.js. By default, all errors will render the error.hbs view with information about the error. It's possible to set ctx.state.api equal to true in the controller to tell the error handling middleware that this route is an API endpoint, and the error should be sent in JSON instead of rendered as a view.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].