Coder Social home page Coder Social logo

cezerin2 / server Goto Github PK

View Code? Open in Web Editor NEW
358.0 358.0 135.0 20.25 MB

Cezerin2 is React and Node.js based eCommerce platform. React Shopping Cart.

Home Page: http://cezerin.org

License: MIT License

JavaScript 99.28% Shell 0.37% Dockerfile 0.35%
cart cezerin cezerin-store ecommerce-platform mongodb react react-shopping-cart reactjs reactshopping shopping shoppingcart ubuntu

server's Issues

move to schema model

Hi i have started updating my local copy with features, would push when stable , but biggest issue i have is the cezerin original lack mongo db schema ?? is there is reason you guys are sticking to no schema model, i was wondering if you where open to schema modules, allows to switching out database , am currently using mysql with sequilize as orm, fairly straight forward , using global search for collection keyword and modifying each code to use the sequilize ?

Cezerin2 master branch

Cezerin2 master branch need to be most stable like the cezerin1. Any big change need to least effect on the origin

How to change language on the store?

Hi guys,

first of all, thank you for continuing this great project.

I am not sure how to change language on the store, to be precise, how to use locales. I've changed config files to use different language, but only search bar is changed. Homepage remains in English.
Readme file lacks the proper explanation about this feature.

Thanks.

MongoError: The top-level _id field is the only field currently supported for exclusion

[start-api] error: MongoError: The top-level _id field is the only field currently supported for exclusion
[start-api] at queryCallback (/var/www/repository/cezerin/node_modules/mongodb-core/lib/cursor.js:248:25)
[start-api] at /var/www/repository/cezerin/node_modules/mongodb-core/lib/connection/pool.js:532:18
[start-api] at _combinedTickCallback (internal/process/next_tick.js:132:7)
[start-api] at process._tickDomainCallback (internal/process/next_tick.js:219:9)

Note: After installation getting this error when we run "npm start".
we have already installed mongodb and nginx server setup.

Its the same error with your old repo and new repo. so due to this other than Product page in admin section all other pages are working fine.

Can you please help us with this to fix the issue. ?

pm2 api respond

pPM2][ERROR] script not found : /Users/seunghunlee/Clients/Seunghun/cezerin2/dist/store/server/index.js
[PM2] App [api] launched (1 instances)

Add new product custom setting toggle in Product Edit Inventory

I created a new store with cezerin about bookselling. I want to have a new variable property for each product that would be a toggle and should indicate whether the book is electronic or not. Similar to 'Enabled' and 'Discontinued' in Edit Product page.

Is there an approach documented somewhere that I can use and that is going to save the new property in the db and on the admin panel?

link product variant stock to product stock

The product variant stocks and product stock can be different and therefore it can report out of stock when variants are actually available.

  • Product stock should reflect the total product variant stocks
  • Product variant stock update should update the product stock

why not make system independent so that each bundle size get reduce..

why not make the system independent so that each bundle size get reduce and easy to maintain...

  1. admin interface
  2. api code
  3. store code

if you think that code is very integrated with each other then uses git submodule feature for common code.. this way.. each of the code gets separated.. and new members of this project can understand its function.

you can start this by moving out admin panel from the code... i can help you with that because last night I struggle with many problems to make them independent.

Tests?

I'm just found out the project and want to contribute and develop features... However I noticed that there isn't a command for npm test nor any test files

Can someone tell me if the project currently has tests or where can I find them? This would help a lot around new people like me to the project or future contributors to navigate the codebase and ensure features don't break

Add support to .env files

Refactor code so config files load env from .env files, so I can use just one config file for any enviroment.
.env files could be managed by dotenv
.env / .env.test need to be added to .gitignore, and only .env.example should be commited
if node_env = test, .env.test should be used instead of .env file
docs must be updated to reflect those changes.

Paypal PayPalCheckout.js

in PayPalCheckout.js... lack of OnError, OnCancel handling
if cancel after logged in paypal, the button will forever in loading progress, or if card rejected or other error, the button won't be enabled to try again

Code customization

Sorry for the stupid question.. But how can I customize codes like homepage slider, button, labels etc. I have seen the react files at theme/src, but when I modified the codes and run npm start again, it doesn't reflect any changes I've made.

Deploying on AWS EC2

I am currently have the original one deployed on my AWS EC2 Instance, but I am getting a connection refused error when the API is trying to make a call. The products would not show up if I click on the category tab, but if I click on it and then refresh it. It shows up with no issue. I think it is because of CORS. I am pretty sure Nginx would solve that issue, but I am not sure if the config file would work for AWS EC2 or just DigitalOcean.

MongoDB connection

error: MongoDB connection was failed. Incomplete key value pair for option

(async () => {
let client = null;
let db = null;

try {
	client = await MongoClient.connect(
		mongodbConnection,
		CONNECT_OPTIONS
	);
	db = client.db(dbName);
	winston.info(`Successfully connected to ${mongodbConnection}`);
} catch (e) {
	winston.error(`MongoDB connection was failed. ${e.message}`);
	return;
}

const CONNECT_OPTIONS = {
useNewUrlParser: true
};

Blank order page (only if products with variants) at admin

Blank order page (only if products with variants) at admin.

Chrome console error:

TypeError: Cannot read property 'length' of undefined
at t.value (app-2d1cf225b8cad7993f6c.js:1)
at Mi (vendor-e8dc6575b01dfb52e277.js:27)
at ji (vendor-e8dc6575b01dfb52e277.js:27)
at pa (vendor-e8dc6575b01dfb52e277.js:27)
at ha (vendor-e8dc6575b01dfb52e277.js:27)
at Xa (vendor-e8dc6575b01dfb52e277.js:27)
at Ka (vendor-e8dc6575b01dfb52e277.js:27)
at Va (vendor-e8dc6575b01dfb52e277.js:27)
at Ua (vendor-e8dc6575b01dfb52e277.js:27)
at ba (vendor-e8dc6575b01dfb52e277.js:27)

Tax Total Feature

In Australia, our tax is 10% of the total price otherwise known as Goods and Services Tax (GST),
I am looking at implementing this to allow an inclusive or exclusive option with a set %.

Install fail

Installing:
git clone https://github.com/cezerin2/cezerin2.git cezerin works!!
cd cezerin works xd
npm install works??
npm run build failed with error about theme import
npm install theme --save it solved the theme problem
npm run build failed like this:

ERROR in assets/js/app-03db75ae900df00e597f.js from Terser
TypeError: Cannot read property 'minify' of undefined at minify (/home/loris/cezerin/node_modules/terser-webpack-plugin/dist/minify.js:175:23)

changed _terser.default.minify to _terser.minify
npm run build finally ended without errors

npm start works...
open other terminal and: npm install pm2 -g
pm2 start process.json makes "api" and "store" online
http://localhost:3000 this page works
http://localhost:3000/admin that page say not found
http://localhost:3001 cannot get

pls help!

Link product variants price to pricing field

The pricing from product variants isn't reflected in the product category.

  • When product variants are used the product pricing should be ignored for the variant pricing should be used.
  • When product variants have multiple prices the price range should be displayed in the catalogue.
  • product variants should have sale prices that are applied when pricing sale date is valid.

Issue during installation

Hi everyone,
I have an issue while running npm install, it says:

Could not install from "theme" as it does not contain a package.json file.

I tried downloading and installing cezerin old version and it worked ok but with cezerin2 I'm getting this error message...

On the home page, console shows this error. and I can't click product to transition to product page. Network request for '/' threw an error. TypeError: Failed to execute 'fetch' on 'ServiceWorkerGlobalScope': 'only-if-cached' can be set only with 'same-origin' mode at Object.<anonymous> (workbox-core.dev.js:1400) at Generator.next (<anonymous>) at step (workbox-core.dev.js:14) at workbox-core.dev.js:25

Thanks for the awesome work! On the home page, console shows this error. and I can't click product to transition to product page.

Network request for '/' threw an error. TypeError: Failed to execute 'fetch' on 'ServiceWorkerGlobalScope': 'only-if-cached' can be set only with 'same-origin' mode
    at Object.<anonymous> (workbox-core.dev.js:1400)
    at Generator.next (<anonymous>)
    at step (workbox-core.dev.js:14)
    at workbox-core.dev.js:25

npm run build missing script: build

Hi, I have followed the installation steps. But when it comes to npm run build, error popped out saying missing script: build.. How can I resolve this?

npm run build error Module not found: Error: Can't resolve '../../../config/server'

Hi,
I appreciate your help!
I'm getting error when i run npm run build

ERROR in ./node_modules/theme/dist/lib/apiClient.js
Module not found: Error: Can't resolve '../../../config/server' in '/Users/seunghunlee/Clients/Seunghun/cand
le-shop-v0.1/node_modules/theme/dist/lib'
 @ ./node_modules/theme/dist/lib/apiClient.js 3:0-52 60:11-25
 @ ./node_modules/theme/dist/components/signIn/index.js
 @ ./node_modules/theme/dist/containers/shared.js
 @ ./node_modules/theme/dist/index.js
 @ multi theme

Refactoring React code of Theme

cezerin/cezerin#539

We can improve speed of rendering.

Todo:

  1. replace index to *.id where we can
  2. remove computing from render() method
  3. use PureComponent where we can
  4. replace

onClick={() => {...}}

with

onClick(this.handleClick)

  1. Use setState callback.

Replace

this.setState({ total: this.state.total + 1 });

with

this.setState((prevState) => ({ total: prevState.total + 1}));

Unable to pull docker image cezerin2/cezerin2

I am unable to pull docker image it says
ERROR: pull access denied for cezerin2/cezerin2, repository does not exist or may require 'docker login'

I have logged in with the docker too.

My docker-compose file

version: '3'

services:
  app:
    image: cezerin2/cezerin2
    environment:
      - DB_HOST=db
      - DB_PORT=27017
      - DB_NAME=shop
      - DB_USER=store
      - DB_PASS=Qwertyuiop~
    ports:
      - 4000:80
    volumes:
      - /var/www/store:/var/www/cezerin
    depends_on:
      - db
    restart: always

  db:
    image: mongo
    ports:
      - 27017
    volumes:
      - /var/www/store-db:/data/db
    restart: always

port already in use

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 info lifecycle [email protected]
start: [email protected]
7 verbose lifecycle [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\hp\Desktop\cezerin2\node_modules.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\hp\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\hp\AppData\Local\Microsoft\WindowsApps;C:\Users\hp\AppData\Roaming\npm;C:\Users\hp\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon
9 verbose lifecycle [email protected]start: CWD: C:\Users\hp\Desktop\cezerin2
10 silly lifecycle [email protected]
start: Args: [ '/d /s /c', 'node -r esm src/api/server/index.js' ]
11 silly lifecycle [email protected]start: Returned: code: 1 signal: null
12 info lifecycle [email protected]
start: Failed to exec start script
13 verbose stack Error: [email protected] start: node -r esm src/api/server/index.js
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\hp\Desktop\cezerin2
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
18 verbose node v10.15.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: node -r esm src/api/server/index.js
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Add missing PayPal confirmation check out.

On the check out out, when paying with PayPal, it's supposed to redirect users to check out page again to confirm their purchase. But currently the payment is confirmed automatically without user's knowledge and this is a terrible experience.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.