SundeepChand's Blog

Weekly Blog Post | GSOC'21 | #2

SundeepChand
Published: 06/13/2021

Hi Everyone!

The first week of coding period flew by in almost no time and we are here, about to start the second week.

Implementing Search Feature

Coming to the work I did this week, I finished implementing the stories search feature. This provides our users the facility to search for stories by title and by the author name as well. To implement the search by title feature, I used the Title_contains filter provided by the Strapi GraphQL API. This filter basically takes an input string and returns all those stories whose title contains the input string as a sub-string. The resulting stories fetched are then updated on the frontend. To implement search by story author, I had to perform two steps: first, search the author by username as the user types in, by using a approach similar to the one mentioned earlier, and recommend them to the user. Second, once the user finds the author name, search for all the stories created by that particular author and return them. Again Strapi provides queries in its GraphQL API to perform these kinds of filtering. To implement the user suggestion on the front-end, I created a custom React component that makes API requests to the back-end to fetch the user info and displays them. I also used the axios.CancelToken to cancel the older, unfinished requests as the client makes newer ones, so as to reduce the load on server.
So here is the link to the PR: Implement Search

Setting up Github Actions to run Cypress tests

Apart from that I also worked on setting up Github Actions to run Cypress tests for the front-end. However, the challenging part in this was to seed the database to run the end-to-end tests. So for that, I worked on a script that automatically seeds the database with some sample data when strapi starts-up. Finally, we can create a Docker image of this strapi server and use it to run the end-to-end tests in Github Actions CI pipeline. Below are the links to the corresponding PRs.

I will get these reviewed by my mentors this week and work on getting these merged, so that we can start writing the tests. Also I will start working on the request templates feature this week. So that's all for this blog post.

Happy coding!!

View Blog Post

Weekly Check-In | GSOC'21 | #1

SundeepChand
Published: 06/08/2021

Hello World!

I am Sundeep Chand, a Computer Engineering sophomore at Delhi Technological University. India. I am super-excited that I will be collaborating with our fantastic team of mentors and student developers, in contributing features to the EOS User Story Project.

What did I do this week?

After the kick-off meeting, we worked on migrating the projects from GitLab to GitHub. And my role was to configure GitHub Actions for the EOS User Story Project, to run the tests and deploy the website to GitHub Pages, as well as for the EOS Strapi project, to create a docker image of the strapi backend and upload it to the GitHub Container Registry. So I spent some time learning about GitHub Actions. Then I worked on migrating my Pull Requests from GitLab to GitHub. And the rest of my time was spent in collaborating with my GSOC partner, Harshita, in planning the execution of tasks and setting up the project board.

What is coming up next?

I will be working on implementing the search feature for the stories, which will include search by story title and search by author name. I will also be implementing the corresponding unit/end-to-end tests in Cypress.

Did I get stuck anywhere?

When I tried to introduce caching for node_modules in GitHub Actions, so that it does not install the node_modules again and again, I faced a strange issue that the cache did not work properly. After going through a few blog posts on caching I was able to solve the issue.

So that's all for this blog post. Looking forward to have a great time contributing new features to the EOS User Story project.

Thank you for reading!!

View Blog Post