- always use camelCase
- Follow ES6+ Javascript standards
- Project structure
- Frontend
- Backend
- backend-config
- populate-db
- dockerized
- runing-apps
- start frontend
- start backend
- test coverage
The structure of this project defined by folders with specific purpose
.
├── ...
├── # mean fullstack project
│ ├── backend # Folder API REST Express
│ ├── frontend # Folder Ang App Angular
│ ├── docker-compose.yml
│ ├── gitignore
│ ├── package.json
└──...
The structure of this project defined by folders with specific purpose, inside a frontend folder you can see all the distribution, all items are related with each purpose.
The structure of this project defined by folders with specific purpose.
.
├── ...
├── backend # Express API Rest
│ ├── src
│ ├── mdw # midlewware
│ ├── routes # routes
│ ├── config # headers, config cors and more
│ ├── controllers # controllers
│ ├── models # mongo database models
│ ├── services # logic bussiness
│ ├── utils # utils functions, methods
│ ├── helpers # helpers functions, methods
│ ├── app.ts # api express core
│ ├── index.js # wrapper api express core
│ └── ... # etc.
└──...
Important create all 3 .env files, for PRODUCTION .env.production.local on variable DB_CNN
use this value mongodb+srv://rabin:3OnnAhgTd3jJ3rp2@clustercoffedb.r82zt.gcp.mongodb.net/beer_db
it's a cluster from mongoAtlas (latter on review this code delete it please)
When you enter in the frontend after you create your account and SignIn you must lounch on the interface for load beers endpoints or you can do it manually with postman. I provide a folder called postman-collection
, you can import it and run the specific loadBeer endpoint (Method post with empty Body)
You can run all app using docker-compose up
, and you will see all the info, check the DATABASE CONNECTION it-s related with VARIABLE DB_CNN
on yours .env files.
run npm run start
inside on folder frontend
for start frontend in angular
for backend it's depends which enviroments you wan to run you can choose between:
Development
test
Production
if you want to start API with development settings you must run npm run start
for start API REST
if you want to start API with test settings you must run npm run start-test
for start API REST. this is only need for run unit and functional test
if you want to start API with Production settings you must run npm run start-prod
for start API REST
run npm run test-coverage
for start all test into backend. WARNING there is a lot test failing, i needed more time