Store Manager is a backend application developed with express.js (node.js) for managing a store's inventory, sales, and products.
Prerequisites:
- have node (at least 18) installed on your machine
- have Docker installed on your machine
- have the Database Client extension for VsCode
-
Clone the repository:
git clone https://github.com/your-username/store-manager.git
-
Navigate to the project directory:
cd store-manager
-
Set up the connection with Database Client (the environment variables are in the docker-compose.yml file).
-
Build the Docker containers by running:
docker-compose up --build -d
- Start the development server:
npm run dev
- Run tests:
npm test:mocha
tests/ backend/ .dockerignore .eslintignore .eslintrc.json .mocharc.json .nycrc.json .stryker.conf.json coverage/ Dockerfile package.json reports/ src/ app.js controllers/ middlewares/ models/ connection.js routes/ server.js services/ tests/ docker-compose.yml README.md sql/ 01-migration.sql 02-seed.sql
backend/src/models/connection.js
: Contains the database connection setup.backend/.eslintrc.json
: ESLint configuration file.backend/src/server.js
: Entry point for the backend server.
npm run dev:local
: Start the development server.npm test
: Run all tests.npm run cy:open
: Open Cypress for end-to-end testing.npm run test:mocha
: Run Mocha tests.npm run test:coverage
: Run tests and generate coverage report.npm run test:mutation
: Run mutation tests.npm run lint
: Run ESLint to lint the codebase.
Create a .env
file in the root directory and add the following environment variables:
MYSQL_HOSTNAME=db
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=password