Skip to main content

Deployment Guide

This document outlines the deployment process for the Tower Defense project, from local development to production.

1. Environments

  • Local: Development on a local machine with pnpm nx serve.
  • Staging: Testing environment for quality assurance (QA).
  • Production: Live environment for end-users.

2. Build Process

The project uses Nx for efficient builds. Run the following command to build all applications for production:

# Build all projects
pnpm nx run-many --targets=build --projects=game,api --configuration=production

3. Deployment Strategy

Web Application (Frontend)

The built Angular application is a set of static files. It can be deployed to:

  • GitHub Pages: (Example: pnpm nx deploy game)
  • Vercel / Netlify: Connect the repository and configure the build settings.
  • NGINX: Serve the static files from the /dist directory.

Backend API

The NestJS backend can be deployed as:

  • Docker Container: Build a Docker image and deploy it to a container orchestrator (e.g., Kubernetes, AWS ECS).
  • Bare Metal / VM: Run the compiled JavaScript using pm2 or a systemd service.

4. CI/CD Pipeline

We recommend using GitHub Actions for automated testing and deployment. A typical workflow includes:

  1. Lint & Test: Ensure code quality and correctness.
  2. Build: Generate production-ready assets.
  3. Push: Deploy to the target environment.
info

For more details on our CI/CD setup, refer to the Automated Documentation section.