Skip to content

Commit 8d86bae

Browse files
committed
ssl off local
0 parents  commit 8d86bae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+13915
-0
lines changed

.github/workflows/deploy.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- name: Checkout Repo
17+
uses: actions/checkout@v4
18+
19+
- name: Deploy
20+
uses: DefangLabs/[email protected]

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Node.js dependencies
2+
node_modules/
3+
4+
# Logs
5+
logs/
6+
*.log
7+
npm-debug.log*
8+
yarn-debug.log*
9+
yarn-error.log*
10+
11+
# Temporary directories
12+
tmp/
13+
temp/
14+
dist/
15+
build/
16+
17+
# Compiled JavaScript
18+
*.d.ts
19+
*.js.map
20+
21+
# Compiled CSS
22+
*.css
23+
*.css.map
24+
25+
# IDE files
26+
.vscode/
27+
.idea/
28+
*.swp
29+
30+
# OS files
31+
.DS_Store
32+
Thumbs.db
33+
34+
# Environment variables
35+
.env
36+
37+
# Coverage reports
38+
coverage/
39+
40+
# Angular specific files
41+
.angular/
42+
.angular-cache/
43+
.sass-cache/
44+
45+
# Generated files
46+
*.class
47+
*.war
48+
*.ear
49+
50+
# NPM lock file
51+
package-lock.json
52+
53+
# Angular build outputs
54+
out-tsc/
55+
aot/
56+
app.out/
57+
vendor/
58+
59+
# Miscellaneous
60+
*.bak
61+
*.orig
62+
.angular
63+
64+
.gitkeep
65+
.editorconfig
66+
.DS_Store

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Angular & Node.js
2+
3+
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-angular-express-template%26template_owner%3DDefangSamples)
4+
5+
This project demonstrates both client-side component rendering and hydration with Angular, as well as server-side rendering with Node.js and Socket.IO for real-time communication. It also includes Docker configurations for easy deployment.
6+
7+
## NOTE
8+
9+
This sample showcases how you could deploy a full-stack application with Angular and Node.js using Defang. The Docker setup ensures the app can be easily built and deployed.
10+
11+
## Essential Setup Files
12+
13+
1. Download [Defang CLI](https://github.com/defang-io/defang)
14+
2. (Optional) If you are using [Defang BYOC](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) authenticated with your AWS account
15+
3. (Optional for local development) [Docker CLI](https://docs.docker.com/engine/install/)
16+
17+
## Prerequisites
18+
19+
1. Download [Defang CLI](https://github.com/defang-io/defang)
20+
2. (Optional) If you are using [Defang BYOC](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html) make sure you have properly authenticated your AWS account
21+
3. [Node.js](https://nodejs.org/en/download/package-manager/)
22+
4. [Angular CLI](https://angular.io/cli)
23+
24+
## A Step-by-Step Guide for deployment
25+
26+
1. Open the terminal and type `defang login`
27+
2. Type `defang compose up` in the CLI
28+
3. Your app should be up and running with Defang in minutes!
29+
30+
## Development
31+
32+
For development, we use two local containers, one for the frontend Angular service and one for the backend service in Express. It also uses Caddy as a web server for serving static files. To run the sample locally after cloning the repository, you can run on Docker by doing:
33+
34+
1. `docker compose -f compose.dev.yaml up`
35+
36+
---
37+
38+
Title: Angular & Node.js
39+
40+
Short Description: A full-stack application using Angular for the frontend and Node.js with Socket.IO for the backend, containerized with Docker.
41+
42+
Tags: Angular, Node.js, Socket.IO, TypeScript, JavaScript
43+
44+
Languages: nodejs

backend/.dockerignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Dependency directories
2+
node_modules
3+
npm-debug.log
4+
5+
# Logs
6+
logs
7+
*.log
8+
9+
# Directory for output files
10+
dist
11+
tmp
12+
13+
# Environmental files
14+
.env
15+
16+
# Optional npm cache directory
17+
.npm
18+
19+
# Optional eslint cache
20+
.eslintcache
21+
22+
# Optional editor config files
23+
.editorconfig
24+
25+
# IDEs and editors
26+
.idea
27+
.vscode
28+
*.sublime*
29+
30+
# OS files
31+
.DS_Store
32+
Thumbs.db
33+
desktop.ini

backend/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use the slim version of Node.js v20 on Debian Bookworm as the base image
2+
FROM node:20-bookworm-slim
3+
4+
# Create and change to the app directory
5+
WORKDIR /app
6+
7+
# Copy application dependency manifests to the container image
8+
COPY package*.json ./
9+
10+
# Install dependencies
11+
RUN npm install
12+
13+
# Copy the local code to the container image
14+
COPY . .
15+
16+
# Expose the port the app runs on
17+
EXPOSE 3000
18+
19+
# Define the command to run your application
20+
CMD ["npm", "start"]

0 commit comments

Comments
 (0)