This repo is for the coding exercise proposed by Couchsurfing team.
Instructions
- Create a new repo on github.com and push the exercise once complete
- Please complete the following without leveraging code interpreter, copilot, etc.. to complete the key parts of the exercise. We want to see your style coming through.
- Complete the exercise in whatever language you feel most comfortable in
- Please limit the scope to the ask as much as possible and no more than 2 hours.
- Reply to the email once complete with the link to the repo within 2 to 3 days.
Create a basic REST API that runs as a docker container and does the following:
- Has a resource that is a user ✅
- User should have an attribute that describes its relationship to other uses (think friends) ✅
- Seeds user data (static list or DB whichever is preferred) ✅
- Serves CRUD endpoints for the user resource ✅
- Has an additional endpoint that finds the relationship distance from one user to another user (this user is a 2nd, 3rd, distance relationship) ✅
- Create Github project
- Start NestJS Project
- Configure Docker with Neo4J and NestJS API
- Add neo4J package, configure Module and test connection
- Seed Route
- Test query
- Create User Route
- Add Class-validator
- Update User Route
- Add User Connection Route
- Delete User Route
- Remove User Connection Route
- Connection Distance Route
- User Connections Route
- APIary Docs
- ReadME to run project
Some routes are not develoo for avoid timing consuming
First, clone the project from Github:
$ git clone [email protected]:eduardoguilarducci/couchsurfing-social.git
Then, on the root folder of the project, run docker-compose to build up, generate images and run the apps:
$ docker-compose up
WARNING: If its the first time that you run the docker images, You WILL receive an error: The client is unauthorized due to authentication failure.
It happens because of the Neo4J security and best practices to avoid using the default password in production.
Go to your brower and navigate to:
http://localhost:7474/browser/ and change the password to 'abc12345678'
The default user and password: 'neo4j' | 'neo4j'
After that, the app will be up and running
Call the '/app/setup' route, to populate neo4j database with initial records to make this.
Now everything looks good:
Routes available at collection attached to the e-mail ;)
- Author - Eduardo Guilarducci