This document is an overview of the project structure, along with guides on other good-to-know items.
Most of what you will need will be under the app folder.
app
├── assets # Contains all images
└── icons # Contains all icons
├── components # Contains all components
├── helpers # Helper functions
├── lib # Lib import to merge tailwind functions
└── routes # All physical pages are stored within here
└── data.tsx # Data page
└── newsletter.tsx # Our Newsletter page
└── people.tsx # Who We Are page
└── research.tsx # Resources page
└── starter.tsx # Home page
├── app.css # Global CSS file
├── root.tsx # Project root
├── routes.ts # Defined React Router routes
The Express backend, which was migrated to Vercel-compatible serverless functions can be found under the api folder.
- /api/newsletters.js for fetching Mailchimp campaigns (Our Newsletter page)
- /api/add-contact.js for newsletter subscriptions (Our Newsletter page)
- /api/ci/[which].js for Clear Impact data (Data page)
To test your code, you need to run two commands in two separate terminals.
In one terminal, run npm start. This will start the backend.
In the other terminal, run npm run dev. This will start the frontend and provide you with the local host link.
All report cards can be found in the Resources page. The code can be found under app/routes/research.tsx.
To add a new card simply copy and paste this code and change the
title, summary, button text, and onClick link respectively. To add a new report pdf, you first need to add
it under app/assets as a new .pdf file. Then you need to import it at the top of app/routes/research.tsx.
<ReportCard
title="UNC-CH Color of Drinking Project"
summary="The Color of Drinking survey at UNC-Chapel Hill revealed that students, particularly LGBTQ+ individuals and students of color, face disproportionate mental health and safety harms from the campus alcohol culture despite drinking less than their white, non-LGBTQ+ peers."
buttonText="View Report"
onClick={() => {
openPDF(report3);
}}
/>