Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
941a584
Added mongodb to docker-compose file.
JacobLef Oct 27, 2025
59bf8bd
Added further logging and memory resources to the redis service.
JacobLef Oct 29, 2025
9001616
Initial setup is templated out. Dockerfiles for backend and frontend …
JacobLef Oct 30, 2025
1abe8bd
Docker files have been updated to have the proper context with regard…
JacobLef Oct 31, 2025
8367474
Updated Dockerfiles to have proper context provided to them by the do…
JacobLef Nov 1, 2025
f5d41b4
Updated Ui docker file to appropriately have a dev, production, and b…
JacobLef Nov 2, 2025
0534e2c
Updated API docker file to have production, dev, and builder configur…
JacobLef Nov 2, 2025
00d7a88
Updated docker-compose (prod) file to have proper health checks and c…
JacobLef Nov 2, 2025
d5e0539
Docker files are updated to load using husky git hooks and properly b…
JacobLef Nov 2, 2025
7319e85
Dockerfiles successfully build and all code compiles, ignoring type a…
JacobLef Nov 5, 2025
49a6c92
Fix linting errors in health route.
JacobLef Nov 5, 2025
b65d896
Update scripts to have a caching script for faster builds.
JacobLef Nov 5, 2025
772c5cb
Updated dockerignore file to have only what is needed to ignore and n…
JacobLef Nov 5, 2025
5cc4cda
API configuraiton updated to work with shared compiled version. Front…
JacobLef Nov 9, 2025
1a229e7
Updated shared tsconfig to properly reflect the structure of the fold…
JacobLef Nov 9, 2025
a73a938
Updated shared folder to have proper dev dependencies for mongoose.
JacobLef Nov 10, 2025
b6ea805
Remove mongoose in shared folder to see if that is the issue. Since t…
JacobLef Nov 11, 2025
7125333
Revert back to mongoose types.
JacobLef Nov 11, 2025
84948e8
Updated ui vite.config.ts to have alias pathing for @shared. Updated …
JacobLef Nov 12, 2025
ace0215
Updated docker:dev script to run in detached mode.
JacobLef Nov 13, 2025
1c7bf3d
Updated README.
JacobLef Nov 13, 2025
c62b7b2
Changed configuration files in ui to be .js extension rather than .ts…
JacobLef Nov 13, 2025
fa76ac1
Development container has been updated to work on same port as prod f…
JacobLef Nov 13, 2025
47ff89c
Clarify Docker commands in README
JacobLef Nov 13, 2025
c5d0fe6
Updated boot scripts.
JacobLef Nov 13, 2025
c46f001
Merge branch '195-application-containerization' of https://github.com…
JacobLef Nov 13, 2025
cc56cd3
Updated boot scripts for pnpm, including all health, shell, up and do…
JacobLef Nov 13, 2025
191d491
Updated redis script in README to reflect the changes made in the pnp…
JacobLef Nov 13, 2025
b0428b4
Merge branch 'main' into 195-application-containerization
arath7 Dec 18, 2025
e81d4c4
Merge branch 'main' into 195-application-containerization
arath7 Dec 18, 2025
f01de7d
Merge branch 'main' into 195-application-containerization
arath7 Dec 18, 2025
36b06d7
fixes
arath7 Dec 18, 2025
ce415c2
readme changes and minor fixes
arath7 Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Dependencies
node_modules
**/node_modules
packages/*/node_modules
.pnpm-store

# Build outputs
dist
**/dist
packages/*/dist
build
**/build

# Development files
.env
.env.local
.env.*.local
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*

# Git
.git
.gitignore
.gitattributes

# IDE
.vscode
.idea
*.swp
*.swo
*~
.DS_Store

# Testing
coverage
.nyc_output
**/*.test.ts
**/*.test.js
**/*.spec.ts
**/*.spec.js
test
**/test

# Documentation
README.md
*.md
docs

# CI/CD
.github
.gitlab-ci.yml
.travis.yml

# Docker
Dockerfile*
docker-compose*.yml
.dockerignore

# Misc
.husky
.prettierrc
.prettierignore
.eslintrc*
.eslintignore
tsconfig.tsbuildinfo
98 changes: 85 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,107 @@
# Docker Desktop Download
## Prerequisites

[Docker Desktop Download](https://www.docker.com/products/docker-desktop/)
- [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed and running
- pnpm 8.9.0+ (included via corepack in Docker)
- MongoDB Compass Application

## To Run the Program
## Quick Installation Workflow:

### Install Node Modules
- Install Docker Desktop, make an account, and run
- Install MongoDB Compass, make an account, and add cluster connection string (from .env file)
- Clone Repository locally
- Run in terminal:
- `pnpm install`
- `pnpm dev:build`
- `pnpm dev`
- `pnpm log` (to perform logging of application while running)
- Open the application frontend at http://localhost:5173
- Create an account/log in

## Setup

**Install dependencies (optional for local development):**

```bash
pnpm install
pnpm install
```

### Boot the Infrastructure (Redis Server)
## Development

Start all services in development mode with hot-reload:

```bash
pnpm run dev:infra
pnpm dev
```

### Run the Program
**Services and Ports:**

- Frontend: http://localhost:5173
- API: http://localhost:4000
- Redis: localhost:6379

**View logs:**

```bash
pnpm run dev
pnpm logs # All services
pnpm logs:api # API only
pnpm logs:frontend # Frontend only
```

### Cleanup Docker Infrastructure
## Production

Test the production build locally:

```bash
pnpm run dev:infra:stop
pnpm prod:build
```

### To see if you have a Docker container currently running
**Check health:**

```bash
docker ps
pnpm health
```

## Useful Commands

```bash
pnpm down # Stop all services
pnpm clean # Remove containers, volumes, and cleanup
pnpm redis:cli # Access Redis CLI
pnpm shell:api # Shell into API container
pnpm shell:frontend # Shell into frontend container
```

## Code Quality

```bash
pnpm lint # Check for linting errors
pnpm format # Format code and fix linting issues
```

## Project Structure

```
seitz/
├── packages/
│ ├── api/ # Express backend
│ ├── ui/ # Vue.js frontend
│ └── shared/ # Shared types/utilities
├── docker-compose.yml # Production configuration
├── docker-compose.dev.yml # Development configuration
└── package.json # Root package scripts
```

## Troubleshooting

**Containers won't start:**

```bash
pnpm clean
pnpm dev:build
```

**Port conflicts:**
Make sure ports 4000, 5173, and 6379 are not in use by other applications.

**Environment variables not loading:**
Ensure `.env` file exists in the root directory with all required variables.
74 changes: 74 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
services:
api:
build:
context: .
dockerfile: ./packages/api/Dockerfile
target: development
environment:
- NODE_ENV=development
- DEBUG=*
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_URL=redis://redis:6379
- MONGO_URL=${MONGO_URL}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- JWT_SECRET=${JWT_SECRET}
- SESSION_SECRET=${SESSION_SECRET}
volumes:
- ./packages/api/src:/app/packages/api/src
- /app/packages/api/node_modules
- ./packages/api/tsconfig.json:/app/packages/api/tsconfig.json
- ./packages/api/package.json:/app/packages/api/package.json
ports:
- "4000:4000"
- "9229:9229"
depends_on:
redis:
condition: service_healthy
networks:
- seitz-network
frontend:
build:
context: .
dockerfile: ./packages/ui/Dockerfile
target: development
environment:
- NODE_ENV=development
- VITE_API_URL=http://localhost:4000
volumes:
- ./packages/ui/src:/app/packages/ui/src
- ./packages/ui/public:/app/packages/ui/public
- ./packages/ui/index.html:/app/packages/ui/index.html
- ./packages/ui/vite.config.ts:/app/packages/ui/vite.config.ts
- ./packages/ui/tailwind.config.js:/app/packages/ui/tailwind.config.js
- ./packages/ui/postcss.config.js:/app/packages/ui/postcss.config.js
- ./packages/ui/tsconfig.json:/app/packages/ui/tsconfig.json
- ./packages/ui/package.json:/app/packages/ui/package.json
- /app/packages/ui/node_modules
ports:
- "5173:5173"
depends_on:
- api
networks:
- seitz-network
redis:
image: redis:7-alpine
container_name: seitz-redis-dev
ports:
- "6379:6379"
volumes:
- redis_data_dev:/data
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
- seitz-network
volumes:
redis_data_dev:
networks:
seitz-network:
driver: bridge
85 changes: 84 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,95 @@
# This file is generally speaking a placeholder for once the project is deployed on the cloud
# The productin containers and images should be placed on the cloud using this configuration, with
# the locally hosted URLS replaced with the registered ones, as well as added configurations for
# cookies and authentication (locally, we work with http and not https)
services:
redis:
image: redis:7-alpine
container_name: seitz-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --appendonly yes
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
networks:
- seitz-network

api:
build:
context: .
dockerfile: ./packages/api/Dockerfile
target: production
container_name: seitz-api
restart: unless-stopped
ports:
- "4000:4000"
depends_on:
redis:
condition: service_healthy
environment:
- NODE_ENV=production
- PORT=4000
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_URL=redis://redis:6379
- MONGO_URL=${MONGO_URL}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
- JWT_SECRET=${JWT_SECRET}
- SESSION_SECRET=${SESSION_SECRET}
networks:
- seitz-network
healthcheck:
test:
[
"CMD-SHELL",
'node -e "require(''http'').get(''http://localhost:4000/health/ready'', (res) => { process.exit(res.statusCode === 200 ? 0 : 1); });"',
]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s

frontend:
build:
context: .
dockerfile: ./packages/ui/Dockerfile
target: production
args:
- API_URL=${API_URL:-http://localhost:4000}
container_name: seitz-frontend
restart: unless-stopped
ports:
- "5173:5173"
depends_on:
api:
condition: service_healthy
networks:
- seitz-network
healthcheck:
test: [
"CMD",
"wget",
"--no-verbose",
"--tries=1",
"--spider",
"http://localhost:5173", # needs to be updated to DN once registered
]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s

volumes:
redis_data:
driver: local

networks:
seitz-network:
driver: bridge
19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,25 @@
"prettier:fix": "prettier . --write",
"format": "pnpm prettier:fix && pnpm lint:fix",
"prepare": "husky install",
"dev": "pnpm --stream -r dev",
"dev:infra": "docker-compose up -d redis",
"dev:infra:stop": "docker-compose down redis"
"prod": "docker compose up -d",
"prod:build": "docker compose up --build -d",
"dev": "docker compose -f docker-compose.dev.yml up -d",
"dev:build": "docker compose -f docker-compose.dev.yml up --build -d",
"down": "docker compose down",
"logs": "docker compose logs -f",
"logs:api": "docker compose logs -f api",
"logs:frontend": "docker compose logs -f frontend",
"clean": "docker compose down -v && docker system prune -f",
"restart": "docker compose restart",
"health": "curl -s http://localhost:4000/health | jq '.' && curl -s http://localhost:5173 > /dev/null && echo 'Frontend is healthy' || echo 'Health check failed'",
"redis:cli": "docker compose exec redis redis-cli",
"shell:api": "docker compose exec api sh",
"shell:frontend": "docker compose exec frontend sh",
"shell:redis": "docker compose exec redis sh"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@sendgrid/mail": "^8.1.1",
"@types/redis": "^4.0.10",
"mongoose": "^7.5.2",
"prettier": "3.0.3",
"redis": "^5.8.2",
Expand Down
Loading