Skip to content
/ accelerate-starter Public template

An opinionated universal web app + API starter kit to facilitate rapid and scalable development using NextJS, FeathersJS, and MongoDB.

License

Notifications You must be signed in to change notification settings

0xcadams/accelerate-starter

Repository files navigation

An opinionated universal web app + API starter kit to facilitate rapid and scalable development using NextJS, FeathersJS, and MongoDB.

Accelerate is a starter project to enable a team to quickly jump past common hurdles such as user authentication, password resets, unit and integration tests, CI/CD, and tooling to begin solving their core business problems.


Uptime Robot Commitizen friendly MIT license

Getting Started

First, start the MongoDB database using Docker.

docker run --name accelerate-mongo -d -p 27017:27017 mongo

Then, bring up both the web app and API by running:

yarn install
yarn start

This will use lerna to start each service in the packages/ folder.

Web

Also, one can start the web app individually by running:

cd packages/web/
yarn install
yarn start

The web interface is built on NextJS. To learn more about it, visit nextjs.org.

API

Similarly, start the API individually by running:

cd packages/api/
yarn install
yarn start

To learn more about Feathers, visit feathersjs.com or jump right into the Feathers docs.

Project Structure

Further design decisions/walkthrough of project structure is under coming soon...

now secret add accelerate-starter-stage_authentication-secret "*****"
now secret add accelerate-starter-prod_authentication-secret  "*****"

now secret add accelerate-starter-stage_mongodb-url "mongodb+srv://***"
now secret add accelerate-starter-prod_mongodb-url "mongodb+srv://***"

now secret add accelerate-starter-stage_sendgrid-api-key "SG.****"
now secret add accelerate-starter-prod_sendgrid-api-key "SG.****"

now dns add accelerate-starter.com '@' MX mx1.forwardemail.net 10
now dns add accelerate-starter.com '@' MX mx2.forwardemail.net 20
now dns add accelerate-starter.com '@' TXT forward-email=c@cadams.io
now dns add accelerate-starter.com '@' TXT "v=spf1 a mx include:spf.forwardemail.net -all"

Design Decisions

A few points about the cool consequences of decisions made in the design of this project:

Shared Types: Since Typescript is used on the frontend and backend, types are shared across applications via the @lieuu/core module. This means that the contract remains strongly typed and consistent between the API and consumers.

REST Endpoints: The API uses FeathersJS as its backbone - this enables a user to write minimal code to wire Express to make RESTful endpoints - simply add a model, define a new FeathersJS service, and it handles the creation of CRUD operations on that resource. This greatly reduces boilerplate code that needs to be maintained.

NextJS: The frontend is based upon NextJS, which includes a lot of opinion by default. This again reduces the amount of boilerplate code which needs to be maintained - Webpack configuration is minimal, development/building/deployment is easy, and documentation is great.

Automated Tests: The end-to-end tests using Cypress are easy to modify and automatically run against each deployment to ZEIT Now. A comment is left on a PR with a link to the deployment, and the build will fail if the deployment does not pass end-to-end tests. This means significantly less maintenance of a single "staging" environment, but n number of "staging" environments with automated tests to reduce QA overhead.

License

Licensed under the MIT license.