Nukr - The new business social media
- docker ~ 18.04.0-ce
- docker-compose ~ 1.21.1
First clone of the project
docker-compose up
*~ Tip: using the docker-compose you can add -d
and you can keep with your terminal ~*
Wait until the build is finished and the database service has finished creating the database.
now you can execute any program inside the server with command like it.
docker-compose exec api lein eastword
Migrations are managed by migratus to begin working initially run both:
$ docker-compose exec api lein migratus migrate
$ docker-compose exec api lein with-profile test migratus migrate
$ docker-compose exec api lein run -m nukr.server 3000
Now you can take a look at http://0.0.0.0:3000/spec
$ curl -X POST \
http://localhost:3000/api/v1/user \
-H 'Content-Type: application/json' \
-d '{
"email":"emaisl@test.com",
"username":"usernasdasdame12",
"password":"123456789"
}'
$ curl -X GET http://usernasdasdame12:123456789@localhost:3000/api/v1/auth
Tip: if you will use 'curl' put the token in a environment variable, if you have jq installed follow the command
ACCESS_TOKEN=$(curl -X GET -s "http://usernasdasdame12:123456789@localhost:3000/api/v1/auth" | jq .token | tr -d '"')
$ curl -X GET \
http://localhost:3000/api/v1/user/connection-suggestions \
-H "Authorization: Token $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"page": 1,
"per-page": 10
}'
$ docker-compose exec api lein eastword
$ docker-compose exec api lein test
NOTE Test will fail the first run after migrations due to a duplicate key.
The HTML documentation can generated locally with docker-compose exec api lein doc
the output will be
saved in doc/api
.
$ docker-compose up -d # raises the database, and clojure server with lein repl active on port: 12345
$ docker-compose exec api lein migratus migrate
$ docker-compose exec api lein with-profile test migratus migrate
$ docker-compose exec api lein run -m nukr.server 3000