Skip to content

wgd3/full-stack-todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Full Stack To-Do

This repository contains the code base that corresponds to a series of blog posts on full stack development. Check it out here: Full Stack Development Series

MIT License Commitizen friendly Quality Gate Status codecov semantic-release styled with prettier

Features

Backend - server

  • NestJS 9
  • REST API with Swagger documentation
  • JWT authentication support
  • TypeORM for support of various database varieties

Frontend - client

  • Angular 16
  • User registration/login
  • Stateless UI
  • Storybook integration for component development
  • Custom Design Library
  • Modular State Management (toggled via InjectionTokens)

Testing

  • Jest for backend unit testing, and supertest for integration testing
  • Jest for Angular unit tests
  • Cypess + Storybook for UI integration Testing
  • > 90% code coverage

Other

  • Kubernetes manifests for cluster deployment
  • Dockerfiles for standalone and docker-compose support
  • GitHub Actions used for all testing, building, and releasing
  • Nx v16 monorepo used for clean directory structure and Nx Cloud for distributed CI tasks

Demo

As part of the Deployment Blog Post I added a small overview on deploying this application stack to Render. Both the UI and the REST API docs can be found here:

Application
Client https://fst-demo-client.onrender.com/
Server https://fst-demo-server.onrender.com/api/v1

Note Render's free tier spins down these application after they have idled for a while - it can take up to 30 seconds for the applications to spin back up!

Environment Variables

To run this project, you will need to copy the .env.sample file in the repository root, rename it .env and fill out the values accordingly:

Variable Description/Values
DATABASE_TYPE Passed to TypeORM, supports most major SQL-based databases
DATABASE_HOST Unneeded if using SQLite, can be used with remote databases or local Docker instances
DATABASE_PORT
DATABASE_USERNAME
DATABASE_PASSWORD
DATABASE_NAME
DATABASE_PATH Only used with SQLite for relative file path
JWT_SECRET String used to sign JWTs generated by the API
JWT_ACCESS_TOKEN_EXPIRES_IN Time in seconds that access tokens are valid

Run Locally

Clone the project

  git clone https://github.com/wgd3/full-stack-todo

Go to the project directory

  cd full-stack-todo

Install dependencies

  npm install

Set up environment file

  cp .env.sample .env

Start the server

  npx nx run-many --target=serve --all

Running Tests

To run tests, run the following command

  # for unit tests
  npx nx run-many --target=test --all --codeCoverage

  # for E2E tests
  npx nx run-many --target=e2e --all