Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

M0r13n/Smartphoniker-shop

Repository files navigation

What is it?

An online website for repair shops of smartphones.

Setup

Getting Started

Docker

Build the application with docker-compose (the first build can take some time):

$ make docker-build

Run development server:

$ make docker-dev

Run production server:

$ make docker-prod

After you started the container you need to initialize the database:

$ docker-compose exec <YOUR_SERVER_TYPE> make db

where you need to replace <YOUR_SERVER_TYPE> with either pricepicker-prod or pricepicker-dev.

Run tests:

$ docker-compose exec pricepicker-dev make db

Without Docker

Create and activate a virtual environment, and then install the requirements.

$ virtualenv venv && source venv/bin/activate
$ make install

Set Environment Variables

Update project/server/config.py. By default the app is set to use the production configuration. If you would like to use the development configuration, you can alter the APP_SETTINGS environment variable:

PRO TIP: Store all env vars inside a .local_env file, so that you dont have to set them all the time.

DO NOT CREATE A .env file for your local dev env, because this file may be used inside docker!

$ export APP_SETTINGS=project.server.config.DevelopmentConfig

You can set the TRICOMA_API_URL if you want to use the API to create customers.

Create DB

At first you need to create a new local postgres database:

create database "pricepicker-v2";
create user "some user" with encrypted password 'some password';
grant all privileges on database "pricepicker-v2" to "some user";

Then you just need to update the DATABASE_URL:

$ export DATABASE_URL=postgresql://<YOUR_URL>:#@127.0.0.1/<YOUR_DB>
$ make db

Run the Application

$ make run

Access the application at the address http://localhost:5000/

Start Celery

If you want to start the celery worker, you need to have Redis running somewhere. Change the REDIS_URL accordingly inside your config.py or .env. You can start a celery worker by calling:

$ python manage.py start-worker [loglevel]

Testing

Without coverage:

$ make test

About

[WIP] Work in Progress

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published