Full stack project. Uploading .csv files with drag & drop
Video sample:
Front end and back end aplications are almost independant, stored in different folders, so some commands should be executed separately.
Build and up all services from docker-compose.yaml:
docker-compose up --build -d
- back-end tests:
cd server
npm run test:in_container
# or
docker-compose exec server sh -c 'cd /frontend && npm run test'
- front-end tests:
cd frontend
npm run test:in_container
# or
docker-compose exec server npm run test
# up mongodb if needed:
docker-compose up --build -d mongo
# at frontend dir:
cd frontend
npm i
npm run test
npm run build
# at server dir:
cd server
npm i
npm run test
npm run dev
- Insert users by .csv file:
POST /api/users/upload {FormData}
Code: 200
Response: {"data":{ fileName, insertedCount},"status":"OK"}
- Search users:
GET /api/users/search?query=
Code: 200
Response: {"data":{users:[{...}]},"status":"OK"}
General info:
- Node.js version:
v13.6.0
. UsingESM
- All db data from each MongoDB instance will be mapped to
./mongo/data/
folder
Used ports:
27017
- MongoDB server3000
- HTTP web server
MongoDB connection URL:
mongodb://admin:admin@localhost:27017/db