This is an application to manage Electric vehicle chargning stations. It also provides the ability to find multiple stations that belogs to different companies.
- Fully isolated and dockerized application
- Infrastructure level logs(Web server logs)
- Quality assured by having different test types (Feature/Unit)
- Descriptive API documentation powered by Swagger
There are two ways to run the application. Both of them start by cloning the repository into your local machine.
Clone this repository to your local machine using the following command:
git clone git@github.com:khanzadimahdi/virta.git
There is a .env.example
file in the project root directory containing OS level environment variables that are used for deploying the whole application.
Every single variable inside the file has a default value, so you do not need to change them; But you can also override your own variables. First copy the example file to the .env
file:
cd /path-to-project
cp .env.example .env
Then open your favorite text editor like vim
or nano
and change the variables.
For the first time you need to do some initial setup. It can be done by running following command:
make setup
then (by default configs) the API will be exposed on http://127.0.0.1:80 and swagger document is available on http://127.0.0.1:8080
you can also take a look at wiki/swagger.yaml
for API details.
there is a simple UI (api consumer) and by default exposes on http://127.0.0.1:8000
Open Terminal
and type the following command:
make up
or
docker-compose up -d
seed database using one of these ways:
-
make seed
-
docker-compose exec web seed
Make a ssh connection to the web
container using one of these ways:
-
make bash
-
docker-compose exec web bash
Connect to the web
container via ssh as described in the step above.
Run the following command to generate swagger documentation:
Inside container:
openapi ./app -o wiki/swagger.yaml
Outside container:
make openapi
Github Ci exists on the below address
https://github.com/khanzadimahdi/virta/actions
This project includes seven docker containers as follows. It is under development, So the source code is mounted from the host to containers. On production environment you should remove these volumes.
web
php:8.0.14-apache
mysql
mysql:8.0.27
redis
redis:6.2.6-alpine3.15
mailhog
mailhog/mailhog:latest
swagger
swaggerapi/swagger-ui