https://github.com/michelpl/stock-api
https://github.com/michelpl/stock-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/michelpl/stock-api
- Owner: michelpl
- Created: 2023-03-13T14:38:19.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T19:25:25.000Z (almost 2 years ago)
- Last Synced: 2025-01-14T16:07:01.391Z (5 months ago)
- Language: PHP
- Size: 1.37 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐งช Stock API
[](https://app.getpostman.com/run-collection/#)
## Api doc
[Api documentation](https://documenter.getpostman.com/view/#)## ๐ Sequence diagram
## โฌ๏ธ Dependencies
* ``Docker`` 19.03.5+
* ``Docker Compose`` 1.23.1+## Make sure the following ports are avaliable in your server
* ``Port 8000`` For Backend API
* ``Port 3306`` For database## ๐ Building the environment
Clone this repository
```bash
https://github.com/michelpl/stock-api.git
```Enter in repository folder
```bash
cd hiring-challenge
```Run de follwing command
```bash
make install
```## ๐ Building the environment (manually)
Clone this repository
```bash
https://github.com/michelpl/stock-api.git
```Enter in repository folder
```bash
cd hiring-challenge
```Create the .env file
Use .env.example as example
```bash
cp src/.env.example src/.env
```Running services
```bash
docker-compose up -d
```
Get the composer dependencies```bash
docker-compose exec webapi composer update -vvv
```Running Laravel migrations
```bash
docker-compose exec webapi php artisan migrate
```## โช๏ธ Stoping services
```bash
make stop
```or
```bash
docker-compose down
```## ๐ Running Scheduled Tasks Manually
```bash
docker-compose exec webapi php artisan schedule:run
```## The Hiring Challenge API will be avaliable on
```bash
http://localhost:8000/api/V1
```## ๐งโ๐ป Consuming the API
[](https://app.getpostman.com/run-collection/#)
## ๐งโ๐ป Development environment
For changing project files in your machine, you need to run the following permissons
```bash
$ find src/ -type d -exec chmod 775 {} \;
$ find src/ -type f -exec chmod 664 {} \;
$ chown -R www-data:$USER src
```or
```bash
make permissions
```## โ Running tests
```bash
make test
```or
```bash
docker exec -it webapi php artisan test
```## ๐ Logs
You can find all the api logs on ``src/storage/logs``
Or just executing the following command
```bash
make show_logs
```