- Use NestJs to create a restful-API using the db scheme and the endpoint description in the AppIndex
- Try not to use the ORM for serialization and making the query.
- Use custom validation pipe /decorators
- Document how to fire up the project.
$ npm install
In db scheme folder contains slq for import in your database.# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prodThe database structure should be the following:
Id primary key
username
password
id primary key
userId forgien key (User)
addressId forgien key (Address)
name
id primary key
cityId forgien key (City)
street
id primary key
countryId
name
id primary key
name
Feel free to initialize the city and country tables for simplicity.
The API's endpoints:
GET Return a relevant user profile given a valid JWT token in a Authorization header with following structure
{
"id":1,
"name":"Juan Luis",
"address":{
"street": "Dam square",
"city":"Amsterdam",
"country":"Netherlands"
}
}