A clean, simple and responsive web application built with Python, FastAPI and Jinja2 templates
This project began as my attempt to complete the Day 29 exercise from the 30 Days of Python challenge, which focused on building a simple Flask app and deploying it to Heroku.
However, I quickly found myself drifting far beyond the original scope. Instead of Flask, I chose to build with FastAPI for its modern features, performance, and automatic API documentation. I also decided to keep all data storage local, avoiding the need to create external accounts for services like Heroku or MongoDB. This allowed me to focus purely on the code and create a self-contained, locally-run learning environment.
- Interactive Text Analyzer: Analyzes character count, word count, sentence count, and most frequent words.
- Student Management System: Add and view students via a user-friendly form; data accessible via JSON API.
- Responsive Design: Clean layout that works on desktop and mobile.
- Polished UI: Carefully styled forms, buttons, and typography for a professional look.
- Dual Interface:
- User-friendly HTML forms for web visitors.
- RESTful JSON API endpoint for developers.
Page | Description |
---|---|
/ |
Home page with tech stack breakdown |
/about |
About Us page |
/post |
Text Analyzer with input and processing |
/students |
Form to add a new student |
/students/list |
View all students (HTML) |
/api/students/ |
JSON API endpoint (opens in new tab) |
- Backend: FastAPI (Python)
- Frontend: HTML5, CSS3, Jinja2 Templates
- Styling: Pure CSS with responsive design
- Data Handling: In-memory list (persists during runtime)
TextAndStudentAPI/
│
├── main.py
├── static/
│ └── css/
│ └── main.css
├── templates/
│ ├── layout.html # Base template with shared header
│ ├── home.html
│ ├── about.html
│ ├── post.html # Text Analyzer form
│ ├── result.html # Analysis results
│ ├── students.html
│ └── add_student.html # Add Student form
├── requirements.txt
└── README.md
- Counts characters, words, and sentences.
- Identifies the most frequent word.
- Add Student Form:
- Clean, vertical layout with labels above inputs.
- Fields: Name, DOB (with calendar input), Country, City, Skills, Bio.
- Date input uses native
type="date"
for calendar popup.
- View Students:
/students/list
shows all students in a styled HTML list./api/students/
exposes data as JSON (opens in new tab viatarget="_blank"
).
- Header includes:
- Home
- About
- Text Analyzer
- Add Student
- API (opens in new tab)
- All links use consistent styling and hover effects.
-
Install dependencies:
pip install -r requirements.txt
-
Run the server:
uvicorn main:app --reload
or
fastapi dev main.py
-
Open as localhost: http://127.0.0.1:8000
- Data is stored in memory students:
list[Student]
resets on server restart. - No database used (lightweight demo).
- CSS is hand-written with no external frameworks.
- I may end up adding more functionalities at some point in the future.
- Designed for learning and testing.