GlassForm is a full-stack web application that pairs a React frontend with an Express backend. The frontend provides a polished user experience and client-side form validation, while the backend handles submission storage and serves the built application in production.
- Modern React UI with client-side routing
- Animated welcome screen and details form
- Form validation for name, email, and bio fields
- Express API endpoint for user submissions
- Local persistence to
submissions.txt - Production static serving from
dist
- Node.js: Backend runtime
- Express: API and static file server
- React: Frontend UI library
- React Router DOM: Navigation between pages
- Vite: React build and development tool
- TypeScript: Strongly typed React components
- Nodemon: Backend auto-reload during development
- User opens the app in the browser.
- React renders the application using
src/App.tsx. - Client-side routing displays either:
/→Welcomepage/details→Detailsform page
Details.tsxcaptures user input and validates form values.- Once valid, the form submits data via
fetch()to the backend API.
- Express starts from
app.js. express.json()parses incoming JSON bodies.- Static files are served from the
distdirectory. POST /api/user-datareceives user form data.- The backend appends a timestamped record to
submissions.txt. - For non-API GET routes, Express returns
dist/index.html, enabling React Router to handle navigation.
npm installnpm run devnpm run buildnpm startnpm run clientNote:
npm startserves thedistdirectory, so build the frontend first.
- Endpoint:
POST /api/user-data - Request body:
name(string)email(string)bio(string)
- Response:
{ status: "success" }on successful save - Data is appended to
submissions.txt
app.js- Express backend serverpackage.json- Scripts and dependenciestsconfig.json- TypeScript settingsvite.config.ts- Vite configurationsrc/App.tsx- Route definitions for Reactsrc/components/Welcome.tsx- Landing page UIsrc/components/Details.tsx- Form page and validationsrc/index.css- Global styling and effectssubmissions.txt- Saved form submissions
namemust not be empty.emailmust not be empty and must follow a simple email pattern.biomust not be empty.
Invalid fields show inline error messages, and the submit button stays disabled until the form is valid.
This project is a simple full-stack app built with React, TypeScript, Vite, and Express. The frontend handles user interaction and validation, while the backend receives submissions and saves them to a local file. The app is designed for easy local development and deployment with static file serving in production.