Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackriosaab committed Dec 29, 2023
0 parents commit 516e120
Show file tree
Hide file tree
Showing 359 changed files with 59,819 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# dependencies
node_modules

# production
build
dist

# misc
package.json.bak
.DS_Store

# config file
.env

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.arrowParens": "avoid",
"prettier.jsxSingleQuote": true,
"prettier.trailingComma": "none",
"jumpToAliasFile.alias": {
"app": "client/app"
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Mern-Ecom
MERN e-commerce: Node backend, Express for routing, Mongoose schemas. React/Redux for UI/state. 3 flows: Buyers browse, Sellers manage brands, Admins control store. Third-party APIs integrated. Async actions handled with Redux Thunk.
7 changes: 7 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security Policy

## Reporting a Vulnerability

Please submit a pull request to report security bugs.

I will confirm the problem, audit code to find potential similar problems and coordinate the fix.
4 changes: 4 additions & 0 deletions client/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": ["@babel/plugin-proposal-class-properties"]
}
1 change: 1 addition & 0 deletions client/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_URL=http://localhost:3000/api
64 changes: 64 additions & 0 deletions client/app/actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
*
* actions.js
* actions configuration
*/

import { bindActionCreators } from 'redux';

import * as application from './containers/Application/actions';
import * as authentication from './containers/Authentication/actions';
import * as homepage from './containers/Homepage/actions';
import * as # from './containers/#/actions';
import * as login from './containers/#/actions';
import * as forgotPassword from './containers/ForgotPassword/actions';
import * as navigation from './containers/Navigation/actions';
import * as cart from './containers/Cart/actions';
import * as newsletter from './containers/Newsletter/actions';
import * as dashboard from './containers/Dashboard/actions';
import * as account from './containers/Account/actions';
import * as address from './containers/Address/actions';
import * as resetPassword from './containers/ResetPassword/actions';
import * as users from './containers/Users/actions';
import * as product from './containers/Product/actions';
import * as category from './containers/Category/actions';
import * as brand from './containers/Brand/actions';
import * as menu from './containers/NavigationMenu/actions';
import * as shop from './containers/Shop/actions';
import * as merchant from './containers/Merchant/actions';
import * as contact from './containers/Contact/actions';
import * as order from './containers/Order/actions';
import * as review from './containers/Review/actions';
import * as wishlist from './containers/WishList/actions';

export default function mapDispatchToProps(dispatch) {
return bindActionCreators(
{
...application,
...authentication,
...homepage,
...#,
...login,
...forgotPassword,
...navigation,
...cart,
...newsletter,
...dashboard,
...account,
...address,
...resetPassword,
...users,
...product,
...category,
...brand,
...menu,
...shop,
...merchant,
...contact,
...order,
...review,
...wishlist
},
dispatch
);
}
56 changes: 56 additions & 0 deletions client/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/**
*
* app.js
*
*/

import React from 'react';
import { Provider } from 'react-redux';
import { ConnectedRouter } from 'connected-react-router';

import store, { history } from './store';
import { SocketProvider } from './contexts/Socket';
import { SET_AUTH } from './containers/Authentication/constants';
import Application from './containers/Application';
import ScrollToTop from './scrollToTop';
import setToken from './utils/token';

// Import application sass styles
import './styles/style.scss';

// Import Font Awesome Icons Set
import 'font-awesome/css/font-awesome.min.css';

// Import Simple Line Icons Set
import 'simple-line-icons/css/simple-line-icons.css';

// react-bootstrap-table2 styles
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';

// rc-slider style
import 'rc-slider/assets/index.css';

// Authentication
const token = localStorage.getItem('token');

if (token) {
// authenticate api authorization
setToken(token);

// authenticate routes
store.dispatch({ type: SET_AUTH });
}

const app = () => (
<Provider store={store}>
<ConnectedRouter history={history}>
<SocketProvider>
<ScrollToTop>
<Application />
</ScrollToTop>
</SocketProvider>
</ConnectedRouter>
</Provider>
);

export default app;
48 changes: 48 additions & 0 deletions client/app/components/Common/Badge/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
*
* Badge
*
*/

import React from 'react';

const variants = {
primary: 'custom-badge-primary',
secondary: 'custom-badge-secondary',
danger: 'custom-badge-danger',
dark: 'custom-badge-dark',
none: 'custom-badge-none',
empty: ''
};

const Badge = props => {
const { variant, className, borderless, round, children } = props;

const v = variant ? variants[variant] : '';

const badgeVariant = v;

const classNames = `custom-badge${`${className && ` ${className}`}`}${
badgeVariant && ` ${badgeVariant}`
}`;

return (
<span
className={classNames}
style={{
borderRadius: borderless ? 0 : round
}}
>
{children}
</span>
);
};

Badge.defaultProps = {
variant: 'secondary',
className: '',
borderless: false,
round: 3
};

export default Badge;
Loading

0 comments on commit 516e120

Please # to comment.