Smart Brain is a full-stack AI face detection application that lets users register, sign in, submit image URLs, detect faces, and track their image submission count.
The app demonstrates a complete full-stack request flow: React frontend, Express API, PostgreSQL database, secure password handling, server-side Clarifai integration, and dynamic face box rendering in the browser.
- 👉 Frontend Repo: smart-brain
- 👉 Backend API: smart-brain-api
- 👉 Live Demo: smartbrain.brandonmay.dev
Watch the project walkthrough:
Smart Brain is more than a UI-only demo. It shows how a frontend, backend, database, and third-party AI service work together in one application.
This project demonstrates:
- Building a responsive React frontend
- Designing and consuming RESTful API endpoints
- Implementing user registration and sign-in flows
- Hashing passwords securely on the backend
- Persisting user data with PostgreSQL
- Sending protected server-side requests to Clarifai
- Translating AI response data into visual UI output
- Managing environment configuration for local and deployed setups
- Full-stack authentication flow
- PostgreSQL-backed user persistence
- Server-side Clarifai API integration
- Real-time face box rendering on submitted images
- User-specific image submission tracking
- Separate frontend and backend repositories
- Environment-based deployment configuration
- Allows users to register and sign in
- Accepts a public image URL from the user
- Sends the image URL to the backend for processing
- Uses Clarifai’s face detection model to analyze the image
- Renders a bounding box around the detected face
- Updates and displays the user’s image submission count
- React 19 – component-based UI development
- Vite – fast development server and optimized builds
- JavaScript ES6+
- Tachyons – utility-first CSS styling
- particles-bg – animated background effects
- react-parallax-tilt – interactive UI enhancement
- Node.js – JavaScript runtime
- Express – REST API routing and server logic
- PostgreSQL – relational database for user data
- Knex – SQL query builder
- bcryptjs – password hashing and authentication
- Clarifai API – AI face detection model
- User registers, signs in, or submits an image URL
- Frontend sends the request to the Express backend
- Backend validates the request and interacts with PostgreSQL when needed
- For image detection, the backend sends the image URL to Clarifai
- Clarifai returns face detection coordinates
- Backend sends the response data back to the frontend
- React calculates the bounding box position based on the rendered image size
- UI displays the face box and updates the user’s image submission count
POST /register– create a new userPOST /signin– authenticate an existing userPOST /imageurl– send image URL to Clarifai through the backendPUT /image– update the user’s image submission countGET /profile/:id– retrieve user profile data
In the backend repo:
cd ../smart-brain-api
npm installCreate a .env file:
CLARIFAI_PAT=your_clarifai_pat
DB_HOST=127.0.0.1
DB_PORT=5432
DB_NAME=smart-brain
DB_USER=your_postgres_user
DB_PASSWORD=your_postgres_password
PORT=3001Run the backend:
npm run devThe backend runs at:
http://localhost:3001
In this repo:
npm installCreate a .env file:
VITE_API_URL=http://localhost:3001Run the frontend:
npm run dev- The frontend is deployed at
smartbrain.brandonmay.dev - The backend API is deployed separately
- Clarifai credentials are stored on the backend, not exposed in the frontend
- The frontend uses
VITE_API_URLto connect to the backend API - Backend CORS settings must allow the deployed frontend domain
- Building a React frontend around a real backend API
- Separating frontend and backend responsibilities
- Implementing authentication and secure password handling
- Working with PostgreSQL data persistence
- Protecting third-party API credentials on the server
- Transforming AI response data into dynamic UI rendering
- Managing local and production environment variables
- Deploying a full-stack application across separate services
- Add loading, empty, and error states
- Support multiple detected faces per image
- Add automated tests for auth and API workflows
- Improve form validation and user feedback
- Add database migrations and seed files in the backend repo
- Refactor backend routes into controllers and services
- Add rate limiting and centralized error handling
I’m Brandon May, a full-stack developer and Computer Science student focused on building clean, reliable web applications with practical frontend and backend workflows.
I’m currently seeking frontend, full-stack, contract, and remote-friendly developer opportunities.
- GitHub: github.com/brandonmay-dev
- LinkedIn: linkedin.com/in/brandonmaydev