Skip to content

Commit 4021022

Browse files
committed
Initial commit: React + Express monorepo with Railway CI/CD
1 parent f774c09 commit 4021022

28 files changed

Lines changed: 161 additions & 719 deletions

.dockerignore

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,9 @@
1-
# Dependencies
21
node_modules
3-
*/node_modules
4-
5-
# Build
6-
*/dist
7-
dist/
8-
9-
# Git
2+
dist
103
.git
114
.gitignore
12-
13-
# Documentation
145
*.md
15-
LICENSE
16-
17-
# Environment
186
.env*
19-
!.env.example
20-
21-
# Database
22-
*.db
23-
data/
24-
25-
# Testing
26-
coverage/
27-
*.test.ts
28-
*.test.tsx
29-
30-
# OS
317
.DS_Store
32-
Thumbs.db
33-
34-
# Editor
35-
.vscode/
36-
.idea/
37-
*.swp
38-
39-
# CI/CD
8+
coverage/
409
.github/

.github/workflows/ci.yml

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,49 @@ name: CI
22

33
on:
44
push:
5-
branches: [main, develop]
5+
branches: [main]
66
pull_request:
77
branches: [main]
88

99
jobs:
10-
lint-backend:
11-
name: Lint & Typecheck Backend
10+
backend:
11+
name: Backend
1212
runs-on: ubuntu-latest
1313
defaults:
1414
run:
1515
working-directory: apps/backend
1616
steps:
1717
- uses: actions/checkout@v4
18-
19-
- name: Setup Node.js
20-
uses: actions/setup-node@v4
18+
- uses: actions/setup-node@v4
2119
with:
2220
node-version: "20"
23-
cache: "npm"
24-
cache-dependency-path: apps/backend/package-lock.json
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
29-
- name: Typecheck
30-
run: npm run typecheck
31-
32-
- name: Lint
33-
run: npm run lint
21+
- run: npm install
22+
- run: npm run typecheck
23+
- run: npm run lint
3424

35-
lint-frontend:
36-
name: Lint & Typecheck Frontend
25+
frontend:
26+
name: Frontend
3727
runs-on: ubuntu-latest
3828
defaults:
3929
run:
4030
working-directory: apps/frontend
4131
steps:
4232
- uses: actions/checkout@v4
43-
44-
- name: Setup Node.js
45-
uses: actions/setup-node@v4
33+
- uses: actions/setup-node@v4
4634
with:
4735
node-version: "20"
48-
cache: "npm"
49-
cache-dependency-path: apps/frontend/package-lock.json
50-
51-
- name: Install dependencies
52-
run: npm ci
53-
54-
- name: Typecheck
55-
run: npm run typecheck
56-
57-
- name: Lint
58-
run: npm run lint
36+
- run: npm install
37+
- run: npm run typecheck
38+
- run: npm run lint
39+
40+
docker:
41+
name: Docker Build
42+
runs-on: ubuntu-latest
43+
needs: [backend, frontend]
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: docker/setup-buildx-action@v3
47+
- uses: docker/build-push-action@v5
48+
with:
49+
context: .
50+
push: false

.github/workflows/deploy.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
1-
name: Deploy to Railway
1+
name: Deploy
22

33
on:
44
push:
55
branches: [main]
6-
tags: ["v*"]
76
workflow_dispatch:
87

98
jobs:
109
deploy:
1110
name: Deploy to Railway
1211
runs-on: ubuntu-latest
13-
environment: production
1412
steps:
15-
- name: Checkout repository
16-
uses: actions/checkout@v4
17-
18-
- name: Setup Node.js
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version: "20"
22-
23-
- name: Install Railway CLI
24-
run: npm install -g @railway/cli
25-
26-
- name: Deploy to Railway
13+
- uses: actions/checkout@v4
14+
- run: npm install -g @railway/cli
15+
- run: railway up --detach
2716
env:
2817
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
29-
run: railway up --service="*"

.github/workflows/docker.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: opencode-review
1+
name: OpenCode Review
22

33
on:
44
pull_request:
@@ -8,14 +8,11 @@ jobs:
88
review:
99
runs-on: ubuntu-latest
1010
permissions:
11-
id-token: write
1211
contents: read
1312
pull-requests: write
1413
issues: write
1514
steps:
16-
- uses: actions/checkout@v6
17-
with:
18-
persist-credentials: false
15+
- uses: actions/checkout@v4
1916
- uses: anomalyco/opencode/github@latest
2017
env:
2118
OPENROUTER_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
@@ -26,5 +23,4 @@ jobs:
2623
- Check for code quality issues
2724
- Look for potential bugs
2825
- Suggest improvements
29-
30-
Do NOT make any commits or modify files. Only post review comments.
26+
Do NOT make any commits or modify files. Only post review comments.

.github/workflows/opencode.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: opencode
1+
name: OpenCode
22

33
on:
44
issue_comment:
@@ -9,25 +9,17 @@ on:
99
jobs:
1010
opencode:
1111
if: |
12-
contains(github.event.comment.body, ' /oc') ||
13-
startsWith(github.event.comment.body, '/oc') ||
14-
contains(github.event.comment.body, ' /opencode') ||
15-
startsWith(github.event.comment.body, '/opencode')
12+
contains(github.event.comment.body, '/oc') ||
13+
contains(github.event.comment.body, '/opencode')
1614
runs-on: ubuntu-latest
1715
permissions:
18-
id-token: write
1916
contents: read
2017
pull-requests: read
2118
issues: read
2219
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@v6
25-
with:
26-
persist-credentials: false
27-
28-
- name: Run opencode
29-
uses: anomalyco/opencode/github@latest
20+
- uses: actions/checkout@v4
21+
- uses: anomalyco/opencode/github@latest
3022
env:
3123
OPENROUTER_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
3224
with:
33-
model: openrouter/mistralai/devstral-2512:free
25+
model: openrouter/mistralai/devstral-2512:free

.gitignore

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,9 @@
1-
# Dependencies
21
node_modules/
3-
*/node_modules
4-
*/dist
52
dist/
6-
7-
# Database
8-
*.db
9-
*.db-journal
10-
data/
11-
12-
# Environment
133
.env
144
.env.local
15-
.env.*.local
16-
.env.example
17-
18-
# OS
195
.DS_Store
20-
Thumbs.db
21-
22-
# Logs
23-
logs
246
*.log
25-
npm-debug.log*
26-
pnpm-debug.log*
27-
yarn-debug.log*
28-
yarn-error.log*
29-
30-
# Editor
31-
.vscode/*
32-
!.vscode/extensions.json
33-
.idea
34-
*.swp
35-
*.swo
36-
*~
37-
38-
# Testing
397
coverage/
40-
.nyc_output/
41-
42-
# Build
43-
*.tsbuildinfo
44-
.cache/
8+
.vscode/
9+
.idea/

0 commit comments

Comments
 (0)