- Runtime: Node.js
- Language: TypeScript
- Server Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: Better Auth
- Validation: Zod
This project uses pnpm as the package manager.
-
Install pnpm if you haven't already:
npm install -g pnpm
-
Install dependencies:
pnpm install
-
Initialize db for auth:
pnpm run auth-db-generate
Available pnpm scripts for development and deployment:
pnpm run build- Compiles TypeScript source files to JavaScript in thedistdirectorypnpm run start- Runs the compiled application fromdist/index.jspnpm run build-n-start- Builds the project and then starts the applicationpnpm run dev- Runs the application in development mode with file watching usingtsx
This project uses the #src alias for clean import paths throughout the codebase.
Development (TypeScript compilation):
tsconfig.jsonmaps"#src/*": ["./src/*.js"]incompilerOptions.paths- Enables TypeScript to resolve imports like
import { env } from "#src/config/env"
Runtime (Node.js):
package.jsonmaps"#src/*": "./dist/*.js"in theimportsfield- Allows the compiled JavaScript to resolve paths to the built
distdirectory
// Instead of: import { env } from "../../config/env"
// Use: import { env } from "#src/config/env"
import { env } from "#src/config/env";This setup provides clean, consistent imports while supporting both development and production environments.