Next commerce
Requires:
* node >= 8.7.0
* npm >= 5.4.2
Installation:
git clone https://bitbucket.org/krafft_inc/nextcommerce
cd nextcommerce
npm install
Development
npm run dev
Frameworks documentation:
- Next.js https://learnnextjs.com/basics/getting-started
- Feathers.js https://docs.feathersjs.com/guides/basics/starting.html
Deployment
First time build
- docker-compose up
Forcing fresh builds after updates
- docker-compose build --no-cache
Configuration
Coming soon
Testing
Coming soon
Documentation
Coming soon
Styling
http://formidable.com/open-source/radium/docs/guide
import { Style } from 'radium';
import Radium from '../components/RadiumWrapper';
const styles = {
one: {
textAlign: 'center',
},
two: {
color: 'red',
},
};
const rootStyles = {
'ul > li': {
color: 'green',
},
};
@Radium
class Index extends Component {
render() {
return (
<div>
<Style scopeSelector=".content" rules={rootStyles} />
<div className="content" style={[styles.one, true && styles.two]}>
1
<ul>
<li>2</li>
<li>3</li>
</ul>
</div>
</div>
);
}
}
Internalization
https://github.com/alibaba/react-intl-universal
Supported formats:
import intl from 'react-intl-universal';
- variables { "HELLO": "Hello, {name}." } => intl.get('HELLO', { name:'Tony' })
- HTML { "TIP": "This is <span style='color:red'>HTML</span>" } => intl.getHTML('TIP')
- etc...
Scaffolding
Feathers has a powerful command line interface. Here are a few things it can do:
$ npm install -g @feathersjs/cli # Install Feathers CLI
$ feathers generate service # Generate a new Service
$ feathers generate hook # Generate a new Hook
$ feathers generate model # Generate a new Model
$ feathers help # Show all commands
DB
Installing DB
brew install postgresql
brew services stop postgresql
pg_ctl -D /usr/local/var/postgres start && brew services start postgresql
psql postgres
CREATE USER "postgres" SUPERUSER;
CREATE DATABASE "nextcommerce" WITH OWNER "postgres";
Installing migration tools for sequlazee
npm install --save sequelize-cli
"db:migration":"node_modules/.bin/sequelize db:migrate",
"db:migration:undo":"node_modules/.bin/sequelize db:migrate:undo"
adding a seed
"db:seed":"node_modules/.bin/sequelize seed:generate --name $name"
=>
name=user npm run db:seed
#Admin Username abc@abc.com Password 123321