An opinionated universal web app + API starter kit to facilitate rapid and scalable development using NextJS, FeathersJS, and MongoDB.
NextJS, React, React Redux, Redux Saga, Material UI, and Babel
API
FeathersJS, Mongoose, Nodemon, Express, and Winston
Testing
Cypress, Mocha, Enzyme, Chai.
Tooling
Typescript, TSLint (Based on Airbnb), Prettier, Lerna, Commitizen, and Commitlint
Hosting
Zeit Now
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.
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.
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.
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"
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.
Licensed under the MIT license.