This project is a web application that collects user information (First Name and Last Name) using a frontend built with Next.js and stores it in a PostgreSQL database via a FastAPI backend.
The US Web Design System (USWDS) https://designsystem.digital.gov/components/overview/ is used to build the user interface in a consistent and accessible way. The open-source TrussWorks React Library is used https://trussworks.github.io/react-uswds/?path=/docs/welcome--docs to implement parts of this design system.
- Python 3.11 or higher
- PostgreSQL
- Navigate to the backend directory:
cd backend
- Create a virtual environment:
python3.11 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install the required packages:
pip install -r requirements.txt
- Ensure PostgreSQL is running and create the database and table as needed. For example,
% brew install postgresql
% service postgresql start
% createdb visaapp
% psql -d visaapp
CREATE TABLE users (
id SERIAL PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL
);
- Start the FastAPI server:
uvicorn main:app --reload
- Open your browser and navigate to
http://localhost:8000
to access the application. Also can check at http://localhost:8000/docs
- Node.js and npm
- Navigate to the frontend directory:
cd frontend
- Install the required packages:
npm install
- Start the Next.js development server:
npm run dev
- Open your browser and navigate to
http://localhost:3000
to access the application.


