@shuraim_khan/project-starter
v1.0.5
Published
Project starter scaffold CLI (Frontend + Backend) with configurable backend DB stack and no auto-install.
Downloads
218
Maintainers
Readme
Project Starter (Frontend + Backend)
This starter provides a first-step choice between Frontend and Backend templates.
- Frontend: full frontend template copy from the packaged repository snapshot
- Backend: API starter with selectable DB stack (Prisma/Mongoose + Mongo/SQL)
Dependencies are never auto-installed.
Core foundations included:
- Simple auth APIs
- Minimal Express app structure
- Global error handler with DB logging
- Security middleware stack
- File upload API (local or S3)
- Email service foundation (SendGrid or SMTP)
- Basic WebSocket service foundation
Included APIs
Base path: /api/auth
POST /registerPOST /loginGET /me(Bearer token required)
Base path: /api/file
POST /upload(form-data withfilefield)
Error Logging
All errors are handled globally by the central error middleware and saved in MongoDB using Prisma.
- HTTP request errors are stored with endpoint and method details.
- Process-level errors (
uncaughtException,unhandledRejection) are also stored. - Logs are saved in the
error_logscollection.
Email Service
The project includes a base email service at src/services/email.service.js with two providers:
- SendGrid (
SENDGRID_API_KEY,SENDGRID_FROM_EMAIL) - SMTP (
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS)
WebSocket Structure
The project includes a basic Socket.IO structure at src/services/websocket.service.js.
- Initialized on server startup
- Supports user room join via
join:user - Includes
emitToUser(userId, event, payload)helper
Tech Stack
- Express
- Prisma
- MongoDB
- JWT
- bcrypt
Quick Start
Use As NPM Package
After publishing this package, users can scaffold directly in the current folder with one command:
npx @shuraim_khan/project-starter --name=my-project --type=backend --stack=prisma-mongoThis command:
- asks/sets project name
- asks/sets starter type (frontend/backend)
- configures selected backend stack when backend is selected
- creates starter files directly in current folder
- does not install dependencies automatically
Frontend non-interactive example:
npx @shuraim_khan/project-starter --name=my-frontend --type=frontendSupported stack values:
prisma-mongomongoose-mongoprisma-sql
Supported type values:
frontendbackend
You can also run interactively:
npx @shuraim_khan/project-starterRun the interactive DB stack wizard first:
npm run setup:dbOr run one command (interactive setup):
npm run setup:oneOr full non-interactive one command:
npm run setup:db -- --name=my-project --stack=prisma-mongoSupported stack values:
prisma-mongomongoose-mongoprisma-sql
The wizard will:
- ask for your project name (updates
package.jsonname) - ask for starter type first (frontend/backend)
- ask for DB stack when backend is selected
- generate files directly in the current folder (no new folder is created)
It supports:
- Prisma + MongoDB
- Mongoose + MongoDB
- Prisma + SQL (PostgreSQL)
- Install dependencies
npm install- Create env file
cp .env.example .env- Run app
npm run devEnvironment Variables
PORT=3000
NODE_ENV=development
DATABASE_URL="mongodb://localhost:27017/flowgo"
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=24h
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=us-east-1
AWS_S3_BUCKET=
B2_S3_ENDPOINT=
API_URL=http://localhost:3000Scripts
npm run setup:dbnpm run devnpm start
If you choose a Prisma option in setup, Prisma scripts are added automatically by the setup wizard.
Project Structure
prisma/
schema.prisma
src/
config/
controllers/
middleware/
routes/
services/
utils/
server.js