A Curriculum Vitae (Resume) API
Note: If you have any questions or comments you can always DM me on the twitter @rbocchinfuso.
- Just for fun.
- Because I can.
- Inflight boredom and shitty United WiFi.
- Because we learn by doing.
- Because we live in an API driven world.
- The motivation for the CV API is a long story, but the key reason that I decided to build this was really driven by a desire to create a gate for those looking to inspect my CV. I wanted a way to inspect the inspector without having to do the inspection. More details on my motivations can be gleamed from a blog I published here: http://bit.ly/372imHl
- Create a JSON structure to store CV details.
- Thank you to https://jsonresume.org/ for providing an existing standard.
- Build API with Python and Flash
- Package and containerize API
- CI/CD
graph LR
A[Git Commit] -->B(Docker Hub Build)
B --> C{Decision}
C -->|Build Success| D[Watchtower pulls latest image and restarts contianer]
C -->|Build Failure| E[Watchtower leaves existing container image running]
- Plan
- Evernote: https://evernote.com/
- Trello: https://trello.com/b/9t66HNJq/cv-api
- Platform
- Linux: Ubuntu 18.04.3 LTS
- Python: Anaconda 3 ( https://www.anaconda.com/distribution/)
- Docker: https://www.docker.com/
- Code/Develop
- Codeanywhere (IDE): https://codeanywhere.com/
- My IDE of choice
- I like a consistent work from anywhere experience.
- Part of my productivity regiment.
- My IDE of choice
- autopep8: https://pypi.org/project/autopep8/
- Postman: https://www.getpostman.com/
- API testing and documentation
- JSON Editor Online: https://jsoneditoronline.org/
- Great tool for editing and validating JSON.
- StackEdit: https://stackedit.io/
- Online Markdown editor
- Codeanywhere (IDE): https://codeanywhere.com/
- Version
- GItHub: https://github.com/rbocchinfuso/cv-api.git
- DockerHub: https://hub.docker.com/
- Build
- Docker Compose: https://docs.docker.com/compose/
- Watchtower: https://containrrr.github.io/watchtower/
- Test
- pytest: https://docs.pytest.org/en/latest/
- Post HTTP Request Online: https://reqbin.com/c-est4catc
- Postman: https://www.getpostman.com/
- lgtm: https://lgtm.com/
- loader.io: https://loader.io/
- sonarcloud: https://sonarcloud.io/
- Deploy
- Docker: https://www.docker.com/
- Monitor
- Prometheus and Grafana: https://prometheus.io/docs/visualization/grafana/
- Site24x7: https://www.site24x7.com/
- Sentry: https://sentry.io/
- UptimeRobot: https://uptimerobot.com/
- Logdna: https://logdna.com/
- Slack: https://slack.com/
- Telegram: https://telegram.org/
- Deploys nginx docker container and exposes port 80
- Builds cv-api docker container from source, exposes port 5000 and creates revese proxy to cv-api from nginx contianer using virtual hostname "cv.bocchinfuso.net"
- Allows user with bearer token make a REST GET for CV data
- Run CV API GET Request
curl -H "Accept: application/json" -H "Authorization: Bearer Gj4TUbT209T0YEbmxwSZ9MgdC7AtRr6D" http://cv.bocchinfuso.net/app/api/v1.0/cv - Read the full API documentation
- Run CV API GET Request
- Integrate automated testing into the pipeline
- Add reqeust logging
- Add REST PUT for user initiated requests
- Add Pushover push notifications on REST PUT
- Integrate Sentry for error logging
- Run CV API GET Request
curl -H "Accept: application/json" -H "Authorization: Bearer Gj4TUbT209T0YEbmxwSZ9MgdC7AtRr6D" http://cv.bocchinfuso.net/app/api/v1.0/cv - Read the full API documentation
docker pull rbocchinfuso/cv-api
-
Download code from GitHub for personal use
git clone https://github.com/rbocchinfuso/cv-api.git -
Note: If you don't have Git installed you can also just grab the zip: https://github.com/rbocchinfuso/cv-api/archive/master.zip
-
Modify the cv.json file
-
Modify the config.ini (if desired, e.g. you want to update the auth token)
-
Build and deploy (attached)
docker-compose up --build -
Build and deploy (detached)
docker-compose up -d --build
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request ツ
- version 0.1 (initial release) - 2020/01/21
- version 0.2 (readme.md updates) - 2020/02/15
- version 0.3 (refactored preso-as-code using Mark) - 2020/06/10
Rich Bocchinfuso <rbocchinfuso@gmail.com>
MIT License
Copyright (c) [2020] [Richard J. Bocchinfuso]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
