<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DISHA SEJPAL</title>
    <description>The latest articles on DEV Community by DISHA SEJPAL (@disha_sejpal_3185335286cb).</description>
    <link>https://dev.to/disha_sejpal_3185335286cb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3083779%2Fbb724349-803f-4228-8313-fbd40fc795b7.png</url>
      <title>DEV Community: DISHA SEJPAL</title>
      <link>https://dev.to/disha_sejpal_3185335286cb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/disha_sejpal_3185335286cb"/>
    <language>en</language>
    <item>
      <title>Dev challenge</title>
      <dc:creator>DISHA SEJPAL</dc:creator>
      <pubDate>Tue, 29 Apr 2025 14:27:27 +0000</pubDate>
      <link>https://dev.to/disha_sejpal_3185335286cb/dev-challenge-5571</link>
      <guid>https://dev.to/disha_sejpal_3185335286cb/dev-challenge-5571</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/permit_io"&gt;Permit.io Authorization Challenge&lt;/a&gt;: Permissions Redefined&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;In many applications, managing user permissions can become cumbersome when hardcoded inside the app’s logic. Permissions are usually defined in a monolithic way, leading to messy code, difficulty in updates, and sometimes security vulnerabilities.&lt;/p&gt;

&lt;p&gt;By integrating Permit.io for authorization:&lt;br&gt;
    1.  Centralized Permission Management: Permissions are stored and managed externally, making it easy to change or scale without modifying the app’s core logic.&lt;br&gt;
    2.  Dynamic Role Management: Roles and permissions can be adjusted through Permit.io’s dashboard, allowing for quick changes without touching code.&lt;br&gt;
    3.  Improved Security: Fine-grained policies ensure users can only access resources relevant to their role, helping prevent unauthorized actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Disha-Se/Task-manager-" rel="noopener noreferrer"&gt;https://github.com/Disha-Se/Task-manager-&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Repo
&lt;/h2&gt;

&lt;h2&gt;
  
  
  My Journey
&lt;/h2&gt;

&lt;p&gt;Step 1: Project Setup&lt;/p&gt;

&lt;p&gt;I started by setting up a FastAPI project with login and task routes. The API uses mock data for users and roles and handles authentication via a simple POST login endpoint.&lt;/p&gt;

&lt;p&gt;Step 2: Integrating Permit.io&lt;/p&gt;

&lt;p&gt;Using the Permit.io Python SDK, I added authorization checks using&lt;/p&gt;

&lt;p&gt;permit.check(user=role, action="create", resource="task")&lt;/p&gt;

&lt;p&gt;The permit.check() function queries Permit.io to decide if a user role is allowed to perform an action on a resource.&lt;/p&gt;

&lt;p&gt;Challenge: At first, I forgot to use async for permit.check(), which caused an error since the SDK uses async calls.&lt;br&gt;
Solution: Made all route handlers using authorization async and added await.&lt;/p&gt;

&lt;p&gt;Step 3: Adding Frontend&lt;/p&gt;

&lt;p&gt;I created a simple frontend with HTML, CSS, and JavaScript:&lt;br&gt;
    • Login screen&lt;br&gt;
    • Task creation form&lt;br&gt;
    • Task list display&lt;/p&gt;

&lt;p&gt;This frontend uses fetch() to call the FastAPI endpoints and includes a custom header (X-Username) for tracking user identity.&lt;/p&gt;

&lt;p&gt;Challenge: The frontend needed CORS setup and static file serving.&lt;br&gt;
Solution: Mounted StaticFiles from FastAPI and placed all HTML/CSS/JS in a frontend/ directory.&lt;/p&gt;

&lt;p&gt;Step 4: Deployment Preparation&lt;/p&gt;

&lt;p&gt;To make deployment smooth, I added:&lt;br&gt;
    • A render.yaml file for Render.com&lt;br&gt;
    • Instructions to connect the repo and deploy with one click&lt;/p&gt;

&lt;p&gt;Challenge: FastAPI apps require ports and environment variables configured.&lt;br&gt;
Solution: Used uvicorn with port 10000 and added an environment variable for PERMIT_API_KEY.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Permit.io for Authorization
&lt;/h2&gt;

&lt;h1&gt;
  
  
  Login to Permit (opens browser)
&lt;/h1&gt;

&lt;p&gt;permit login&lt;/p&gt;

&lt;h1&gt;
  
  
  Initialize the project (run this in the project directory)
&lt;/h1&gt;

&lt;p&gt;permit init --project task-manager --env dev&lt;/p&gt;

&lt;h1&gt;
  
  
  Create roles
&lt;/h1&gt;

&lt;p&gt;permit roles:create admin&lt;br&gt;
permit roles:create user&lt;/p&gt;

&lt;h1&gt;
  
  
  Create resource
&lt;/h1&gt;

&lt;p&gt;permit resources:create task&lt;/p&gt;

&lt;h1&gt;
  
  
  Add actions to resource
&lt;/h1&gt;

&lt;p&gt;permit actions:add task create&lt;br&gt;
permit actions:add task view&lt;/p&gt;

&lt;h1&gt;
  
  
  Grant permissions
&lt;/h1&gt;

&lt;p&gt;permit permissions:grant admin create task&lt;br&gt;
permit permissions:grant admin view task&lt;br&gt;
permit permissions:grant user create task&lt;br&gt;
permit permissions:grant user view task&lt;/p&gt;

&lt;h1&gt;
  
  
  Push changes to Permit
&lt;/h1&gt;

&lt;p&gt;permit push&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>permitchallenge</category>
      <category>webdev</category>
      <category>security</category>
    </item>
    <item>
      <title>Introducing Goal Buddy: Your Companion for Achieving Personal Goals</title>
      <dc:creator>DISHA SEJPAL</dc:creator>
      <pubDate>Thu, 24 Apr 2025 11:25:32 +0000</pubDate>
      <link>https://dev.to/disha_sejpal_3185335286cb/introducing-goal-buddy-your-companion-for-achieving-personal-goals-2hlk</link>
      <guid>https://dev.to/disha_sejpal_3185335286cb/introducing-goal-buddy-your-companion-for-achieving-personal-goals-2hlk</guid>
      <description>&lt;p&gt;Hello DEV Community! 👋&lt;/p&gt;

&lt;p&gt;I'm excited to share my latest project: Goal Buddy — a web application designed to help users set, track, and achieve their personal goals while staying organized and motivated.&lt;/p&gt;

&lt;p&gt;🎯 What is Goal Buddy?&lt;br&gt;
Goal Buddy is a productivity tool that offers:&lt;/p&gt;

&lt;p&gt;Goal Tracking: Set, update, and monitor your goals with progress check-ins.&lt;/p&gt;

&lt;p&gt;Journal Entries: Reflect on your journey with daily journaling features.&lt;/p&gt;

&lt;p&gt;Motivational Quotes: Receive a new inspirational quote each day to keep your spirits high.&lt;/p&gt;

&lt;p&gt;Dark Mode: A sleek dark mode for comfortable use during late-night sessions.&lt;/p&gt;

&lt;p&gt;🛠️ Tech Stack&lt;br&gt;
Frontend: React&lt;/p&gt;

&lt;p&gt;Backend: Firebase Firestore&lt;/p&gt;

&lt;p&gt;Authentication: Firebase Authentication with Google Sign-In&lt;/p&gt;

&lt;p&gt;Additional Features: Simple AI logic for daily motivational quotes&lt;/p&gt;

&lt;p&gt;🔗 Live Demo &amp;amp; Source Code&lt;br&gt;
Check out the live demo and explore the source code on GitHub:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/Disha-Se/GoalBuddy" rel="noopener noreferrer"&gt;https://github.com/Disha-Se/GoalBuddy&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🙋 About Me&lt;br&gt;
I'm a passionate developer who enjoys building tools that enhance productivity and personal growth. Goal Buddy is a culmination of my interests in web development and self-improvement. I'm always eager to learn and collaborate on exciting projects.&lt;/p&gt;

&lt;p&gt;Let's connect!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.linkedin.com/in/disha-s-963626260" rel="noopener noreferrer"&gt;www.linkedin.com/in/disha-s-963626260&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Disha-Se" rel="noopener noreferrer"&gt;https://github.com/Disha-Se&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>react</category>
    </item>
  </channel>
</rss>
