SundeepChand's Blog

Weekly Check-In | GSOC'21 | #3

SundeepChand
Published: 06/21/2021

Hey Folks! I hope you're doing well.

What did I do this week?

This week the PR to seed the strapi server in test environment got merged. However, after merging it we realised that there were certain issues with my approach of creating the docker images. Basically, the issue was with the way I had tagged the images, so I've submitted a PR fixing the issue. I also updated the previously written Cypress tests, to use the newly seeded data. Once, the docker image setup is fixed this week, we would be all set to write more tests, & run them in github actions.

Apart from that, I also worked on implementing the request templates feature. Creating the strapi collection for this and setting up it on the frontend was simple. However, one of the challenging part is to add the support for custom placeholder text in CKEditor, about which I am researching a bit.

What is coming up next?

I will add the support for custom placeholder in template text. After that I will be updating the test suite, to include some of the newly added features. I will also try to add the shareable search results feature.

Did I get stuck anywhere?

I was stuck in figuring out the implementation of placeholder text, in request templates. I implemented a hacky solution for this, and after discussing about this with my mentors, the general conclusion was that it can be made better. So I spent some time learning the architecture of CKEditor and how to configure it. So far, I have figured out some of the bits and pieces that will be used to implement the feature, and now its time to put it all together.


Next week I will be sharing more about the final implementation request templates feature. So that's all for this blog post, thank you for reading.

View Blog Post

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