Skip to content

chyzwar/modern-stack

Repository files navigation

Github Actions

Modern Stack

Boilerplate for full-stack typescript project. Create React App + Fastify API in monorepo.

Prerequisites

This project require number of tools available.

Getting started

Repo provides an init script that will bootstrap baseline env files It will check if the user has docker and docker-compose installed. For OAuth to work, google and facebook configs need to updated in packages/api .env

Clone repository

git clone https://github.com/chyzwar/modern-stack.git my-project
cd my-project

Initialize env

yarn initialize

Start project

yarn start

You can now visit: http://project.localhost

Setup auth provider(optional)

Update packages/api/.env with client id and client secrets

What is included

API

Based on fastify. It is a modern node.js framework with a good ecosystem of plugins. Postgres is used for database and managed by Sequelize ORM.

  • migration and seeding with sequelize
  • authentication with JWT and cookies
  • integration with oauth2: Google, Facebook
  • logging with pino
  • hot reload with nodemon

UI

Standard typescript application based on create-react-app. Basic authentication under /login. Use Material-UI for Login page and react-router for frontend routes.

  • material-ui components
  • react-router routing
  • basic auth integration

There is also a secondary UI application admin-ui. There is not much done beside bootstrap. It can be removed or used for the different business use case.

Testing

Unit testing is provided by Jest. There few test examples (not enough). For API test there are an example of testing leveraging fastify http injection

CI/CD

The project provides basic automation pipeline using Github actions. Dependabot scan weekly for outdated packages and creates automatic PRs.

Tools

Project use yarn workspaces to support hoisting dependencies and managing packages in monorepo. Husky and lint staged provide baseline git hooks. ESlint is configured with more strict airbnb config. Project will is configured with docker-compose to manage multiple containers.

TODO

  • Add classic auth (login + password)
  • E2E tests setup using cypress
  • Deployment strategy AWS ECS/Fargate/Zeit
  • Audit security settings JWT/Cookies/Headers
  • Create an basic admin application

About

Modern Javascript project boilerplate: Fastify, Create React App, Typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •