The Form App is a full-stack web application that allows users to:
- Build customizable forms with various field types (e.g., text, boolean, datetime).
- Save and view the created forms.
- Submit responses to the created forms.
This project demonstrates a full-stack implementation using modern web development practices, including a TypeScript-based backend (Fastify, Prisma, PostgreSQL) and a frontend built with Angular.
- Node.js (v16+ recommended)
- Docker and Docker Compose
- Angular CLI (for frontend development)
git clone https://github.com/daniel-slocum/form-app.git
cd form-app- Navigate to the
apidirectory:cd api - Copy the
.env.examplefile to.env:cp .env.example .env
- Build and start the backend services using Docker:
docker compose build docker compose up
- Run database migrations:
npm run migrate
- Seed the database with example data:
npm run seed
The backend will be available at http://localhost:8080.
- Navigate to the
clientdirectory:cd client - Install dependencies:
npm install
- Start the development server:
npm start
The frontend will be available at http://localhost:4200.
- Form Builder: Accessible at
http://localhost:4200/forms/builder- Allows users to create and customize forms with various field types (e.g., text, boolean, datetime).
- Form Viewer: Accessible at
http://localhost:4200/forms/viewer/:formId- Displays a form based on its ID and allows users to submit responses.
- API Endpoints:
- Form:
POST /form: Create a new form.GET /form/:id: Fetch a form by its ID.
- Source Record:
POST /source-record: Create a source record with associated source data.
- Form:
- API Documentation:
- Swagger documentation is available at
http://localhost:8080/docs.
- Swagger documentation is available at
- Backend (
api/):- Built with Fastify, Prisma, and PostgreSQL.
- Handles form and source record management.
- Frontend (
client/):- Built with Angular.
- Provides a user interface for building and viewing forms.
Given more time, the following features and improvements would be implemented:
- API Authentication:
- Add authentication and authorization to secure API endpoints.
- UI Enhancements:
- Add a page to list all created forms.
- Add a page to view submitted responses for a form.
- Form Reset Bug:
- Fix the issue where resetting the form displays validation errors.
- Error Handling:
- Improve error handling and user feedback for API failures.
- Deployment:
- Deploy the application to a cloud platform (e.g., Heroku, Vercel, Netlify) for public access.
This project is licensed under the MIT License.