The purpose of this test is to evaluate your skills in Fullstack, Backend(my choice), and/or Frontend development. You will be required to build a web application that allows users to load a CSV file with preformatted data and display the data as cards on the website. The application should also include a search bar that allows users to search for data within the loaded CSV file.
An endpoint that allows the frontend to load the CSV file. An endpoint that allows the frontend to search through the loaded CSV data. The search endpoint should accept query parameters for search terms and filters, and should return the matching results. Appropriate error handling for invalid search queries or other errors.
- The backend should be implemented as a RESTful API using Node. (Try not to use an opinionated framework such as Adonis or Nest).
- The backend must include the following endpoints:
- [POST /api/files] An endpoint that accepts a CSV file upload from the frontend and stores the data in a database or a data structure.
- [GET /api/users] Should include an endpoint that allows the frontend to search through the loaded CSV data.
- The search endpoint should accept a ?q= query parameter for search terms and should search through EVERY column of the CSV
- The backend should include appropriate error handling for invalid requests or other errors.
The project was developed using NPM, but you can use any of the managers below:
- Yarn
- PNPM
- NPM
When cloning the project run the command npm install in the terminal to install the dependencies.
Create the .env file in the root of the project to connect to the database.
To connect to the database, write the following line in the .env file: DATABASE_URL="file:./dev.db" or find the same line in the [.env.example] (./ .env.example)
To connect to the database, write the following line in the .env file: DATABASE_URL="file:./dev.db" or find the same line in the [.env.example] (./ .env.example)
Run the npx prisma migrate dev command to initialize the application database
Then run the command:npm run studio in the terminal. This will show your database using the prism layout.
If you have errors with migrate, run:npx prisma migrate reset and the migrations will be reset, then repeat the previous steps.
To run the tests run the command npm test.