Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": true
}
}
]
]
}
32 changes: 1 addition & 31 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,31 +1 @@
**/*.env
**/node_modules
.DS_Store

server/globalConfig.json

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# Optional eslint cache
.eslintcache

### react ###
.DS_*
**/*.backup.*
**/*.back.*

node_modules
*.js
75 changes: 29 additions & 46 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,39 @@
// "off" or 0 - turn the rule off
// "warn" or 1 - turn the rule on as a warning (doesn’t affect exit code)
// "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
const packageJson = require('./package.json')
const devDependencies = Object.keys(packageJson.devDependencies || {})

module.exports = {
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:jest/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:jsx-a11y/recommended",
"prettier",
"react-app",
],
plugins: [
"html",
"react",
"jsx-a11y",
"markdown",
"react-hooks",
"jest",
"import",
],
settings: {
react: {
version: "detect",
},
},
parserOptions: {
sourceType: "module",
},
env: {
browser: true,
commonjs: true,
es6: true,
es2021: true,
node: true,
"jest/globals": true,
jest: true,
},
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'prettier',
'prettier/prettier',
'plugin:node/recommended',
],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
requireConfigFile: false,
},
plugins: ['jest'],
rules: {
"react/prop-types": "off",
"react/jsx-filename-extension": "off",
"import/prefer-default-export": "off",
"prefer-destructuring": "off",
"object-shorthand": "off",
"react/jsx-props-no-spreading": "off",
"arrow-body-style": "off",
"no-underscore-dangle": "off",
"react/forbid-prop-types": "off",
"jsx-a11y/label-has-associated-control": [
"error",
'prefer-destructuring': 'off',
'object-shorthand': 'off',
'arrow-body-style': 'off',
'no-underscore-dangle': 'off',
'react/react-in-jsx-scope': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'node/no-unpublished-require': [
'error',
{
assert: "htmlFor",
allowModules: devDependencies,
},
],
},
};
}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage
Expand All @@ -13,6 +9,7 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
Expand Down
31 changes: 0 additions & 31 deletions .prettierignore

This file was deleted.

9 changes: 5 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
Expand All @@ -10,10 +11,10 @@
"proseWrap": "always",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"trailingComma": "es5",
"useTabs": false,
"endOfLine": "lf"
}
}
153 changes: 56 additions & 97 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,104 +1,63 @@
`#node.js` `#mvc` `#assembler-school` `#master-in-software-engineering`
`#html` `#css` `#sass` `#bootstrap` `#javascript` `#mvc` `#oop` `#mongodb` `#react`
`#mongodb` `#node` `#express` `#mongoose` `#localstorage` `#firebase`

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
# MERN MVC eCommerce

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
We had to develop an eCommerce with a dashboard to manage products and users
(admin, employees or clients)
## Installation

<!-- ALL-CONTRIBUTORS-BADGE:END -->

# (Client) Assembler School: Node.js Develop Your Project MVC <!-- omit in toc -->

> In this project you will be able to create one of our Develop Your Project
> projects based on the MVC pattern in Node.js.

# Index <!-- omit in toc -->

- [Getting Started](#getting-started)
- [Deployment](#deployment)
- [Technologies used](#technologies-used)
- [Project requirements](#project-requirements)
- [Project delivery](#project-delivery)
- [Resources](#resources)
- [License](#license)
- [Contributors ✨](#contributors-)

## Getting Started

These instructions will get you a copy of the project up and running on your
local machine for development and testing purposes. See deployment for notes on
how to deploy the project on a live system (**if it applies to this
project/pill**).

### The repository

First, you will need to `clone` or `fork` the repository into your Github
account:

<img src="https://docs.github.com/assets/images/help/repository/fork_button.jpg" alt="Fork on GitHub" width='450'>
Clone the repositories:

- Back: https://github.com/AntonioCopete/mern-back
- Front: https://github.com/AranBeitia/mern-front-cli

Install dependencies for backend and frontend.
```http
npm install
```
$ git clone https://github.com/assembler-school/node-develop-your-mvc-project.git
```

## Deployment

For this project you can use Netlify to deploy the front app.

## Demo

- Backend:
- Run mongoDB
```http
npm start
```

- Frontend:
```http
npm start
```

## Technologies used

- React.js

## Project requirements

- You must use semantic HTML5 elements for all the contents of the application
- All code including comments need to be written in English
- Use a code style like camelCase
- It is recommended to divide the tasks into several subtasks so that you can
associate each particular step of the construction with a specific commitment
- You should try as much as possible that the commits and planned tasks are the
same
- You must create a correctly documented README.md file in the root directory of
the project (see guidelines in Resources)
- All the routes that are specified as protected should be protected so that
only users that are logged in and have the appropriate ROLE (ADMIN | EMPLOYEE)
can perform operations and access data or endpoints
- You must store any sensitive data in .env variables and ignore the file from
the git repository history

## Project delivery

To deliver this project you must follow the steps indicated in the document:

- [Submitting a solution](https://www.notion.so/Submitting-a-solution-524dab1a71dd4b96903f26385e24cdb6)

## Resources

- See the original doc provided by us

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
for details

## Contributors ✨

Thanks goes to these wonderful people
([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://www.danilucaci.com"><img src="https://avatars.githubusercontent.com/u/19062818?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Dani Lucaci</b></sub></a><br /><a href="https://github.com/assembler-school/vanilla-js-project-template/commits?author=danilucaci" title="Code">💻</a> <a href="https://github.com/assembler-school/vanilla-js-project-template/commits?author=danilucaci" title="Documentation">📖</a> <a href="#example-danilucaci" title="Examples">💡</a> <a href="#tool-danilucaci" title="Tools">🔧</a></td>
</tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the
[all-contributors](https://github.com/all-contributors/all-contributors)
specification. Contributions of any kind welcome!
- HTML
- CSS
- SASS
- Javascript
- React
- Bootstrap
- MVC
- OOP
- Node
- Express
- MongoDB
- Mongoose
- Localstorage
- Firebase


# Project goal
- Learn how to connect to a MongoDB database using a node.js driver
- Learn how to execute Queries and CRUD operations using a node.js driver
- Learn how to implement a node.js web application using a MVC pattern
- Improve your knowledge of the MVC pattern
- Learn how to work with templating languages in node.js

## 🔗 Authors
| Contributor | Github profile
| ------------------------| -----------------------------------------------------------------------|
| [![](https://avatars2.githubusercontent.com/u/12766483?s=90&v=4)](https://github.com/aranbeitia) | [@AranBeitia](https://www.github.com/AranBeitia) |
| [![](https://avatars2.githubusercontent.com/u/80582545?s=90&v=4)](https://github.com/YaiGenes)|[@YaiGenes](https://github.com/YaiGenes) |
| [![](https://avatars2.githubusercontent.com/u/85640830?s=90&v=4)](https://github.com/AntonioCopete)|[@AntonioCopete](https://github.com/AntonioCopete) |
| [![](https://avatars.githubusercontent.com/u/78234738?s=90&v=4)](https://github.com/Jose1i1o)|[@Jose1i1o](https://github.com/Jose1i1o) |
Loading