Archer Task Logger it will be a web application to log your work, allowing you to have a list of the tasks/tickets you worked in a day.
Note: This is a little project which is in progress
My main goal for me in making this project is to use it later to log the tickets my team and I are working. Then weekly or monthly we would be able to make a report and send it to our customers.
We want an app which fit our need in a simple way. 🤓
- Customer The client who owns the project you're working on.
- Projects The projects of a customer.
- Teams A group of users who belong to a Customer and work for his projects.
- Users Each member of a team who has one or more projects to work.
This API uses the framework API Platform by Kévin Dunglas. It is based on Symfony and its main features are:
- Linked data as data representation format by JSON-ld.
- CORS headers.
- Behavior-Driven Development by the framework Behat.
- Hypermedia-driven Web API by Hydra
- Object Relational Doctrine (ORM) by doctrine
First of all, make sure you have Docker on your computer. Then, you can proceed with the following steps:
- Download the project files.
$ git clone [email protected]:darieldejesus/archer-task-logger-api.git archer-api
$ cd archer-api/
- Run Docker-Compose in order to start the project containers. It will download the required containers.
$ docker-compose up -d
- Generate the database and tables.
$ docker-compose exec web bin/console doctrine:schema:create
- At this step, the environment is already working. Just need to go to
http://localhost/app_dev.php
to see the development environment.
In order to confirm all endpoints are working as expected, you can run behat which will execute the BDD tests. You can see the files here.
- Clean the
test
environment.
$ docker-compose exec web bin/console cache:clear --env=test
- Run the tests.
$ docker-compose run --rm web vendor/bin/behat
It will execute the tests using Cucumber language (Gherkin).
This is an example of the endpoins for the User entity. Other entities like Customers, Projects and Tasks follow the same pattern.
URL | Method | Action |
---|---|---|
/users | GET | Retrieve all users |
/users | POST | Create a new user |
/users/{id} | GET | Get a user |
/users/{id} | PUT | Update a user |
Retrieve all users
Response body:
{
"@context": "/contexts/User",
"@id": "/users",
"@type": "hydra:Collection",
"hydra:member": [
{
"@id": "/users/1",
"@type": "User",
"id": 1,
"name": "Juan Perez",
"email": "[email protected]",
"status": 1,
"team": "/teams/1",
"projects": [
"/projects/1"
]
}
],
"hydra:totalItems": 1
}
Create a new user.
Request body:
{
"name": "Juan Perez",
"email": "[email protected]",
"status": 1,
"team": "/teams/1",
"projects": [
"/projects/1"
]
}
Response body:
{
"@context": "/contexts/User",
"@id": "/users/1",
"@type": "User",
"id": 1,
"name": "Juan Perez",
"email": "[email protected]",
"status": 1,
"team": "/teams/1",
"projects": [
"/projects/1"
]
}
Retrieve an existing user.
Response body:
{
"@context": "/contexts/User",
"@id": "/users/1",
"@type": "User",
"id": 1,
"name": "Juan Perez",
"email": "[email protected]",
"status": 1,
"team": "/teams/1",
"projects": [
"/projects/1"
]
}
Update an existing user.
Request body:
{
"status": "0"
}
Response body:
{
"@context": "/contexts/User",
"@id": "/users/1",
"@type": "User",
"id": 1,
"name": "Juan Perez",
"email": "[email protected]",
"status": 0,
"team": "/teams/1",
"projects": [
"/projects/1"
]
}
Created by Dariel de Jesus.