Skip to content

rabindranathfv/drunk-project-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BDEO Challenge

  • always use camelCase
  • Follow ES6+ Javascript standards

Information Important

  1. Project structure
  2. Frontend
  3. Backend
  4. backend-config
  5. populate-db
  6. dockerized
  7. runing-apps
  8. start frontend
  9. start backend
  10. test coverage

Project Structure

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.
└──...
for backend you must config at least one .env..local files, this API supports 3 enviroments files (.env.test.local, .env.development.local and .env.production.local). You have a sample.env config and check it please.

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.

you can use d`docker-compose up` or have 2 terminals and running in Development Mode just run `npm start` inside folder frontend and backend

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

About

technical interview: Frontend Ang14 & Backend NodeJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published