<?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>Forem: Armiyau Abdulhamid</title>
    <description>The latest articles on Forem by Armiyau Abdulhamid (@armi01).</description>
    <link>https://forem.com/armi01</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%2F3498062%2Fb1beb0f9-e9a3-47f7-9e78-5a5e44d05b78.png</url>
      <title>Forem: Armiyau Abdulhamid</title>
      <link>https://forem.com/armi01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/armi01"/>
    <language>en</language>
    <item>
      <title>How I Built a Todo App with Authentication using FastAPI &amp; React</title>
      <dc:creator>Armiyau Abdulhamid</dc:creator>
      <pubDate>Fri, 12 Sep 2025 19:18:26 +0000</pubDate>
      <link>https://forem.com/armi01/how-i-built-a-todo-app-with-authentication-using-fastapi-react-5068</link>
      <guid>https://forem.com/armi01/how-i-built-a-todo-app-with-authentication-using-fastapi-react-5068</guid>
      <description>&lt;p&gt;For the past few days, I’ve been working on a small project that combines two tools I’ve wanted to get better at: FastAPI (for the backend) and React (for the frontend). To keep things practical, I built a simple Todo app where users can sign up, log in, and manage their todos securely.&lt;br&gt;
This is not a “production-ready” project  it’s more of a learning project, but it covers the core things that make most apps work: authentication, protected routes, and data that belongs to each user.&lt;br&gt;
I didn’t want to just build another  static app. Authentication is usually the first “real world” challenge every developer hits when moving from tutorials to actual projects. By making a Todo app with login and signup, I forced myself to connect the dots between backend and frontend, and it was a fun way to learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech stack
&lt;/h2&gt;

&lt;p&gt;•Backend: FastAPI, passlib for hashing passwords, python-jose for JWT tokens, SQLAlchemy + PostgreSQL for storing users and todos.&lt;br&gt;
•Frontend: React (hooks + fetch), with token stored in localStorage for authenticated requests.&lt;br&gt;
•Communication: CORS middleware enabled on FastAPI so the React app can talk to it without errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the authentication works
&lt;/h2&gt;

&lt;p&gt;1.When a user signs up, their password is hashed with bcrypt (never stored in plain text).&lt;br&gt;
2.On login, FastAPI checks the password and, if valid, returns a JWT token.&lt;br&gt;
3.React saves this token in localStorage.&lt;br&gt;
4.Every API call to protected routes (like adding or deleting todos) includes that token in the headers.&lt;br&gt;
5.FastAPI verifies the token before allowing access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running the project locally&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Clone the repo and open two terminals: one for backend, one for frontend.&lt;/p&gt;

&lt;h2&gt;
  
  
  Backend:
&lt;/h2&gt;

&lt;p&gt;cd backend on windows terminal&lt;/p&gt;

&lt;p&gt;Paste: python -m venv .venv&lt;br&gt;
.venv\Scripts\activate&lt;br&gt;
pip install -r requirements.txt&lt;br&gt;
uvicorn main:app --reload&lt;/p&gt;

&lt;h2&gt;
  
  
  Front end:
&lt;/h2&gt;

&lt;p&gt;cd frontend&lt;br&gt;
npm install&lt;br&gt;
npm start&lt;/p&gt;

&lt;p&gt;Now the backend runs on localhost:8000 and frontend on localhost:3000. Sign up a new user, log in, and start adding todos.&lt;/p&gt;

&lt;p&gt;Right now the project is small.&lt;br&gt;
For now, I’m happy that it works locally and I understand every piece.&lt;/p&gt;

&lt;p&gt;Questions or feedback welcome &lt;/p&gt;

&lt;p&gt;You can check out the full code here - &lt;a href="https://github.com/armiyau1/Todo-App" rel="noopener noreferrer"&gt;https://github.com/armiyau1/Todo-App&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
      <category>python</category>
    </item>
  </channel>
</rss>
