Skip to content

Commit af42353

Browse files
committed
e-commerce start
1 parent 224c316 commit af42353

13 files changed

Lines changed: 13397 additions & 0 deletions

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
MIT License
3+
4+
Copyright (c) 2016 cezerin
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Cezerin - Ecommerce Progressive Web Apps
2+
3+
[![CircleCI](https://circleci.com/gh/cezerin/cezerin/tree/master.svg?style=svg)](https://circleci.com/gh/cezerin/cezerin/tree/master)
4+
5+
Cezerin is React and Node.js based eCommerce platform. Allows creating a Progressive Web Apps.
6+
7+
Built with:
8+
* Node.js v8.9
9+
* React v16
10+
* Redux
11+
* Express
12+
* Babel
13+
* WebPack 4
14+
* MongoDB
15+
16+
## Dashboard
17+
Client-side dashboard use JSON Web Token (JWT) to access REST API.
18+
19+
![Cezerin Dashboard](https://cezerin.com/assets/images/cezerin-dashboard-products.png?)
20+
21+
![Signin email](https://cezerin.com/assets/images/cezerin-signin-email.png)
22+
23+
## Store
24+
Single-Page Application with React server-side rendering. [Demo store](https://store.cezerin.com)
25+
26+
[![Cezerin Store](https://cezerin.com/assets/images/cezerin-mobile-product.png)](https://store.cezerin.com)
27+
28+
[![Cezerin Store](https://cezerin.com/assets/images/cezerin-mobile-order-summary.png)](https://store.cezerin.com)
29+
30+
## Installation
31+
32+
- [with GitHub](https://github.com/cezerin/cezerin/blob/master/docs/getting-started.md)
33+
- [with Docker](https://github.com/cezerin/cezerin/blob/master/docs/getting-started-docker.md)
34+
- [How to deploy a Cezerin on Ubuntu 16.04](https://github.com/cezerin/cezerin/blob/master/docs/how-to-deploy-a-cezerin-on-ubuntu-16-04.md)
35+
- [How to deploy a Cezerin on Ubuntu 18.04.1 (from GitHub)](https://github.com/cezerin/cezerin/blob/master/docs/how-to-deploy-a-cezerin-on-ubuntu-18-04-1-github.md)
36+
37+
### Requirements
38+
* Node.js >= 8
39+
* MongoDB >= 3.2
40+
41+
42+
## Documentation
43+
44+
[Documentation](https://github.com/cezerin/cezerin/tree/master/docs)
45+
46+
47+
## Application Structure
48+
49+
```
50+
.
51+
├── config # Project and build configurations
52+
├── dist # Distribution folder
53+
├── locales # Text files
54+
├── logs # Log files
55+
├── public # Static public assets and uploads
56+
│ ├── admin # Dashboard index.html
57+
│ ├── admin-assets # Dashboard assets
58+
│ └── content # Store root folder
59+
|
60+
├── scripts # Shell scripts for theme install/export
61+
├── src # Application source code
62+
│ ├── admin # Dashboard application
63+
│ │ └── client # Client side code
64+
│ ├── api # REST API
65+
│ │ └── server # Server side code
66+
│ ├── store # Store application
67+
│ | ├── client # Client side code
68+
│ | ├── server # Server side code
69+
│ | └── shared # Universal code
70+
│ └── index.js # Server application start point
71+
├── theme # Theme as a local package
72+
└── process.json # pm2 process file
73+
```
74+
75+
76+
## Sponsoring
77+
78+
Cezerin is an MIT-licensed open source project. It's an independent project with ongoing development made possible thanks to the support of these awesome backers. [Become a backer or sponsor on OpenCollective](https://opencollective.com/cezerin).
79+
80+
### Sponsors
81+
82+
[Become a sponsor](https://opencollective.com/cezerin#sponsor) and get your logo on our README on Github and [cezerin.com](https://cezerin.com) with a link to your site.
83+
84+
<a href="https://opencollective.com/cezerin/tiers/sponsor/1/website" rel="noopener" target="_blank" style="margin-right: 8px;">
85+
<img src="https://opencollective.com/cezerin/tiers/sponsor/1/avatar.svg" alt="0" /></a>
86+
<a href="https://opencollective.com/cezerin/tiers/sponsor/2/website" rel="noopener" target="_blank" style="margin-right: 8px;">
87+
<img src="https://opencollective.com/cezerin/tiers/sponsor/2/avatar.svg" alt="0" /></a>
88+
<a href="https://opencollective.com/cezerin/tiers/sponsor/0/website" rel="noopener" target="_blank" style="margin-right: 8px;">
89+
<img src="https://opencollective.com/cezerin/tiers/sponsor/0/avatar.svg" alt="0" /></a>
90+
91+
92+
## Contributing
93+
94+
If you can, please contribute by reporting issues, discussing ideas, or submitting pull requests with patches and new features. We do our best to respond to all issues and pull requests within a day or two, and make patch releases to npm regularly.
95+
96+
97+
## Licence
98+
99+
This software is provided free of charge and without restriction under the MIT License

config/admin.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// config used by dashboard client side only
2+
module.exports = {
3+
// dashboard UI language
4+
language: 'en',
5+
apiBaseUrl: 'http://localhost:3001/api/v1',
6+
apiWebSocketUrl: 'ws://localhost:3001',
7+
developerMode: true
8+
};

config/admin.production.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// config used by dashboard client side only
2+
module.exports = {
3+
// dashboard UI language
4+
language: 'en',
5+
apiBaseUrl: '/api/v1'
6+
};

config/server.js

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// config used by server side only
2+
const dbHost = process.env.DB_HOST || '127.0.0.1';
3+
const dbPort = process.env.DB_PORT || 27017;
4+
const dbName = process.env.DB_NAME || 'shop';
5+
const dbUser = process.env.DB_USER || '';
6+
const dbPass = process.env.DB_PASS || '';
7+
const dbCred =
8+
dbUser.length > 0 || dbPass.length > 0 ? `${dbUser}:${dbPass}@` : '';
9+
10+
const dbUrl =
11+
process.env.DB_URL || `mongodb://${dbCred}${dbHost}:${dbPort}/${dbName}`;
12+
13+
module.exports = {
14+
// used by Store (server side)
15+
apiBaseUrl: `http://localhost:3001/api/v1`,
16+
17+
// used by Store (server and client side)
18+
ajaxBaseUrl: `http://localhost:3001/ajax`,
19+
20+
// Access-Control-Allow-Origin
21+
storeBaseUrl: `http://localhost:3000`,
22+
23+
// used by API
24+
adminLoginUrl: '/admin/login',
25+
26+
apiListenPort: 3001,
27+
storeListenPort: 3000,
28+
29+
// used by API
30+
mongodbServerUrl: dbUrl,
31+
32+
smtpServer: {
33+
host: '',
34+
port: 0,
35+
secure: true,
36+
user: '',
37+
pass: '',
38+
fromName: '',
39+
fromAddress: ''
40+
},
41+
42+
// key to sign tokens
43+
jwtSecretKey: '-',
44+
45+
// key to sign store cookies
46+
cookieSecretKey: '-',
47+
48+
// path to uploads
49+
categoriesUploadPath: 'public/content/images/categories',
50+
productsUploadPath: 'public/content/images/products',
51+
filesUploadPath: 'public/content',
52+
themeAssetsUploadPath: 'theme/assets/images',
53+
54+
// url to uploads
55+
categoriesUploadUrl: '/images/categories',
56+
productsUploadUrl: '/images/products',
57+
filesUploadUrl: '',
58+
themeAssetsUploadUrl: '/assets/images',
59+
60+
// store UI language
61+
language: 'en',
62+
63+
// used by API
64+
orderStartNumber: 1000,
65+
66+
developerMode: true
67+
};

config/server.production.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// config used by server side only
2+
const dbHost = process.env.DB_HOST || '127.0.0.1';
3+
const dbPort = process.env.DB_PORT || 27017;
4+
const dbName = process.env.DB_NAME || 'shop';
5+
const dbUser = process.env.DB_USER || '';
6+
const dbPass = process.env.DB_PASS || '';
7+
const dbCred =
8+
dbUser.length > 0 || dbPass.length > 0 ? `${dbUser}:${dbPass}@` : '';
9+
10+
const dbUrl =
11+
process.env.DB_URL || `mongodb://${dbCred}${dbHost}:${dbPort}/${dbName}`;
12+
13+
module.exports = {
14+
// used by Store (server side)
15+
apiBaseUrl: `http://localhost:3001/api/v1`,
16+
17+
// used by Store (server and client side)
18+
ajaxBaseUrl: `http://localhost:3001/ajax`,
19+
20+
// Access-Control-Allow-Origin
21+
storeBaseUrl: '*',
22+
23+
// used by API
24+
adminLoginUrl: '/admin/login',
25+
26+
apiListenPort: 3001,
27+
storeListenPort: 3000,
28+
29+
// used by API
30+
mongodbServerUrl: dbUrl,
31+
32+
smtpServer: {
33+
host: '',
34+
port: 0,
35+
secure: true,
36+
user: '',
37+
pass: '',
38+
fromName: '',
39+
fromAddress: ''
40+
},
41+
42+
// key to sign tokens
43+
jwtSecretKey: 'SP69kXFR3znRi7kL8Max2GTB24wOtEQj',
44+
45+
// key to sign store cookies
46+
cookieSecretKey: '8669X9P5yI1DAEthy1chc3M9EncyS7SM',
47+
48+
// path to uploads
49+
categoriesUploadPath: 'public/content/images/categories',
50+
productsUploadPath: 'public/content/images/products',
51+
filesUploadPath: 'public/content',
52+
themeAssetsUploadPath: 'theme/assets/images',
53+
54+
// url to uploads
55+
categoriesUploadUrl: '/images/categories',
56+
productsUploadUrl: '/images/products',
57+
filesUploadUrl: '',
58+
themeAssetsUploadUrl: '/assets/images',
59+
60+
// store UI language
61+
language: 'en',
62+
63+
// used by API
64+
orderStartNumber: 1000
65+
};

config/store.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// config used by store client side only
2+
module.exports = {
3+
// store UI language
4+
language: 'en',
5+
ajaxBaseUrl: 'http://localhost:3001/ajax'
6+
};

config/store.production.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// config used by store client side only
2+
module.exports = {
3+
// store UI language
4+
language: 'en',
5+
ajaxBaseUrl: '/ajax'
6+
};

0 commit comments

Comments
 (0)