DEV Community

Cover image for Weekly Planner - API
Thea
Thea

Posted on

Weekly Planner - API

This is a submission for the GitHub Copilot Challenge : New Beginnings

What I Built

I built a Planner API using Node.js and Express to manage planner data, offering a RESTful interface for interacting with resources like calendars and tasks. The API includes user authentication and authorization with JWT (JSON Web Tokens) and Passport.js, allowing users to register, log in, and manage their calendars and tasks securely. It ensures robust data validation and integrates with MongoDB for storage, using Mongoose for object data modeling.

This project was created as part of the GitHub Copilot 1-Day Build Challenge, inspired by the prompt "New Beginnings". My initial idea was to create a weekly planner to support New Year resolutions and the concept of "New Habits," aligning with the "New Beginnings" prompt. The planner was intended to help users organize their goals and start the year with a fresh, structured approach. To make this concept more accessible, I decided to build an API that could support the front-end, allowing users to manage their planner from anywhere. However, due to time limitations, I focused solely on developing the API and didn't have the opportunity to create the client-side application. The API serves as the foundation for what would have been a fully functional planner, allowing for future integration with a front-end interface.

Demo

All endpoints were tested using POSTMAN
The endpoints were all tested using POSTMAN.

Repo

Planner API

Copilot Experience

My experience with Copilot has been both delightful and frustrating.

Copilot chat prompt and result

With the help of Copilot, setting up the foundation for the project became much faster. It streamlined the process by eliminating the first step of initialization, reducing the typical two-step setup to just one. Additionally, Copilot assisted in quickly setting up the file structure with a well-organized format, ensuring a clean and efficient project organization right from the start.

Copilot autocompletion
Another convenience of Copilot is autocompletion. It reduces the need to type everything out, but it's important to carefully review the suggestions. In my experience, the AI often provided results using "calendars" when I intended to use "calendar." While this may seem like a small difference, in the world of coding, it can lead to completely different outcomes.

However, Copilot may not be very novice-friendly in certain aspects. For instance, to gain more practice, it's often better to type out the code manually, word by word. When you choose not to accept a suggestion and continue typing, the AI's autocompletion disappears, which can be both beneficial and challenging. As a beginner, this feature encourages me to code independently and reduces reliance on AI. However, when I’m unsure about what to write and need guidance, it can be frustrating when the suggestion disappears. In such cases, I need to go back, accept the suggestion, and type it out again.

For more experienced coders, though, this autocompletion could be a highly convenient tool, speeding up coding and reducing repetitive tasks.

Image description
The Copilot Chat window (in-editor) is more convenient to use than the Copilot Chat (sidebar) because it focuses directly on the code you requested or the specific fix you asked for. While the sidebar chat in GitHub Copilot is useful when you need the AI to reference or work across multiple files, it can also be inefficient. This is because the AI often provides responses that include entire sections of code from multiple files, even when only small changes are necessary. For instance, if you only need to fix specific lines in a couple of files, the AI might give you extensive code from the entire file, including sections that don't require modification. This redundancy means you have to manually sift through the information to find the exact changes needed, which can be time-consuming and less focused.

Image description
In addition, following the three "S" principles from Copilot tutorials can be challenging. When I try to keep the prompt short and simple, I often find that it isn't specific enough for the AI to provide the answer I’m looking for. As a result, my prompts tend to be longer, or I have to give multiple short prompts to get the desired response.

GitHub Models

No GitHub Models were used in this project.

Conclusion

Despite all the challenges mentioned above, I still find Copilot to be an incredibly useful partner in coding—like that one friend who insists on giving you advice, even when it’s not exactly what you asked for, but somehow still manages to steer you in the right direction. Sure, it might take a few extra prompts to get there, but it’s like having a coding sidekick who’s always there to help, even if they sometimes go a little off-script. Ultimately, Copilot's ability to assist with code suggestions, solve problems, and speed up development still makes it an invaluable tool—quirks and all.

Will I be using Copilot in my future projects? Probably not. The reason is simple: I want to have more practice and avoid becoming too reliant on AI. While Copilot is a great tool, I believe it’s important to build my skills by coding independently and solving problems on my own. After all, nothing beats the satisfaction of debugging your own code!

Contributor

Yours truly,
Thea Win
Portfolio | GitHub | LinkedIn | X

Top comments (0)