Coder Social home page Coder Social logo

test-task's Introduction

Test task

This is a solution for a test task v21.0.5.

Get started

Requirements

Installation

Clone this repository

git clone [email protected]:OleksiiBulba/test-task.git .

Run make commands to build and start containers:

make build # can take ~5-15 minutes
make up

When the containers are built, you need to run composer install:

make install # or
make vendor

then yarn install and build js. You can use yarn on your system:

yarn install
yarn build # production
yarn dev # development

or use node container:

make yarn c='install'
make yarn c='build' # production
make yarn c='dev' # development
# -- or simpler --
make build-front # production

Also, you have to create .env.local file in the root of the project and copy there your rapid API key:

# .env.local
RAPID_API_KEY=<your_key_here>

Refresh containers and/or cache:

make restart # stops & ups containers
make cc # symfony clear:cache command

After everything is built, installed and up, you can go to https://localhost/ and see the application running. You also will see a link in the navigation menu to a maildev to see outgoing emails.

Testing

To run tests:

make test

This command will run:

  • Composer normalize command;
  • Composer validate with strict command;
  • Statics tests:
    • phpstan;
    • php-cs-fixer with dry run option;
  • Unit and functional tests:
    • Clear test env cache;
    • phpunit with coverage option;

After phpunit coverage test you will find html-coverage folder, you can open html-coverage/index.html to check the project test coverage: its 100%.

To stop the project, run

make down

Troubleshooting

To see what containers are running, run:

docker compose ps -a

In case of troubleshooting, you can see container logs:

docker compose logs <container>

Also all available commands are shown by

make help

Task item list:

  • Display a form with elements: symbol, start date, end date and email;
  • Upon submit, validate the form on frontend and display validation error messages;
  • Upon submit, validate the form on backend and display validation error messages;
  • After the submitting, display on screen the historical quotes for the submitted Company Symbol in the given date range in the table format;
  • Table should have: Date | Open | High | Low | Close | Volume;
  • Based on the Historical data retrieved, display on screen a chart of the Open and Close prices;
  • Send to the submitted Email an email message, using as: Subject: the submitted company’s name, Body: Start Date and End Date;
  • Framework used is Symfony 6.2.*;
  • Tests present;
  • The user can select date range using similar to jQuery datepicker element: native input[type="date"];
  • The chart library anychart is used;
  • The project does not require to make changes to /etc/hosts or C:\Windows\System32\drivers\etc\hosts file, you just need to make sure nothing is running on port 443 and start the project, it should be available at https://localhost/ (you might need to accept the auto-generated TLS certificate to open the page). Maildev should be available at http://localhost:8081/;
  • The project uses docker and compose for running (Symfony docker setup is used: https://github.com/dunglas/symfony-docker);
  • 100% phpunit tests coverage;
  • Heavily used DI so many parts can be decorated, adapted, replaced;

Start: 2023-04-24 09:50AM (UTC+4)
End: 2023-04-26 01:47AM (UTC+4)
Duration: 39h 57m

Author

Oleksii Bulba [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.