Version: v1.1.0
-
Dependencies
- axios (0.22.0): HTTP REST Client for the frontend requests.
- bootstrap (5.1.2): Frontend framework for quickly sites building (Mobile-first, responsive).
- bad-words (3.0.4): Analize strings and check their profanity
- bcryptjs (2.4.3): Encrypt and validates password strings.
- express (4.17.1): Server management module.
- cookie-parser (1.4.5): Handles User sessions in the app using server cookies.
- ffmpeg-static (4.4.0): Static ffmpeg dependencies based in the host OS.
- ffprobe-static (3.0.0): Static ffprobe dependencies based in the host OS.
- fluent-ffmpeg (2.1.2): A fluent ffmpeg API for video manipulation and processing.
- hbs (4.1.2): Handlebars mustache template frontend system.
- moment (2.29.1): Time manipulation and datatime management library.
- mongodb (4.1.2): Documental JSON Database (NoSQL)
- mongoose (6.0.8): MongoDB speciallized ODM library.
- multer (1.4.3): File handling/Uploading module.
- node-sass-middleware (0.11.0): Node JS middleware for compiling and building CSS through SASS/SCSS files.
- validator (13.6.0): Allows backend to manage complex validations.
-
Development dependencies
- Bootcamp memories Hub
- Weather App Git: GIT Source.
- Weather App Demo (Frontend+Backend): Live Weather App Public Demo.
- Task Manager App Git: GIT Source.
- Task Manager App Demo (Backend): Live Task Manager App Public Demo.
- Chat App Git: GIT Source.
- Chat App Demo (Frontend+Backend): Live Chat App Public Demo.
The automated Node JS commands are start, seed, dev, and test:
...
"scripts": {
"start": "node src/app.js",
"seed": "env-cmd -f ./src/config/.env node ./src/utils/seed.js",
"dev": "env-cmd -f ./src/config/.env nodemon ./app.js -e js,hbs",
"test": "env-cmd -f ./src/config/test.env jest --watch --runInBand"
},
...
These commands have a reason in specific, the command start
is for production purposes, seed
is for the first database run and also app cleanse tasks, dev
por development purposes, and test
for running automated unit tests over the defined app routes.
As I said in the first section, the app has a .env config support... So, if you want to run locally/our server this project, you need to follow this steps first.
- Install NPM dependencies & development dependencies.
npm i
(You need to have installed Node in the host server). - Copy/paste the
.env.example
file located insrc/config/
directory and rename it as.env
- Complete the following fields:
# Server variables
APP_PORT="Express Listening Port or 3000 by default"
MONGODB_URL="MongoDB URL, with leading 'mongodb://' config string."
MONGODB_USER="MongoDB User"
MONGODB_PASSWORD="MongoDB Password"
UPLOADS_DIR= "Custom app uploads directory, by default is 'public/uploads"
JWT_SECRET="Secret JWT Key String"
- Run
npm run seed
to populate the users and some categories collection in the MongoDB database. It will include a development user for you. - Execute
npm run dev
for quick development deployment. - Navigate over
http://localhost:3000
(Or your custom port) and try to login here:http://localhost:3000/login
(Or your custom port) with this demo credentials:
User 1:
Username: demo
Email: [email protected]
Password: demo123*
User 2:
Username: demo2
Email: [email protected]
Password: demo123*
If you want to run the automated unit tests, continue with the following steps:
- Install NPM dependencies & development dependencies.
npm i
(You need to have installed Node in the host server). - Copy/paste the
.env.example
file located insrc/config/
directory and rename it astest.env
. - Complete the following fields:
# Server variables
APP_PORT="Express Listening Port, It's recommended to use 0"
MONGODB_URL="MongoDB Test URL, with leading mongodb:// config string."
MONGODB_USER="MongoDB User"
MONGODB_PASSWORD="MongoDB Password"
UPLOADS_DIR= "Check step 4 or public/uploads"
JWT_SECRET="Secret JWT Key String"
- If you want to run tests without removing the uploaded uploads, please configure
UPLOADS_DIR
in thetest.env
file, or just use public/uploads like a development suite. - Take care if you want to run the automated tests in the main dev/prod uploads directory, that's because these testing tasks clean the whole database constantly.
- Execute
npm run test
for quick testing deployment.
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.
This video codecs are supported in my app, I'm using this for the auto video thumbnail generation. But.. It can open up the possibilities to make a LOT of things with the uploaded videos:
- Video standarization: Convert all sources to a general one... (Web friendly standard - Like webm).
- Video compressing & optimization.
- Video quick view (Like a gif or short video) support.
The 'fmpeg-static' and 'ffprobe-static' dependencies enable the native support for quickly implementation. It will analize the current OS and will install the best option.
- Users management.
- User register
- User avatar uploading support.
- Video Standarization.
- Video Optimization.
- Quick Peek Video support (Like youtube).
- Refactor Categories & Videos model relationship.
- Tests coverage over 100% (Including cookie unit tests).
- Commenting system support.
- Use React/Angular/Vue to serve the frontend.