Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 18 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
ref: ${{ github.event.pull_request.head.sha }}


- name: Detect changed files
id: detect
Expand Down Expand Up @@ -55,25 +55,27 @@ jobs:
with:
node-version: 22

- uses: pnpm/action-setup@v6.0.8
- name: Install shared dependencies
run: npm --prefix packages/shared install

- run: pnpm install
- name: Install backend dependencies
run: npm --prefix apps/backend install

- name: Backend lint
id: backend_lint
continue-on-error: true
run: cd apps/backend && pnpm eslint ${{ needs.detect-changes.outputs.backendFiles }}
run: cd apps/backend && npx eslint ${{ needs.detect-changes.outputs.backendFiles }}

- name: Backend test
id: backend_test
if: needs.detect-changes.outputs.backendTestFiles != ''
continue-on-error: true
run: cd apps/backend && pnpm test --passWithNoTests ${{ needs.detect-changes.outputs.backendTestFiles }}
run: npm --prefix apps/backend run test -- --passWithNoTests ${{ needs.detect-changes.outputs.backendTestFiles }}

- name: Backend typecheck
id: backend_typecheck
continue-on-error: true
run: cd apps/backend && pnpm typecheck
run: npm --prefix apps/backend run typecheck

- name: Fail job if any check failed
if: >
Expand All @@ -100,19 +102,18 @@ jobs:
with:
node-version: 22

- uses: pnpm/action-setup@v6.0.8

- run: pnpm install
- name: Install web dependencies
run: npm --prefix apps/web install

- name: Web check
id: web_check
continue-on-error: true
run: cd apps/web && pnpm check
run: npm --prefix apps/web run lint

- name: Web build
id: web_build
continue-on-error: true
run: cd apps/web && pnpm build
run: npm --prefix apps/web run build

- name: Fail job if any check failed
if: >
Expand All @@ -138,20 +139,22 @@ jobs:
with:
node-version: 22

- uses: pnpm/action-setup@v6.0.8
- name: Install shared dependencies
run: npm --prefix packages/shared install

- run: pnpm install
- name: Install mobile dependencies
run: npm --prefix apps/mobile install

- name: Mobile lint
id: mobile_lint
continue-on-error: true
run: cd apps/mobile && pnpm eslint ${{ needs.detect-changes.outputs.mobileFiles }}
run: cd apps/mobile && npx eslint ${{ needs.detect-changes.outputs.mobileFiles }}

- name: Mobile test
id: mobile_test
if: needs.detect-changes.outputs.mobileTestFiles != ''
continue-on-error: true
run: cd apps/mobile && pnpm test --passWithNoTests ${{ needs.detect-changes.outputs.mobileTestFiles }}
run: npm --prefix apps/mobile run test -- --passWithNoTests ${{ needs.detect-changes.outputs.mobileTestFiles }}

- name: Fail job if any check failed
if: >
Expand Down
34 changes: 19 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
### Prerequisites

- **Node.js** >= 20
- **pnpm** >= 9
- **npm** >= 10 (bundled with Node.js)
- **Docker** & Docker Compose
- **React Native** dev environment — follow the [official setup guide](https://reactnative.dev/docs/environment-setup)

Expand All @@ -25,7 +25,11 @@ git clone https://github.com/Dev-Card/DevCard.git
cd devcard

# 2. Install dependencies
pnpm install
npm install # root (orchestrator)
npm --prefix packages/shared install # shared types/utils
npm --prefix apps/backend install # backend API
npm --prefix apps/web install # web app
npm --prefix apps/mobile install # mobile app (if working on mobile)

# 3. Start PostgreSQL + Redis
docker compose up -d
Expand All @@ -35,34 +39,34 @@ cp .env.example .env
# Edit .env with your OAuth credentials

# 5. Run database migrations and seed
pnpm db:migrate
pnpm db:seed
npm run db:migrate
npm run db:seed

# 6. Start development
pnpm dev:backend # Backend API on :3000
pnpm dev:mobile # React Native app
npm run dev:backend # Backend API on :3000
npm run dev:mobile # React Native app
```

### Running Tests

This project uses `pnpm` to run tests across different parts of the codebase.
This project uses `npm` to run tests across different parts of the codebase.

#### Run all tests
To execute all available tests:
To execute backend tests:
```bash
pnpm -r test
npm run test
```

#### apps/backend
The backend uses Vitest:
```bash
pnpm --filter @devcard/backend test
pnpm --filter @devcard/backend test:watch
npm --prefix apps/backend run test
npm --prefix apps/backend run test:watch
```
#### apps/mobile
The mobile app uses Jest:
```bash
pnpm --filter @devcard/mobile test
npm --prefix apps/mobile run test
```
#### apps/web
Currently, the web app does not define a test script.
Expand All @@ -84,16 +88,16 @@ devcard/
## Coding Standards

- **TypeScript** for all new code
- **ESLint + Prettier** for formatting (run `pnpm lint` before committing)
- **ESLint + Prettier** for formatting (run `npm run lint` before committing)
- **Conventional Commits** for commit messages (`feat:`, `fix:`, `docs:`, `chore:`)
- Write tests for new features and bug fixes

## Pull Request Process

1. Create a feature branch from `main`: `git checkout -b feat/your-feature`
2. Make your changes with clear, descriptive commits
3. Ensure all tests pass: `pnpm test`
4. Ensure linting passes: `pnpm lint`
3. Ensure all tests pass: `npm run test`
4. Ensure linting passes: `npm run lint`
5. Open a PR against `main` with a clear description of the change
6. Wait for review — maintainers will respond within 48 hours

Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ Each exchange is manual, error-prone, and slow. DevCard fixes this.

### Prerequisites

- Node.js >= 20
- pnpm >= 9
- Node.js >= 20 (includes npm)
- Docker & Docker Compose
- React Native development environment ([setup guide](https://reactnative.dev/docs/environment-setup))

Expand All @@ -65,7 +64,11 @@ git clone https://github.com/Dev-Card/DevCard.git
cd devcard

# Install dependencies
pnpm install
npm install # root orchestrator
npm --prefix packages/shared install # shared types/utils
npm --prefix apps/backend install # backend API
npm --prefix apps/web install # web app
npm --prefix apps/mobile install # mobile app (if needed)

# Start infrastructure (PostgreSQL + Redis)
docker compose up -d
Expand All @@ -79,30 +82,30 @@ cp .env.example .env
# Paste the generated values into your .env file. Never use placeholders in production.

# Run database migrations
pnpm db:migrate
npm run db:migrate

# Seed sample data
pnpm db:seed
npm run db:seed

# Start the backend
pnpm dev:backend
npm run dev:backend

# In another terminal — start the mobile app
pnpm dev:mobile
npm run dev:mobile
```

## Architecture

```
devcard/
├── apps/
│ ├── backend/ # Fastify + TypeScript API
│ ├── mobile/ # React Native (Bare) mobile app
│ └── web/ # SvelteKit web backup
│ ├── backend/ # Fastify + TypeScript API (independent npm)
│ ├── mobile/ # React Native (Bare) mobile app (independent npm)
│ └── web/ # Vite + React web app (independent npm)
├── packages/
│ └── shared/ # Shared types, platform registry, utils
├── docker-compose.yml # PostgreSQL + Redis
└── pnpm-workspace.yaml # Monorepo config
└── package.json # Root orchestrator (npm scripts)
```

### Tech Stack
Expand Down
Loading
Loading