Skip to content

LuciusFaraday/tsarka-node-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Test Task: Tech Assignment

Objective

Create a simple CRUD application with authentication based on JWT using Express.js, GraphQL, and Jest.

Stack

  • Express.js: A fast and minimalist web application framework for Node.js.
  • GraphQL: A query language for APIs and a runtime for executing those queries with your existing data.
  • Jest: A JavaScript testing framework for Node.js applications.

Instructions

  1. Set up a new Express.js project with the necessary dependencies.
  2. Create a GraphQL schema that defines the data structure for the CRUD operations.
  3. Implement the GraphQL resolvers to handle the defined operations.
  4. Set up an Express.js server to handle incoming requests and connect it to the GraphQL schema.
  5. Implement authentication using JSON Web Tokens (JWT) for user registration, login, and access control to protected routes.
  6. Implement the following CRUD operations for a specific entity (e.g., User, Product, Task, etc.):
    • Create: Allow authenticated users to create new entities.
    • Read: Allow both authenticated and unauthenticated users to retrieve entity data.
    • Update: Allow authenticated users to update existing entities.
    • Delete: Allow authenticated users to delete entities.
  7. Write unit tests for the server and authentication logic using Jest to ensure their functionality and security.

Requirements

  1. The GraphQL schema should include the necessary types and fields for the CRUD operations.
  2. Implement authentication using JWT for user registration, login, and token-based access control to protected routes.
  3. Ensure that the server properly handles authentication errors and returns appropriate responses.
  4. Write at least five unit tests to cover the functionality of the server and authentication logic using Jest.
  5. The unit tests should cover various scenarios, including successful and error cases for CRUD operations and authentication.
  6. Use proper code organization and adhere to best practices for security and error handling.

Submission

  1. Create a new GitHub repository and initialize it with your project.
  2. Commit your code regularly and push it to the repository.
  3. Include a README file with instructions on how to run the server, execute the tests, and demonstrate the CRUD operations with authentication.
  4. Share the GitHub repository URL with the person who assigned you this task.

Note: Feel free to use any additional libraries or tools you find necessary to complete the assignment effectively.

Good luck!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published