An Application to support TAs on helping people find their ideal job
princesa
is a service built on top of Servant and Persistent
To run the test suite, simply execute
stack test
To run the application proceed as following
First we need to start up our db (Postgres) by firing up the docker container, like so
docker-compose -f ./assets/docker-compose.yml up -d
If you need to enter the started db you need to execute the following
docker exec -it postgres_container psql -U princesa
Finally we can start up our application by executing
stack run
One aspect of the application is that it mantains 2 different clients
- one for CLI (called Cli)
- another one for HTTP (called Normal) We can run each of them by doing
stack run -- "--appMode=Cli"
or
stack run -- "--appMode=Normal"
respectively
To build the application and create the executable you need to run the following
stack build
To clean up built stuff just run
stack clean
If you need to load up all the application in the REPL execute the following on your terminal
stack ghci
Is strongly recomended to have ghcid running during your development cycle
ghcid
Hurray !!
Here comes the fun part:
Since now we have our application up and running we can start playing around with it.
Let's try out the following http calls
These are the basic endpoints to manage the jobs module
curl http://localhost:8081/jobs
curl -X POST http://localhost:8081/jobs -H 'Content-Type: application/json' -d '{"jobId": { "getJobId" : 1}, "jobDescription": "hola princesa"}'
curl http://localhost:8081/jobs/1
These are the basic endpoints to manage the candidates module
curl http://localhost:8081/candidates
curl -X POST http://localhost:8081/candidates -H 'Content-Type: application/json' -d '{"candidateId": { "getCandidateId" : 1}, "candidateDescription": "hola princesa"}'
curl http://localhost:8081/candidates/1