Boostan (IKIU food reserve), fluent and responsive client.
- Beautiful and responsive design
- Get foods and reserved list
- Get credit amount
- Reserve food
- Get forgotten code
- Change theme based on user telegram theme settings
- Support Multi-sessions, and the user is always logged in
- Manage sessions and device infos
- Enable/Disable requests logging
- Set rate limit
- Different operating modes including: Block, Whitelist, and normal mode
- Telegram alert settings
- Change any alerts and error messages from the admin panel
- Multi language support see locale
- Statistics
We used several frameworks and services for doing our job perfect:
- Django - We used Django for our backend
- Redis - Database memory caching
- PostgreSql - SQL based database
- Telegram web-app-bot - Better user experience
- JavaScript - Dynamic UI
- jQuery - Easy to use
- Twitter Bootstrap - Great UI boilerplate for modern and responsive web apps
- Heroku - Deployment
- Sentry - Error tracking for both Django/JS
- Google analytics - For users analysis
If you want to pass CI/CD and auto deploy after each commit, you should add the below secrets to your GitHub repo secret lists. Instructions on how to use them in your application are linked below.
KEY | VALUE |
---|---|
BOOSTAN_USERNAME | Boostan username (for testing) (optional) |
BOOSTAN_PASSWORD | Boostan password (for testing) (optional) |
HEROKU_API_KEY | Your heroku API_KEY |
HEROKU_APP_NAME | Your heroku app name |
HEROKU_EMAIL | Your heroku account email |
Install the dependencies, migrate and start the server.
$ pip install -r requirements/local.txt
$ python manage.py migrate
$ python manage.py loaddefaults
$ python manage.py runserver
-
To create a superuser account, use this command:
$ python manage.py createsuperuser
You should install telegram beta and enable inspect element in experimental settings more detail Telegram doc.
We should use HTTPS for debugging our app with the telegram, so we have to make and install our certificates. So we should install MkCert (See detail Mkcert repo).
Now create the certificates with this command:
$ mkcert -cert-file cert.pem -key-file key.pem 0.0.0.0 localhost 127.0.0.1 ::1
Replace 0.0.0.0, localhost, 127.0.0.1 with the domains you’ll be running locally.
cert.pem and key.pem files will be created in your current working directory. you can replace them whichever names you wish.
but since we shall be running them in Django, copy them to the same folder as manage.py
Run below command to add certificates to browser trusted certificates list.
$ mkcert -install
Then you can run project with this command:
$ python manage.py runsslserver --certificate cert.pem --key key.pem
Running type checks with mypy:
$ mypy boostan
To run the tests, check your test coverage, and generate an HTML coverage report:
$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html
(optional) If you want to test with credentials and cover more code testing, you can set your username and password in env variables.
$ export BOOSTAN_USERNAME="YOUR_USERNAME"
$ export BOOSTAN_PASSWORD="YOUR_PASSWORD"
$ python manage.py test api
The following section details how to deploy this application:
Instructions on how to use them in your application are linked below.
See detailed django Heroku.
KEY | VALUE |
---|---|
DJANGO_SECRET_KEY | $(openssl rand -base64 64) |
WEB_CONCURRENCY | 4 |
DJANGO_DEBUG | False |
DJANGO_SETTINGS_MODULE | config.settings.production |
PYTHONHASHSEED | random |
DJANGO_ADMIN_URL | RANDOM_STRING/ |
DJANGO_ALLOWED_HOSTS | YOUR_DOMAIN |
DJANGO_ACCOUNT_ALLOW_REGISTRATION | False |
REDIS_URL | Your redis url (for memcache) (free redis sever redis cloud) |
REDIS_SASL_PASSWORD | Redis SASL password |
REDIS_SASL_USERNAME | Redis SASL username |
SENTRY_DSN | Your sentry error tracker DSN code (See detail sentry django doc) |
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py loaddefaults
$ python manage.py runserver
Click below button for easy deploy to heroku!
GPL-3.0 license
Free Software, Hell Yeah!