gagocarrilloedgar / vending-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vending machine API

Project developed for the MVPmatch process

Quick Start

Clone project to create your project, simply run:

git clone https://github.com/gagocarrilloedgar/vending-api <project-name>

Set the environment variables: (You can see all enviroment key at .env.example)

Features & stack

Commands

Running locally:

npm run dev

building:

npm run build

Running production (build before use):

npm start

Testing:

# run all unit tests
npm test

# run all unit tests in watch mode
npm test:watch

With docker

Using the Dockerfile

  # Docker start | Start docker
  docker build -t [image_name] .
  docker run -it -p [PORT]:3000 [image_name]

Documenation

run from root:

# if not installed
npm install apidoc -g

# create/update the documentation folder
apidoc -i src/ -o public/

or

# npm script
npm run docs

After that if you want to see the documentation simply run:

npm run dev

and go to http://localhost:3000

Project Structure

src\
 |--api\
 |--config\         # Environment variables and configuration related things
 |--middlewares\    # Custom express middlewares
 |--models\         # Mongoose models (data layer)
 |--routes\         # Routes
 |--utils\          # Utility classes and functions
 |--app.js          # Express app
 |--index.js        # App entry point
tests\
 |--fixtures\
 |--integration\
 |--utils\
 |--...src\

Linting

Linting is done using ESLint and Prettier.

In this app, ESLint is configured to follow the Standar JavaScript style guide with some modifications.

To modify the ESLint configuration, update the .eslintrc.json file. To modify the Prettier configuration, update the .prettierrc.json file.

To prevent a certain file or directory from being linted, add it to .eslintignore and .prettierignore.

Contributing

Contributions are welcome! Please check out the contributing guide.

License

MIT

Contact info

You can contact me using:

Edgar Gago Carrillo

or:

hello@nuwe.io

About

License:MIT License


Languages

Language:JavaScript 54.6%Language:TypeScript 20.8%Language:HTML 19.0%Language:CSS 5.3%Language:Dockerfile 0.1%Language:Shell 0.1%