Andromeda.technology - Official Website
Ceker.net - Croatian Natural & Healthy Foods Shop - Official Webshop
Built for easier syncing of Luceed and Shopify.
Written in TypeScript, with Interfaces and separated files, folders for each domain (Luceed, Shopify) and it's sub-domains (Orders, Customers, ShippingData etc.).
This organization greatly helps with understanding of the flow of the sync process between Luceed and Shopify.
Easily extend this codebase to suit your needs.
Most of the basic stuff needed to get your webshop up and running in Shopify, while having it in Sync with your physical store and inventory (via Luceed).
- View, Create: Orders,
- View, Create: Customers,
- Sync Shopify Orders to Luceed,
- Sync Luceed Products to Shopify.
-
.env: Define if product can be sold when inventory levels < 0
-
.env: Define shop wide discounts - via config variable (define percentage) - applied to all products
-
Database: Hide/Show products on Webshop
-
Database: Make products available only offline (in physical shop)
-
Shopify pagination
-
Finding, using Shopify PRODUCTS by SKU (defined on product variant) -- This way, product HANDLE is used for search engine and display purposes only
-
Create Luceed Order with default PoslovniPartner if none available from Shopify (because of selected Shopify plan) -- Then change, optionally and manually, later in Luceed - delivery and contact data
-
Saving ShopifyOrder to Luceed, with adding one of two Delivery items a) Free Delivery item, b) Default Delivery item. -- Based on delivery price on Shopify Order.
-
Continue selling products, when out of stock (configurable via .env variable (true/false))
-
Two (2) locations: Shop and Webshop: To show inventory per location
.env variables: Used to Control behaviour of the Sync process (params to access Luceed and Shopify).
Env variables (.env file):
- var1
Database (e.g. MongoDB Atlas):
- is_visible_in_webshop - [true/false] - is product ACTIVE or in DRAFT in Shopify (visible for customers)? Product is always synced, but potentially hidden from customers.
- Set default payment by Luceed ID.
- Throttling included - to comply with Shopify request limit (for every call towards Shopify) -- Configurable
If you don't want to sync customer data to Luceed (by choice or by Shopify plan limitations)... Syncer will assign all Orders to a default customer in Luceed (just make sure to provide UID from Luceed Customer in .env file).
On the other hand, if you do have the plan that provides Customer data, new customers will be created in Luceed (based on e-mail address and postal address) or existing ones will be used (if already in Luceed).
- Na Webshopu navodimo samo MPC cijene (ne VPC)
- Optional: E-mail on checkout (email doesn't need to be part of every ShopifyOrder, as some plans hide it - then add to default User, to change manually in Luceed)
- Optional: Phone on checkout (phone doesn't need to be part of every ShopifyOrder, as some plans hide it - then add to default User, to change manually in Luceed)
- Heroku (instructions below)
- Fixie on Heroku - for static outbound requests IP adress (instructions below)
- Redis on Heroku (or any other place - just get REDIS_URL) (used for Queue jobs - sync process, as Heroku bails with execution after timeout)
Total production cost per month for micro, shared instance is ~[5,8] USD (Heroku hosting + Redis included).
Progressive Startup API Boilerplate
https://firestarter-api.andromeda.technology
Easy to extend, Progressive and Scalable API boilerplate to power your startup.
- TypeScript,
- Koa.js,
- Database: MongoDB: Mongoose,
- Config: Dotenv, Joi,
- Testing: Jest: SuperTest, MongoDBMemoryServer,
- Docker: MongoDB.
- Clone the repo,
- Duplicate
.env.example
files in [./
,/docker/
] to.env
; modify as needed, - Have
Docker
installed, run the containers and your app (check the instructions below), - Add modules (routes, controllers, services, tests) to
/src
(duplicate Message module, adjust to your needs), - List newly added modules (features) here (Readme.md) and in your POSTMAN collection.
- Message Module,
- [Add your modules/features here]
All API routes are prefixed by API_PREFIX
(defined in.env
) (default: /api
).
Docker
Docker provides isolated MongoDB
for your project.
cd ./docker
# Duplicate example env file, modify as needed
cp .env.example .env
docker-compose up -d
Application
# Return from `docker` to root dir
# cd ..
# Duplicate example env file, modify if needed
cp .env.example .env
# Install packages
npm i
# Run
npm run dev
Using Jest
Testing Framework.
Jest uses SuperTest
and MongoDBMemoryServer
.
npm run test
- (Link your Postman Documentation here)
Pre-set environment variables:
host
admin_password
Dynamic environment variables, automatically set in tests:
access_token
Routes can be protected with jwtCheck
middleware,
requiring admin rights.
Requests going to these routes require Authorization: Bearer {access_token}
header.
List of protected, i.e. Admin Routes
- Message[Create,Update,Delete],
- [Add your protected routes here]
Getting access_token for the Admin user
- Request endpoint:
POST /auth/token
, - Pass your password in the request body:
{ password: ADMIN_PASSWORD }
, - Response will return created
token
.
Note: Postman collection will automatically set access_token
environment variable,
so you can immediately call admin routes, without copy-pasting it or setting the env variable manually.
Getting the ADMIN_PASSWORD
- Your
ADMIN_PASSWORD
is defined in.env
file. - It defaults to
secret
.
If you use MongoDB Atlas: Uncomment and fill DB_URI
in .env
.
Heroku tutorial 1 Heroku tutorial 2
Andromeda
Hero image source: FireStarter, gilad, DevianArt.
- State-of-the-art tracker for emotions, habits and thoughts,
- Healthiest version of you,
- Gamified,
- Anonymous and open source.
Check Self-Aware Software Artisan before contributing.