This application was developed to assist individuals with intestinal conditions, such as Crohn's disease, who need to relearn their dietary habits after diagnosis. It enables users to test their favorite foods to determine if they are safe for consumption.
By maintaining simple lists of safe and unsafe foods, the app simplifies the creation of tailored meal plans and structured diets. This is my first complete personal project, built independently from the ground up.
This is the link for the production demo: https://rcu-app-frontend.onrender.com/
- Secure Login: JWT-based authentication system.
- User Registration: Ability to create new user or admin accounts.
- Protected Routes: Role-based access control (User vs. Admin) to secure endpoints and views.
- HTTP Interceptors: Axios is configured to automatically include the auth token in all requests.
- Create Entries: Add new food entries with name, quantity, and date.
- Safety Status: Mark foods as
is_safe: trueoris_safe: falseafter a testing period. - View Lists: Display dynamically filtered lists of all "Safe" and "Unsafe" foods.
- CRUD Operations: Full ability to edit and delete existing food entries.
- Health Tracking: Log other critical information that may affect symptoms, including:
- Medication intake
- Exercise activity
- Alcohol consumption
- Unusual food consumption
- Symptom details
- Dashboard Stats: View total counts of safe and unsafe foods.
- Time-Based Filtering: See statistics for different time periods (e.g., last 7 or 30 days).
- Mobile-First: A clean, single-column layout optimized for small screens (
<= 480px). - Tablet View: A two-column layout for medium-sized screens (
481px - 768px). - Desktop View: A full, multi-column layout for larger screens (
>= 769px).
| Category | Technology | Description |
|---|---|---|
| Frontend | React 19 | Core UI library. |
| TypeScript | Static typing for JavaScript. | |
| React Router | Client-side routing and navigation. | |
| Vite | Next-generation frontend build tool. | |
| State Mgmt | Context API | Built-in state management. |
| HTTP Client | Axios | Promise-based HTTP client for requests. |
| Backend | FastAPI | High-performance Python API framework. |
| SQLite | Serverless, self-contained database engine. | |
| Authentication | JWT / python-jose |
Secure token-based authentication. |
passlib[bcrypt] |
Secure password hashing. | |
| Deployment | Render | Cloud platform for deploying web apps. |
Follow these instructions to get a copy of the project up and running on your local machine for development and testing.
First, clone the repository and set up the backend server.
# Clone the repository (if you haven't)
git clone https://github.com/your-username/rcu-app.git
cd rcu-app
# Navigate to the backend directory (adjust if needed)
# cd backend/
# Install Python dependencies
pip install fastapi uvicorn sqlalchemy "python-jose[cryptography]" "passlib[bcrypt]"
# Run the FastAPI server
# This will start the server on http://localhost:8000
uvicorn main:app --host 0.0.0.0 --port 8000Note: Ensure your auth.db (SQLite database) is initialized as per your backend's logic (FastAPI/SQLAlchemy models).
In a separate terminal, navigate to the frontend directory and install its dependencies.
# Navigate to the frontend app
cd frontend/my-react-app
# Install npm packages
npm install
# Run the frontend development server
# This will start the app on http://localhost:5173 (or similar)
npm run devThe application should now be running and connected to your local backend.
This project is configured for easy deployment on Render.
The repository includes a render.yaml file. You can deploy both the frontend and backend automatically by following these steps:
- Push your code to your GitHub repository.
- In the Render Dashboard, create a new Blueprint.
- Select your repository.
- Render will read the
render.yamlfile and automatically configure the services. - Click "Apply" to deploy.
For more detailed instructions, see DEPLOYMENT.md.
- Build Frontend:
cd frontend/my-react-app npm run build - Serve the static files from the
dist/folder using a static host. - Deploy the backend (FastAPI application) to a service like Render, ensuring the frontend has the correct API URL.
The application supports two distinct user roles with different permissions.
- Can create, view, edit, and delete their own food entries.
- Can view their personal safe/unsafe food lists.
- Can view their personal statistics.
- Has all capabilities of a regular user.
- Can view, edit, and delete all food entries in the system.
- Can update the safety status of any food entry.
- AI Agent: Implement an AI-powered agent to suggest a food's likely safety status based on web research and user-provided symptom patterns.
- Notifications: Add a notification system to remind users 24 hours after logging a new food to confirm its safety status.
- Advanced Health Tracking: Build out the UI and database models for the planned medication, exercise, alcohol, and symptom tracking features.
Contributions are welcome! If you'd like to help improve the Nutrition Assistant, please follow these steps:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.