(forked from https://github.com/matter-app/take-home-exercise-backend)
🎉 Welcome to the Zymego take-home coding exercise! 🎉
This backend exercise is designed to take about 3 hours for someone familiar with Node.js
and Express
. Additionally, GraphQL
will be a major part of this exercise. We do not expect you to know anything about GraphQL
prior to taking this exercise. We'd be happier if you ended up learning something new out of this exercise.
There are many different ways to complete this exercise. We wanted to keep it open ended and give you some creative freedom. As such, even though you don't need to, you may install and use any extra npm package.
- The exercise requires Node.js to be installed. We use v18 and recommend using either the same or the LTS version.
- In the repo root directory, run
npm install
to gather all dependencies. - Next, run
npm run setup
. This will set up a local SQLite database, and add some seed data. This database will live in a local file nameddatabase.sqlite3
. - Then run
npm run watch
. This should start the server in development mode.
If you've never heard of GraphQL
, don't worry — you'll be able to learn it in no time! You don't need to go deep and learn everything about it.
For starters, 👉 go through this tutorial 👈 and you'll learn all the basic skills necessary to complete this exercise.
- The server is running with nodemon, which will automatically restart for you when you modify and save a file.
- The database provider is SQLite, which will store data in a local file called
database.sqlite3
. - The database client is Sequelize. For any database operation, you should only have to interact with
Sequelize
. - You will be implementing a GraphQL server. We have set up Apollo Express Server and GraphQL Playground for you.
- You will be building a simple support ticket tracker. In this exercise, a
ticket
is defined as a task that has atitle
. The ticket is eithercompleted
orincomplete
at any given time. It has a recursive structure, meaning that it may havechildren
tickets. Those children tickets may further have children tickets of their own, and so on. For example:
{
"title": "first ticket",
"isCompleted": false,
"children": [
{
"title": "second ticket",
"isCompleted": true,
"children": []
},
{
"title": "third ticket",
"isCompleted": false,
"children": [
{
"title": "fourth ticket",
"isCompleted": true,
"children": [///...]
}
]
}
]
}
- Your task is building the backend
GraphQL
api to maintain this system. You will be coding theGraphQL
resolvers that successfully implement thetypedefs
we have provided. - We also created the
Ticket
model. Even though it is not necessary, you may modify this model as you wish. Inserver.js
, you'll see one example usage of said model.
- ❗️ Make sure you commit all changes to the master branch!
- Please commit regularily, so we can understand your thought process
- Don't worry about performance. We won't deduct points for big-O runtime or space efficiency.
- Take your time. Prioritize correctness, and show us how you usually code in a production setting.
- To start, go to http://localhost:4001/graphql. This will pull up a GUI called GraphQL Playground that lets you fire
GraphQL
queries against your api.
When you have finished the assignment, run the following command:
git bundle create take-home-exercise.bundle HEAD main
This generates a bundle file called take-home-exercise
based on your local master branch. Return that file to us via email, and we'll review your code within a few days days and will get in touch with you.
Thank you and good luck! 🙏