Coding along with NodeJS - The Complete Guide
This is the Products Shop app developed in Sections 3 through 23 13
(currently), with the added twist of TypeScript
git clone git@github.com:evokateur/nodejs-complete-guide.git
cd nodejs-the-complete-guide
npm install
Set up a free database with MongoDB Atlas or run a local instance.
Copy .env.example
to .env
and set MONGODB_URI
npm run dev
Can be also be run as JavaScript:
npm run dev:js
The application should be available at http://localhost:3000/
- Both JavaScript and TypeScript versions are fully functional
- JavaScript version preserved for reference and educational purposes
.
├── dist/ # Compiled TypeScript output
└── src
├── js
│ ├── app.js # JavaScript entry point
│ ├── controllers
│ │ ├── admin.js
│ │ ├── error.js
│ │ └── shop.js
│ ├── models
│ │ ├── order.js
│ │ ├── product.js
│ │ └── user.js
│ └── routes
│ ├── admin.js
│ └── shop.js
└── ts
├── app.ts # TypeScript entry point
├── controllers
│ ├── admin.ts
│ ├── error.ts
│ └── shop.ts
├── models
│ ├── order.ts
│ ├── product.ts
│ └── user.ts
└── routes
├── admin.ts
└── shop.ts
npm run dev # Run TypeScript version with hot reload
npm run build # Compile TypeScript to JavaScript
npm run start # Run compiled JavaScript version, or just..
npm start
npm run build:watch # Compile TypeScript in watch mode
npm run dev:js # Run JavaScript version
npm run start:js # Run JavaScript version (no nodemon)