Using Neo4j Desktop to create a db locally for the project (link).
Using golang-migrate. More info here.
Run make infra-up
and run the project locally with webservice
.
Need to set environment variables:
ENVIRONMENT=
SERVICE_NAME=
SERVICE_PORT=
LOG_LEVEL=
LOG_FORMAT=
DB_URI=
DB_USER=
DB_PASS=
JWT_KEY=
Run make infra-down
or make cleanup
in the end.
Run make webservice
and make cleanup
in the end.
make lint
make run-test
make run-integration
Endpoints
-
URI: /sign-up
-
Method: POST
-
Headers: -
-
URL params: -
-
Query params: -
-
Data params:
{ "username": "username", "first_name": "First", "last_name": "Last", "email": "[email protected]", "password": "password" }
-
Responses:
- Success response:
- Code: 201 Created
- Content: -
- Code: 201 Created
- Failure response:
- Code: 400 Bad Request
- Content:
user already exists
- Code: 400 Bad Request
- Success response:
-
URI: /login
-
Method: POST
-
Headers:
X-Request-Id
- correlation id as uuidAuthorization
- Basic auth
-
URL params: -
-
Query params: -
-
Data params: -
-
Responses:
- Success response:
- Code: 200 OK
- Content: -
- Sets cookie.
- Code: 200 OK
- Failure response:
- Code: 400 Bad Request
- Content:
bad request
- If
Authorization
Header is missing.
- Code: 400 Bad Request
- Failure response:
- Code: 401 Unauthorized
- Content:
invalid username or password
- Code: 401 Unauthorized
- Success response:
-
URI: /logout
-
Method: POST
-
Headers:
X-Request-Id
- correlation id as uuid
-
URL params: -
-
Query params: -
-
Data params: -
-
Responses:
- Success response:
- Code: 200 OK
- Content: -
- Removes cookie.
- Code: 200 OK
- Success response:
-
URI: /auth/refresh
-
Method: POST
-
Headers:
X-Request-Id
- correlation id as uuid- The cookie is required.
-
URL params: -
-
Query params: -
-
Data params: -
-
Responses:
- Success response:
- Code: 200 OK
- Content: -
- Updates cookie.
- Code: 200 OK
- Failure response:
- Code: 401 Unauthorized
- Content:
unauthorized
- If the token is missing.
- Code: 401 Unauthorized
- Success response: