Skip to content

Commit fe977ae

Browse files
authored
feat: Stabilize API server, add docker compose file for testing (#3)
1 parent da3c031 commit fe977ae

Some content is hidden

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

63 files changed

+13535
-5301
lines changed

.dockerignore

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Dependencies
2+
node_modules
3+
npm-debug.log
4+
yarn-debug.log
5+
yarn-error.log
6+
.pnpm-debug.log
7+
.npm
8+
9+
# Build outputs
10+
build
11+
dist
12+
out
13+
.next
14+
.nuxt
15+
.output
16+
coverage
17+
18+
# Version control
19+
.git
20+
.gitignore
21+
.gitattributes
22+
.githooks
23+
.github
24+
25+
# Environment and config
26+
.env
27+
.env.*
28+
.npmrc
29+
.yarnrc
30+
.nvmrc
31+
.editorconfig
32+
*.env.local
33+
*.env.development
34+
*.env.test
35+
*.env.production
36+
37+
# IDE and editors
38+
.idea
39+
.vscode
40+
*.swp
41+
*.swo
42+
.DS_Store
43+
*.sublime-*
44+
.project
45+
.settings
46+
47+
# Logs
48+
logs
49+
*.log
50+
npm-debug.log*
51+
yarn-debug.log*
52+
yarn-error.log*
53+
54+
# Testing
55+
coverage
56+
.nyc_output
57+
test-results
58+
59+
# Misc
60+
.dockerignore
61+
Dockerfile*
62+
docker-compose*
63+
README.md
64+
LICENSE
65+
CHANGELOG.md
66+
.husky
67+
.eslintrc*
68+
.prettierrc*
69+
.stylelintrc*
70+
jest.config.*
71+
*.md
72+
*.yml
73+
*.yaml
74+
!package.json
75+
!package-lock.json
76+
!yarn.lock
77+
!pnpm-lock.yaml

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
10+
permissions:
11+
contents: write
12+
packages: write
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '22'
22+
23+
- name: Install dependencies
24+
run: npm install --dev
25+
26+
- name: Run semantic-release
27+
env:
28+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
29+
REPO_OWNER: "Local-Connectivity-Lab"
30+
REPO_NAME: "ccn-coverage-docker"
31+
TARGET_ARTIFACT_NAME: "ccn-coverage-api"
32+
run: npx semantic-release

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ api-secret
3131
npm-debug.log*
3232
yarn-debug.log*
3333
yarn-error.log*
34+
ccn-coverage-api.log

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "models/ccn-coverage-models"]
2+
path = models/ccn-coverage-models
3+
url = https://github.com/Local-Connectivity-Lab/ccn-coverage-models.git

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.15.0
1+
22.14.0

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"semi": true,
23
"tabWidth": 2,
34
"printWidth": 80,
45
"singleQuote": true,

.releaserc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"plugins": [
6+
[
7+
"@semantic-release/commit-analyzer",
8+
{
9+
"preset": "angular",
10+
"releaseRules": [
11+
{
12+
"type": "feat",
13+
"release": "minor"
14+
},
15+
{
16+
"type": "fix",
17+
"release": "patch"
18+
},
19+
{
20+
"type": "refactor",
21+
"release": "patch"
22+
},
23+
{
24+
"type": "perf",
25+
"release": "patch"
26+
},
27+
{
28+
"type": "build",
29+
"release": "patch"
30+
},
31+
{
32+
"type": "ci",
33+
"release": "patch"
34+
},
35+
{
36+
"type": "chore",
37+
"release": "patch"
38+
},
39+
{
40+
"type": "docs",
41+
"release": "patch"
42+
},
43+
{
44+
"type": "style",
45+
"release": "patch"
46+
}
47+
]
48+
}
49+
],
50+
"@semantic-release/release-notes-generator",
51+
"@semantic-release/git",
52+
"@semantic-release/github"
53+
],
54+
"prepare": [
55+
"@semantic-release/changelog",
56+
"./scripts/publish-version.js",
57+
"@semantic-release/git"
58+
]
59+
}

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ location /api {
1010
proxy_set_header X-Forwarded-For $remote_addr;
1111
proxy_set_header X-Real-IP $remote_addr;
1212
proxy_set_header Host $http_host;
13-
proxy_pass http://localhost:3000;
13+
proxy_pass http://localhost:3000;
1414
}
1515
location /secure {
1616
proxy_set_header X-Forwarded-For $remote_addr;

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Build stage
2+
FROM node:22-alpine AS builder
3+
WORKDIR /usr/src/app
4+
5+
COPY package*.json ./
6+
COPY tsconfig.json ./
7+
8+
RUN npm ci
9+
10+
COPY src src
11+
12+
RUN npm run build
13+
14+
# Production stage
15+
FROM node:22-alpine AS production
16+
17+
WORKDIR /usr/src/app
18+
COPY --from=builder /usr/src/app/package*.json ./
19+
RUN npm ci --production && npm cache clean --force
20+
COPY --from=builder /usr/src/app/build ./build
21+
22+
EXPOSE 3000
23+
24+
CMD ["node", "build/src/index.js"]

0 commit comments

Comments
 (0)