
Project facts
- Period
- August–September 2026
- Context
- Academic
- Team
- solo
- Access
- Public code and live demo
- Hosting
- Vercel, Supabase
- Role
- Survey design, Supabase schema and policies, React interface, dashboard and Excel export.
- Stack
- ReactViteTailwind CSSSupabasePostgreSQLRecharts
Contents
Summary
- For
- Administration and students of ESPA Vontovorona, an engineering school in Antananarivo.
- Problem
- The transport, consumption and waste habits of ESPA students are not measured. Decisions about campus life are made without hard data.
- Outcome
- Tested by 30 registered students (22 complete responses) as part of a course; not adopted by the ESPA administration.
Overview
Problem
ESPA Vontovorona has no figures on how its students get around, use water and energy, eat or sort their waste. Without that data, student requests and campus planning choices rest on impressions.
My contribution
Academic project built solo for a course, in August and September 2026: survey, database schema, access policies, interface, dashboard and Excel export.
Solution
For students
- A 9-step survey (transport, budget and water, food, digital, clothing, hygiene, waste, perception of the campus, general information).
- One submission per account, enforced by the database.
- Access to the survey's aggregated statistics.
For the administration
- Dashboard: registered users, complete responses, people to follow up with, response rate.
- Detailed statistics by topic, with charts.
- Multi-sheet Excel export (wide view and detailed view) and user account management.
Results
- 22complete responses out of 30 registered students (real-world test)Source · dashboard screenshot, September 2026
- 9topics in the surveySource
- 65response fieldsSource
- 10versioned SQL migrations (schema, RLS, functions)Source
- 2.08 MBof JavaScript in a single file (560 KB compressed)Source · vite build, run on Nov 13, 2026
The survey was shared with a small group of students to test it: 30 signed up and 22 filled in the whole survey. The ESPA administration did not adopt the tool. The figure of 22 dates from September 2026 and is no longer updated.
Try it
You can try the demo with the student role: create an account in the application, then fill in the survey and browse the statistics.
There is no demo admin account, for privacy reasons: that role gives access to the accounts of the students who took part in the test. The admin dashboard is shown in the screenshots in the overview (September 2026).
Technical details
Key decision
Responses stored in a JSONB column, one row per student (UNIQUE constraint on user_id).
Evolve the survey's 65 fields without schema migrations, while the database still guarantees a single submission per student.
Show technical details
Key decision and alternatives considered
- 01
- Choice
- Responses stored in a JSONB column, one row per student (UNIQUE constraint on user_id).
- Alternatives considered
- One SQL column per question, or a responses table with one row per question.
- Reason
- Evolve the survey's 65 fields without schema migrations, while the database still guarantees a single submission per student.
Architecture
Supabase provides authentication, the PostgreSQL database and avatar storage. The React application reads from and writes to Supabase directly; access is filtered by Row Level Security policies. Statistics are computed in the database by two SQL functions that only return counts: get_public_landing_kpis() for the home page, get_survey_stats() for the Statistics page. An in-memory cache and localStorage avoid reloading the home page indicators on every visit.
Security
Row Level Security is enabled on the profiles and responses tables. Who can read what, according to the policies in place:
| Role | Responses (responses) | Profiles (profiles) |
|---|---|---|
| Signed-out visitor | No rows. Only 4 aggregated indicators via get_public_landing_kpis() | None |
| Signed-in student | Create and read their own response. Per-question counts via get_survey_stats() | Read and edit their own profile |
| Admin | Read all responses | Read, edit and delete all profiles |
No policy allows a response to be edited or deleted. Example of an actual policy (initial migration; the policy name is in French in the code):
create policy "Un utilisateur cree sa propre reponse"
on public.responses for insert
with check (auth.uid() = user_id);
Admin status is checked by an is_admin() function declared security definer, which avoids infinite recursion between the profiles policies.
November 2026 fix: previously, any signed-in account could read the raw responses, because the Statistics page computed the charts in the browser. Now get_survey_stats() only returns counts, limited to the questions shown on screen: never the date of birth, exact age, field of study, year of study or free-text answers.
Testing and quality
The repository has no automated tests. Checks were done by hand.
Limitations
- 01Pseudonymization, not anonymity: each response is tied to the account ID, and an admin can link that ID to an email address.
- 02Statistics only show question-by-question breakdowns: no cross-analysis (for example, transport by gender).
- 03JavaScript ships as a single 2.08 MB file (560 KB compressed): no route-based code splitting.
- 04The demo data mode only kicks in when the responses table is empty or unreachable.
- 05No demo admin account: it would give access to the students' accounts.
Contact
Need something similar? Let’s talk.
Describe your project through the form, WhatsApp or email.