This repository contains the source code for an academic analysis and implementation of a secure digital census system. It stresses security from the beginning of the design, from user authentication, to data encryption, and audit logging. Next.js, a React framework, is used to quickly prototype the project's frontend and backend together in one place. SQLite is used for a local database to exemplify how queries should be made to the database securely. Lastly, additional packages are used for other necessary features in a secure app, such as Joi for data validation, and more.
Requirements:
- Node.js
Steps:
- from the root directory, use
npm install
to autmatically download all required node modules - create a
.env
file in the root directory of this project with the following:
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET=410EYYBwXiCOnBqEN+tQgCCKXwJvZiZ8RKNJHPLwiwc=
SECRET_KEY=xfn9P8L9rIpKtWKj68IZ3G865WfdYXNY
- next use
npm run dev
to launch the dev version of the application (sufficient for demonstration) - navigate to http://localhost:3000 to see the website live
As a random:
- navigate to http://localhost:3000
- statistics from data based on all responses is displayed
- that's it!
As a respondent:
- nagivate to http://localhost:3000/login
- enter the following credentials to sign in:
akim@gmail.com
akakak
- you will be redirected to the dashboard page if successful
- on the dashboard home page you may fill out the census response form as you wish and press the submit button at the bottom
- the page will update, thanking you for your submission, and disallowing any further submission (one response per user)
- that's it!
As an admin:
- if you have not, sign in with
akim@gmail.com
akakak
at http://localhost:3000/login - navigate to http://localhost:3000/dashboard/admin
- here the audit logs which track every request are visible to the user
- that's it!