Skip to content

Commit 55bbb94

Browse files
committed
first commit
0 parents  commit 55bbb94

68 files changed

Lines changed: 10231 additions & 0 deletions

Some content is hidden

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

.github/workflows/ci.yml

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

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
node_modules/
2+
dist/
3+
coverage/
4+
.DS_Store
5+
.env
6+
.env.*
7+
!.env.template
8+
!.env.example
9+
!.env.*.example
10+
npm-debug.log*
11+

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Developer Chat App
2+
3+
Monorepo bootstrap for the MVP.
4+
5+
## Workspace Layout
6+
7+
- `apps/frontend` — web UI foundation
8+
- `apps/backend` — API foundation
9+
- `apps/electron` — desktop shell foundation
10+
11+
## Commands
12+
13+
- `npm run lint` — lint all workspaces
14+
- `npm run test` — run tests in all workspaces
15+
- `npm run build` — build all workspaces
16+
17+
## Run Locally (UI + Backend)
18+
19+
- Install dependencies: `npm install`
20+
- Start backend + frontend together: `npm run dev`
21+
- Frontend URL: `http://localhost:5173`
22+
- Backend URL: `http://localhost:4000`
23+
24+
### Optional Single-Service Commands
25+
26+
- Backend only: `npm run dev:backend`
27+
- Frontend only: `npm run dev:frontend`
28+
29+
## Environment Strategy (dev/staging/prod)
30+
31+
- Backend loads `.env` and then `.env.{APP_ENV}` (`development` by default).
32+
- Prisma uses the same strategy through `apps/backend/prisma.config.ts`.
33+
- Use these example files as templates:
34+
- `apps/backend/.env.example`
35+
- `apps/backend/.env.development.example`
36+
- `apps/backend/.env.staging.example`
37+
- `apps/backend/.env.production.example`
38+
- `apps/frontend/.env.example`
39+
- `apps/electron/.env.example`
40+
- Set `APP_ENV` to one of: `development`, `staging`, `production`.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
APP_ENV=development
2+
DATABASE_URL="file:./dev.db"
3+
PORT="4000"
4+
AUTH_SECRET="dev-auth-secret"
5+
GITHUB_CLIENT_ID=""
6+
GITHUB_CLIENT_SECRET=""
7+
JWT_MAX_AGE_SECONDS="2592000"
8+
SESSION_MAX_AGE_SECONDS="604800"
9+
SESSION_UPDATE_AGE_SECONDS="86400"
10+
ENCRYPTION_KEY="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
11+
WEB_BASE_URL="http://localhost:3000"

apps/backend/.env.example

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
APP_ENV=development
2+
DATABASE_URL="file:./dev.db"
3+
PORT="4000"
4+
AUTH_SECRET="change-me"
5+
GITHUB_CLIENT_ID=""
6+
GITHUB_CLIENT_SECRET=""
7+
JWT_SECRET=""
8+
JWT_MAX_AGE_SECONDS="2592000"
9+
SESSION_MAX_AGE_SECONDS="604800"
10+
SESSION_UPDATE_AGE_SECONDS="86400"
11+
ENCRYPTION_KEY="0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
12+
WEB_BASE_URL="http://localhost:3000"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APP_ENV=production
2+
DATABASE_URL="file:./prod.db"
3+
WEB_BASE_URL="https://app.example.com"

apps/backend/.env.staging.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APP_ENV=staging
2+
DATABASE_URL="file:./staging.db"
3+
WEB_BASE_URL="https://staging.example.com"

apps/backend/.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DATABASE_URL="file:./dev.db"

apps/backend/dev.db

144 KB
Binary file not shown.

apps/backend/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "@devchat/backend",
3+
"version": "0.1.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"dev": "tsx watch src/main.ts",
8+
"start": "node dist/main.js",
9+
"lint": "eslint src --ext .ts",
10+
"test": "vitest run",
11+
"build": "tsc -p tsconfig.json",
12+
"db:generate": "prisma generate",
13+
"db:migrate": "prisma migrate dev",
14+
"db:studio": "prisma studio"
15+
},
16+
"dependencies": {
17+
"@auth/core": "^0.41.1",
18+
"@auth/express": "^0.12.1",
19+
"@auth/prisma-adapter": "^2.11.1",
20+
"@prisma/adapter-libsql": "^7.4.0",
21+
"@prisma/client": "^7.4.0",
22+
"cors": "^2.8.5",
23+
"dotenv": "^17.3.1",
24+
"express": "^5.2.1"
25+
},
26+
"devDependencies": {
27+
"@types/express": "^5.0.6",
28+
"prisma": "^7.4.0",
29+
"tsx": "^4.20.5"
30+
}
31+
}

0 commit comments

Comments
 (0)