Skip to content

MarvinKweyu/marastore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Traveller's Shopping experience

The Traveller

An article around the build process can be found on marvinkweyu/themarastore

Core features

✔️ Viewing items in the shop

✔️ Filtering items by category

✔️ Managing your cart

✔️ Email notifcations on order

✔️ Credit card payment

✔️ Generate PDF invoice on sale and send the invoice to the customer

✔️ Recommendation engine for products that go well with others

Setup


Setting up a Braintree account

This solution uses Braintree for payment. Create your account on the developer portal and get the sandbox keys.

Once done, copy maranomadstore/config/.env.example to maranomadstore/config/.env.example making sure to fill your keys where necessary.

As an overview the base.py settings file in the config folder.

# PAYMENTS
BRAINTREE_CONF = braintree.Configuration(
    environment=braintree.Environment.Sandbox,
    merchant_id=env("BRAINTREE_MERCHANT_ID"),
    public_key=env("BRAINTREE_PUBLIC_KEY"),
    private_key=env("BRAINTREE_PRIVATE_KEY"),
)

Bare metal

Base requirements

Install the following dependencies before running the migrations.

Create a database matching what is in your environment file as specified before.

Example:

Database name: marastore
Database user: marastore
Database password: marastore

Setup a virtual environment, install requirements , run migrations, load sample data and run the server

python3 -m venv .venv
source .venv/bin/activate

pip3 install -r requirements/local.txt
python3 manage.py migrate
python3 manage.py loaddata marastoredata.json # optional
python3 manage.py runserver

Running message brokers;

Launch rabbitMQ on terminal(2)

sudo rabbitmq-server

On a different terminal(3), launch celery

celery -A maranomadstore worker -l info

To monitor asynchronous tasks i.e task statistics - terminal(4)

celery -A maranomadstore flower

Then access the task list queue on localhost:5555

Your credentials

Email: hello@marvinkweyu.net
Password: marvin

Access the project via: 127.0.0.1:8000

Sample credit card details to test with

Credit card numbers

  • 4111111111111111
  • 4005519200000004
  • 4012000033330026

Sample CVC - 123

Key in any data in the future as the expiration date

Example: 12/2030