# Work Flow — ExpressTS Backend
This is the Express.js + TypeScript backend for Work Flow, a productivity and project workflow management system for teams and admins.
- REST API with Role-based Auth (JWT)
- Task & project lifecycle management
- Staff attendance, layoff, and performance tracking
- Admin stats and analytics endpoints
- Scalable folder structure with CI/CD support
- Node.js + Express.js
- TypeScript
- MongoDB with Mongoose
- JWT Auth
- Zod for validation
npm install
npm install express
npm install --save-dev typescript ts-node @types/express @types/node nodemon
npm install typorm dotenv
Npm install pg --save
npm run dev
Check to make sure of the following in tsconfig.json
{
"compilerOptions": {
...
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "ES6",
"module": "commonjs"
}
}
At the top of src/index.ts
or main.ts
(before anything else):
import 'reflect-metadata';
npm install bcrypt jsonwebtoken
npm install --save-dev @types/bcrypt @types/jsonwebtoken
- Install Postgresql
brew install postgresql
# Start postgresql service
brew services start postgresql
Check brew services status
brew services list
- Create DB user and DB
psql postgres
# Then inside the psql shell:
CREATE USER myuser WITH PASSWORD 'mypassword';
CREATE DATABASE mydb OWNER myuser;
\q