This repo contains a simple app - web based book manager - made as a recruitment process task.
- Create a simple web based book manager (Task 1), code in master branch.
- Create extra functionality (Task 2) on top of Task 1 in separate branch.
- Focus on demonstrating your coding and architectural design skills.
- Choose a language/framework/libraries, but don't use templates, starter packs etc.
- Automated tests on a provided test server are very appreciated but optional.
- Store books in a database
- Title
- Author
- Description
- Number of pages
- Date the book was added to db
- User interface
- List all entries
- Add & Delete entries
- Click an entry to view & update details
- It's ok to cut corners on login/accounts/UI
Book entry has a button to generate a url link. Link can be copied and sent by emial. This link gives access for 5 minutes to a particular entry from Book Manager database.
- The link is valid just for 5 minutes.
- The link gives access only to one entry, not to all books from book manager.
- Python 3.7 🐍
- Flask
- SQLAlchemy
- WTForms
Below instructions are prepared for MS Windows with git bash used as a terminal shell.
The whole functionality of this app is not located in master branch (yet). Instead of that, it is located in task_2 branch. To clone task_2 branch to your local:
$ git clone https://github.com/mihalw28/book_manager.git --branch task_2 --single_branch <new-folder-to-create>
$ cd <new-folder-to-create>
Next set up and activate virtual environment:
$ python -m venv venv
$ source venv/scripts/activate
Install dependencies and set up env variables
$ pip install -r requirements.txt
$ export FLASK_APP=book_manager.py
$ export SECRET_KEY=something_secret
For more convenience it is a common practise to store environment variables in seperate file. More info.
$ flask db migrate
$ flask db upgrade
Fire up the app
$ flask run
And finally check http://127.0.0.1:5000/ in your web browser
$ python -m unittest discover
To deploy app like this one with relatively small amount of configuration shouldn't be difficult. There are many websites offering these type of services. Among them:
- AWS with its Elastic Beanstalk or Lightsail
- Heroku
- PythonAnywhere