https://github.com/nazmul-nhb/test-school-server
Server for Test School
https://github.com/nazmul-nhb/test-school-server
assesment express lms mongoose nhb-express nhb-scripts nhb-toolbox school server test typescript
Last synced: 29 days ago
JSON representation
Server for Test School
- Host: GitHub
- URL: https://github.com/nazmul-nhb/test-school-server
- Owner: nazmul-nhb
- Created: 2025-08-08T09:47:59.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-16T15:25:08.000Z (10 months ago)
- Last Synced: 2025-12-26T06:53:48.926Z (6 months ago)
- Topics: assesment, express, lms, mongoose, nhb-express, nhb-scripts, nhb-toolbox, school, server, test, typescript
- Language: TypeScript
- Homepage: https://test-school-server.vercel.app
- Size: 612 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π Express TypeScript Mongoose Server
Bootstrapped with [**nhb-express**](https://www.npmjs.com/package/nhb-express)
---
## π¦ Features
- β
**TypeScript** with `ts-node` and `nodemon` for development and pre-configured `tsconfig.json`
- β
**Express.js** preβconfigured with custom middlewares
- β
**Zod** for schema validation
- β
**Mongoose** for MongoDB integration
- β
**Chalk** for colorful logging
- β
**[nhb-scripts](https://www.npmjs.com/package/nhb-scripts)** for easy build, commit, module scaffolding, formatting, linting, and more. [see below](#οΈ-scripts)
- β
**Scaffolding via CLI** β choose package manager, DB, etc.
- β
Builtβin [**CI/CD workflow**](#οΈ-cicd-workflow) for automatic deployment to Vercel
- β
Preβset configs for ESLint, Prettier, and `nhb-scripts`
---
## π Development
Install dependencies (already done by `nhb-express` scaffold)
Run in development mode:
```bash
pnpm dev # or npm run dev / yarn dev
# Runs on port: 4242
```
---
## π Structure
```text
/
ββ .github/
β ββ workflows/
β ββ publish.yml # GitHub Actions workflow for CI/CD (vercel deployment)
ββ .vscode/
β ββ settings.json # VS Code Settings for better formatting
ββ src/
β |β app/
β | ββ classes/ # Utility classes e.g. `QueryBuilder`, `ErrorWihStatus`
β | ββ configs/ # App configurations
β | ββ constants/ # Constant values
β | ββ errors/ # Custom error processors/handlers
β | ββ middlewares/ # Custom Express middlewares
β | ββ modules/ # Feature modules (controllers, services, etc.)
β | ββ routes/ # Route definitions
β | ββ types/ # Types for the App
β | ββ utilities/ # Helper functions
β |
β ββ app.ts # Express app setup
β ββ index.d.ts # Global type declarations
β ββ server.ts # Server bootstrap
β
ββ .env # Environment variables
ββ .gitignore # Ignore files/folders from being pushed/committed
ββ .prettierignore # Ignore files/folders from being formatted with prettier
ββ .prettierrc.json # Prettier config
ββ eslint.config.mjs # ESLint config (flat config, ready for TS)
ββ nhb.scripts.config.mjs # Config for nhb-scripts
ββ nodemon.json # Nodemon settings
ββ package.json
ββ README.md
ββ secret.mjs # Generate secrets for jwt (using crypto module, just run in cli: node secret.mjs or pnpm/npm/yarn run secret)
ββ tsconfig.json # Ready to use tsconfig
ββ vercel.json # Deployment config for Vercel
```
---
## π οΈ Scripts
- `pnpm dev` β Start in dev mode with hot reload
- `pnpm start` β Run the built server
- `pnpm deploy` β Build the project and deploy to Vercel (`nhb-build && vercel --prod`)
- `pnpm build` β Build the project for production (`nhb-build`)
- `pnpm format` β Format the codebase (`nhb-format`)
- `pnpm lint` β Lint the code (`nhb-lint`)
- `pnpm fix` β Autoβfix lint issues (`nhb-fix`)
- `pnpm commit` β Guided commit workflow (`nhb-commit`)
- `pnpm count` β Count exports (`nhb-count`)
- `pnpm module` β Scaffold new modules (`nhb-module`)
---
## βοΈ CI/CD Workflow
A readyβtoβuse **GitHub Actions workflow** is included in:
```text
.github/workflows/publish.yml
```
β
**What it does:**
- Runs on push to your main branch
- Builds your project
- Deploys automatically to **Vercel** (configured via `vercel.json`)
β
**How to use:**
1. Push your project to a GitHub repository.
2. Add your Vercel tokens/secrets as GitHub repository secrets:
Go to `Settings >> Secrets and variables >> Actions >> Repository secrets` and add these variables:
- `VERCEL_ORG_ID`
- `VERCEL_PROJECT_ID`
- `VERCEL_TOKEN`
3. Every time you push to `main` and _version is updated_, GitHub Actions will trigger and deploy your server to Vercel.
You can customize the workflow to fit your own CI/CD needs (e.g., change branches, add tests, deploy elsewhere).
---
Made with β€οΈ by [Nazmul Hassan](https://github.com/nazmul-nhb)
**Powered by `nhb-express`** π