Skip to content

Commit 0a16054

Browse files
chore: initialize pnpm workspace and add configuration files
- Created pnpm-workspace.yaml to define package structure. - Added help.js script for common commands usage. - Introduced tsconfig.base.json for TypeScript configuration with strict settings. - Added turbo.json for task management with Turbo.
1 parent eea534f commit 0a16054

92 files changed

Lines changed: 10684 additions & 1 deletion

File tree

Some content is hidden

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

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
SUPABASE_DATABASE_URL=
2+
JWT_SECRET=
3+
JWT_REFRESH_SECRET=
4+
GOOGLE_CLIENT_ID=
5+
GOOGLE_CLIENT_SECRET=
6+
REDIS_URL=
7+
AWS_ACCESS_KEY_ID=
8+
AWS_SECRET_ACCESS_KEY=
9+
AWS_REGION=
10+
S3_BUCKET=

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
with:
18+
version: 10
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: pnpm
25+
26+
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile=false
28+
29+
- name: Lint
30+
run: pnpm lint
31+
32+
- name: Build
33+
run: pnpm build
34+
35+
- name: Test
36+
run: pnpm test

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.pnpm-store
3+
.env
4+
.env.local
5+
dist
6+
.next
7+
coverage

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# FairShare
1+
# FairShare Monorepo
2+
3+
Production-grade scaffold for Expo mobile + NestJS backend + Next.js web placeholder.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
> backend@1.0.0 build D:\ak\project\FairShare\apps\backend
3+
> tsc -p tsconfig.build.json
4+

apps/backend/.turbo/turbo-lint.log

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
> backend@1.0.0 lint D:\ak\project\FairShare\apps\backend
3+
> tsc --noEmit
4+

apps/backend/.turbo/turbo-test.log

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
> backend@1.0.0 test D:\ak\project\FairShare\apps\backend
3+
> jest --runInBand --passWithNoTests
4+
5+
No tests found, exiting with code 0

apps/backend/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM node:20-alpine AS base
2+
WORKDIR /app
3+
RUN corepack enable
4+
5+
FROM base AS deps
6+
COPY package.json pnpm-workspace.yaml turbo.json tsconfig.base.json ./
7+
COPY apps/backend/package.json apps/backend/package.json
8+
COPY packages/shared-types/package.json packages/shared-types/package.json
9+
RUN pnpm install --filter backend... --frozen-lockfile=false
10+
11+
FROM deps AS build
12+
COPY . .
13+
RUN pnpm --filter @fairshare/shared-types build
14+
RUN pnpm --filter backend prisma:generate
15+
RUN pnpm --filter backend build
16+
17+
FROM base AS runner
18+
ENV NODE_ENV=production
19+
COPY --from=build /app/apps/backend/dist ./apps/backend/dist
20+
COPY --from=build /app/apps/backend/package.json ./apps/backend/package.json
21+
COPY --from=build /app/apps/backend/prisma ./apps/backend/prisma
22+
COPY --from=build /app/node_modules ./node_modules
23+
WORKDIR /app/apps/backend
24+
EXPOSE 3001
25+
CMD ["node", "dist/main.js"]

apps/backend/nest-cli.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"deleteOutDir": true
7+
}
8+
}

apps/backend/package.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "backend",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "tsc -p tsconfig.build.json",
7+
"dev": "nest start --watch",
8+
"start": "node dist/main.js",
9+
"lint": "tsc --noEmit",
10+
"test": "jest --runInBand --passWithNoTests",
11+
"prisma:generate": "prisma generate",
12+
"prisma:migrate": "prisma migrate dev"
13+
},
14+
"dependencies": {
15+
"@fairshare/shared-types": "workspace:*",
16+
"@nestjs/common": "^11.0.0",
17+
"@nestjs/config": "^4.0.0",
18+
"@nestjs/core": "^11.0.0",
19+
"@nestjs/jwt": "^11.0.0",
20+
"@nestjs/passport": "^11.0.5",
21+
"@nestjs/platform-express": "^11.0.0",
22+
"@prisma/client": "^6.4.1",
23+
"aws-sdk": "^2.1692.0",
24+
"bcrypt": "^5.1.1",
25+
"class-transformer": "^0.5.1",
26+
"class-validator": "^0.14.1",
27+
"compression": "^1.8.0",
28+
"cookie-parser": "^1.4.7",
29+
"helmet": "^8.0.0",
30+
"ioredis": "^5.4.2",
31+
"passport": "^0.7.0",
32+
"passport-google-oauth20": "^2.0.0",
33+
"passport-jwt": "^4.0.1",
34+
"prisma": "^6.4.1",
35+
"reflect-metadata": "^0.2.2",
36+
"rxjs": "^7.8.1"
37+
},
38+
"devDependencies": {
39+
"@nestjs/cli": "^11.0.0",
40+
"@nestjs/schematics": "^11.0.0",
41+
"@nestjs/testing": "^11.0.0",
42+
"@types/bcrypt": "^5.0.2",
43+
"@types/compression": "^1.7.5",
44+
"@types/cookie-parser": "^1.4.8",
45+
"@types/express": "^5.0.0",
46+
"@types/jest": "^29.5.12",
47+
"@types/node": "^22.10.2",
48+
"@types/passport-google-oauth20": "^2.0.16",
49+
"@types/passport-jwt": "^4.0.1",
50+
"jest": "^29.7.0",
51+
"ts-jest": "^29.2.5",
52+
"ts-node": "^10.9.2",
53+
"typescript": "^5.7.3"
54+
}
55+
}

0 commit comments

Comments
 (0)