Skip to content

dbystruev/Get-Outfit-Server

Repository files navigation

Get Outfit Server

Server for Get Outfit

iOS client: github.com/dbystruev/Outfit-Selection

Redis and NGINX Installation

  • Run Redis caching server
docker network create redis # docker network ls
docker run --name redis --network redis -d redis redis-server --appendonly yes
  • Run NGINX as proxy
docker run --name nginx --network redis -p80:80 -d nginx
docker exec -it nginx bash
apt update && apt -y upgrade
apt install vim
vi /etc/nginx/conf.d/default.conf
  • Make changes in /etc/nginx/conf.d/default.conf and exit with :wq
location / {
	proxy_pass http://getoutfit:8888;
}
  • Reload nginx configuration
nginx -s reload
exit

Get Outfit Server Installation

  • Stop and remove the previous Get Outfit Server docker container and its image if needed

    docker stop getoutfit
    docker rm getoutfit
    docker rmi getoutfit
  • Install Get Outfit Server as docker image

    docker run -it --name getoutfit -w/GetOutfit swift bash
    git clone https://github.com/dbystruev/Get-Outfit-Server.git .
    apt update && apt -y upgrade
    apt -y install openssl libssl-dev libmysqlclient-dev libcurl4-openssl-dev vim
    vi Sources/Server/Models/RemoteShop+Data.swift # fill with your real Admitad data (see below)
    exit
    docker commit getoutfit getoutfit
    docker stop getoutfit
    docker rm getoutfit
  • Run Get Outfit Server from docker image

docker run --name getoutfit --network redis -d -w/GetOutfit getoutfit swift run -c release
  • Watch Get Outfit Server
docker logs -f getoutfit

Format of Sources/Server/Models/RemoteShop+Data.swift

extension RemoteShop {
    static var all: [RemoteShop] {
        return [
            RemoteShop(
                code: "Get from Admitad",
                currency: "RUB",
                feed_id: "Get from Admitad",
                format: "xml",
                last_import: "2000.01.01.00.00",
                name: "First Shop Name",
                path: "http://export.admitad.com/ru/webmaster/websites/838792/products/export_adv_products/",
                template: "Get from Admitad",
                user: "Get from Admitad"
            ),
            RemoteShop(
                code: "Get from Admitad",
                currency: "RUB",
                feed_id: "Get from Admitad",
                format: "xml",
                last_import: "2000.01.01.00.00",
                name: "Second Shop Name",
                path: "http://export.admitad.com/ru/webmaster/websites/838792/products/export_adv_products/",
                template: "Get from Admitad",
                user: "Get from Admitad"
            ),
            // ...
        ]
    }
}

JSON Routes

Categories and offers can be filtered by a combination of parameters.

HTML Routes

Stylist should be given a subid parameter.

Installing HTML Routes

cd Views
./makelinks.sh names.txt links.txt > full_links.txt
./makehtml.sh full_links.txt > stylist.stencil

About

Server Side of Get Outfit App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published