Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
28e45db
deactivate main deploy workflow
lxorb Mar 10, 2025
62c1459
remove deployMain github action
lxorb Mar 10, 2025
d76b8a3
potential gh actions checks fix
lxorb Mar 10, 2025
fdc9b50
switch to pnpm for gh actions tests
lxorb Mar 10, 2025
4b1bd27
update gh actions step package references, add pnpm installation
lxorb Mar 10, 2025
5ef8994
remove pnpm caching
lxorb Mar 10, 2025
99f1979
change jest config file extension to mjs
lxorb Mar 10, 2025
c4cb879
change package json type to module
lxorb Mar 10, 2025
9d41166
Revert "change package json type to module"
lxorb Mar 10, 2025
743b6a4
bump node version
lxorb Mar 10, 2025
3ec9497
add git submodule initialization
lxorb Mar 10, 2025
474b1c5
switch to builtin submodule initialization
lxorb Mar 10, 2025
5310ae8
add token for submodule init
lxorb Mar 10, 2025
2bf866f
add gh actions ls and pwd for testing
lxorb Mar 10, 2025
3f8ca40
list node_modules/.pnpm/ during gh actions
lxorb Mar 10, 2025
33ee32c
change pnpm intallation method
lxorb Mar 10, 2025
85f8a56
modify pnpm package installations
lxorb Mar 10, 2025
a436785
desperate
lxorb Mar 10, 2025
f3b716c
modify test.yml
lxorb Mar 10, 2025
ebbc6a2
insert an a
lxorb Mar 10, 2025
3b8d8a7
insert a y
lxorb Mar 10, 2025
093dfa1
fallback pnpm
lxorb Mar 10, 2025
581736d
fix tutorial bugs
Servant-of-Scietia Mar 16, 2025
feefdd2
fix project creation
lxorb Mar 22, 2025
b392fe6
Merge branch 'pre-development' into development
lxorb Mar 22, 2025
07448e2
fix tests
lxorb Mar 22, 2025
f5f66ce
update tutoial creation scripts
lxorb Mar 26, 2025
dc836a5
move webhook urls into .env
lxorb Apr 18, 2025
e70b68a
fix vulnerabilities
lxorb Apr 18, 2025
4d52fcb
fix pnpm-workspace
lxorb Apr 19, 2025
db4d542
Update app.ts
alessioc42 Jul 22, 2025
798604c
Merge pull request #102 from Neurologism/alessioC42-patch-1
lxorb Jul 22, 2025
af16a43
update gitignore to include .idea
lxorb Feb 6, 2026
27ddb32
update dependencies, fix small bug
lxorb Feb 6, 2026
3d4a4a5
rewrite readme, small fixes
lxorb Feb 6, 2026
5b29644
disable pre-push tests
lxorb Feb 6, 2026
dc95d1b
Merge main into development
lxorb Feb 6, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/deployDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:

- name: Deploy to server
run: |
ssh -o StrictHostKeyChecking=no gh-actions@ssh.icinoxis.net -p 22137 'bash -s' < ./scripts/deployDevNestjs.sh
ssh -o StrictHostKeyChecking=no -p ${{ secrets.AZURE_SSH_PORT }} ${{ secrets.AZURE_SSH_USER }}@${{ secrets.AZURE_SSH_HOST }} 'bash -s' < ./scripts/deployDevNestjs.sh
2 changes: 1 addition & 1 deletion .github/workflows/deployMain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:

- name: Deploy to server
run: |
ssh -o StrictHostKeyChecking=no brainet@142.93.175.194 'bash -s' < ./scripts/deployMainNestjs.sh
ssh -o StrictHostKeyChecking=no -p ${{ secrets.AZURE_SSH_PORT }} ${{ secrets.AZURE_SSH_USER }}@${{ secrets.AZURE_SSH_HOST }} 'bash -s' < ./scripts/deployMainNestjs.sh
35 changes: 28 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,41 @@ jobs:
options: --health-cmd="exit 0" # Disable health check to avoid flakiness
ports:
- 27017:27017
timeout: 300s # Increase timeout

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GH_PAT }}

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
node-version: '14'
version: 9

- name: Install dependencies
run: npm install
run: pnpm install --force

# - name: approve builds
# run: pnpm approve-builds <<< a <<< y

- name: pwd
run: pwd

- name: ls
run: ls node_modules

- name: ls
run: ls node_modules/.pnpm/

- name: Run tests
run: npm test
retry: 3 # Add retry logic
run: pnpm test

- name: Test build
run: pnpm build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# custom
.vscode/
dataStorage/
.idea

# Logs
logs
Expand Down
6 changes: 5 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
jest --bail
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Disabled pre-push tests.
exit 0
128 changes: 112 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,120 @@
# Backmind

Backmind is the API backend for the Whitemind product. It is built with
NestJS, Fastify, and MongoDB and provides authentication, projects, tasks,
tutorials, and user features.

## Quick start

```sh
npm install
npm start dev
pnpm install
pnpm dev
```

Beispiel für .env:
The server starts on `http://localhost:3000` by default.

## Requirements

- Node.js 20+ (LTS recommended)
- pnpm
- MongoDB (Atlas or local)

## Configuration

Backmind reads configuration from `.env`. Use the values below as a starting
point and update secrets for your environment.

```sh
MONGO_URI='mongodb://user:password@host'
SENDGRID_API_KEY='SG.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
BACKMIND_HOSTNAME='http://localhost:3000/'
WHITEMIND_HOSTNAME='http://localhost:8000/'
JWT_TOKEN_EXPIRE_IN="24h"
DB_NAME="backmind-dev"
JWT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
SEND_ERR_TO_CLIENT="true"
LOG_LEVEL="debug"
NODE_ENV="development"
DISABLE_ACCOUNT_CREATION="false"
VERIFY_ALL_EMAILS="true"
MAX_PFP_SIZE="1024"
# Core
MONGO_URI=mongodb://user:password@host
DB_NAME=backmind-dev
NODE_ENV=development
HOST=0.0.0.0
PORT=3000

# Auth
JWT_SECRET=change_me
JWT_TOKEN_EXPIRE_IN=24h
SECRET_KEY=change_me
SALT_ROUNDS=10
MIN_PASS_LENGTH=6

# Account / limits
VERIFY_ALL_EMAILS=true
DISABLE_ACCOUNT_CREATION=false
MAX_TOKENS=5
RATE_LIMIT_DURATION=5
RATE_LIMIT_REQUESTS=1000

# Email / notifications
SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EMAIL_VERIFICATION_TOKEN_VALID_MINUTES=60

# App URLs
BACKMIND_HOSTNAME=http://localhost:3000/
WHITEMIND_HOSTNAME=http://localhost:8000/

# Files
FILES_DIRECTORY=./dataStorage
PFP_DIRECTORY=./dataStorage/pfp
MODEL_DIRECTORY=./dataStorage/model

# Logging
LOG_LEVEL=debug
DISCORD_LOGGING=true
SEND_ERR_TO_CLIENT=true

# Dev helpers
RESET_DB=
WRITE_PROJECT_JSON=false
```

Notes:

- `SECRET_KEY` is used by `@fastify/secure-session` and must decode to 32 bytes
if provided as base64.
- `JWT_SECRET` and `SECRET_KEY` should be unique per environment.

## Common scripts

```sh
pnpm dev # Run in watch mode
pnpm build # Build to dist/
pnpm test # Run tests
pnpm lint # Lint and auto-fix
pnpm dropDb # Drop the database (see scripts/dropDb.js)
pnpm createTutorials # Seed tutorials (requires TutorMind data)
```

## Seeding tutorials

Tutorial data lives in the `TutorMind` submodule. Ensure it is available
before running:

```sh
pnpm createTutorials
```

If the submodule is private, clone it with appropriate credentials.

## Deployment

GitHub Actions workflows live in `.github/workflows/` and deploy via SSH by
running the scripts in `scripts/`.

- `scripts/deployMainNestjs.sh`
- `scripts/deployDevNestjs.sh`

These scripts install dependencies, build, and restart the server.

## Tech stack

- NestJS
- Fastify
- Mongoose
- JWT auth
- SendGrid

## License

UNLICENSED
File renamed without changes.
Loading
Loading