An open API service indexing awesome lists of open source software.

https://github.com/shubhambansal1997/xeneta-backend


https://github.com/shubhambansal1997/xeneta-backend

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

xeneta
==============================

__Version:__ 0.0.0

Xenta Assignment

## Getting up and running

Minimum requirements: **pip, python3.9, poetry, redis & [PostgreSQL 11][install-postgres]**, setup is tested on Mac OSX only.

```
brew install python3 poetry libmagic postgres
```

[install-postgres]: http://www.gotealeaf.com/blog/how-to-install-postgresql-on-a-mac

In your terminal, type or copy-paste the following:

git clone [email protected]:ShubhamBansal1997/xeneta-backend.git; cd xeneta-backend; make install

Go grab a cup of coffee, we bake your hot development machine.

Useful commands:

- `make run` - start [django server](http://localhost:8000/)
- `make deploy_docs` - deploy docs to server
- `make test` - run the test locally with ipdb
- `make docker` - build and run docker containers [django server](http://localhost:1337/) [__Preferred__]

API:

curl --location --request GET 'http://localhost:1337/api/ports/rates?date_to=2016-01-10&date_from=2016-01-01&origin=CNGGZ&destination=NOKRS'
Imp. Directory:

xeneta/portapi/*

**NOTE:** Checkout `Makefile` for all the options available and how they do it.

## Managing dependencies

### Poetry

To guarantee repeatable installations, all project dependencies are managed using [Poetry](https://python-poetry.org/). The project’s direct dependencies are listed in `pyproject.toml`.
Running `poetry lock` generates `poetry.lock` which has all versions pinned.

You can install Poetry by using `pip install --pre poetry` or by following the official installation guide [here](https://github.com/python-poetry/poetry#installation).

*Tip:* We recommend that you use this workflow and keep `pyproject.toml` as well as `poetry.lock` under version control to make sure all computers and environments run exactly the same code.

### Other tools

For compatibility, `requirements.txt` and `requirements_dev.txt` can be updated by running

```bash
poetry export --without-hashes -f requirements.txt -o requirements.txt
```

and

```bash
poetry export --without-hashes -f requirements.txt -o requirements_dev.txt --with dev
```

, respectively.

## Deploying Project

The deployment are managed via travis, but for the first time you'll need to set the configuration values on each of the server.

Check out detailed server setup instruction [here](docs/backend/server_config.md).

## How to release xeneta

Execute the following commands:

```
git checkout master
make test
bump2version patch # 'patch' can be replaced with 'minor' or 'major'
git push origin master
git push origin master --tags
git checkout qa
git rebase master
git push origin qa
```

## Contributing

Golden Rule:

> Anything in **master** is always **deployable**.

Avoid working on `master` branch, create a new branch with meaningful name, send pull request asap. Be vocal!

Refer to [CONTRIBUTING.md][contributing]

[contributing]: http://github.com/ShubhamBansal1997/xeneta-backend/tree/master/CONTRIBUTING.md