The application is Running on this IP check it if you want.
To run the test, just git pull && docker-compose up
- For package manager I choose to use pipenv, it is integrated on Docker build, and on a small CI process;
- Also I choose to create two applications, one for frontend using vue.js and another for backend in Python/Flask;
- For Backend I am using OpenAPI 3.0 (Swagger) to document every endpoint;
- Algo for helping to run the project I am putting the project inside a docker-compose
- So I created 2 inner projects one for frontend with vue.js, tailwind and nginx for reverse proxy.
- For backend the container will be created based on voxy/Dockerfile, and run inside a gunicorn, it will run 4 instances, it is all configured on docker-compose yml;
- To show a small knowledge with tests, I created some tests on tests folders using pytest
- And a github action CI to run these tests with linter and coverage.
- To run the whole project just need to pull the repository and run docker-compose up, docker-compose need to be installed.
- Or you can access the application in this link
- Choosed to create two way to submit sentences, one by text input, and another to submit a text file (*.txt)
- If you just write some words on textarea and submit, it will count only words, not pontuations.
- If you choose to submit a file, frontend will load the first 200 characters and show on textarea, but will submit the whole file to backend;
- The frontend are using tailwind.css, typescript and vue.js
- I choosed to create two endpoints
- One to count words on a sentence
- Another to count words on a text file
- Both endpoints are documented by openApi
- And can be tested by API.
- The Coverage can be seen on this link
- For security and enviroments I have configured MAX_CONTENT_LENGTH
- The application on backend was builded as a package so it can scale horizontally, acordly to framework's documentation
- The application is using multiple routes, and is started as a module;
- And for better management on multiple enviroments the application has a config.py so it can have multiple configurations for test, stagging, deployment;
- It can be seen when gunicorn is run, and on create_app() like "voxy:create_app('DevConfig')"