Quiz app built with NextJS, styled-components, and SQLite
First, you need to set the necessary environment variables:
GOOGLE_CLIENT_ID
- Google client ID (necessary for auth); find it in the "Credentials" section of the Google ConsoleGOOGLE_CLIENT_SECRET
- Google client secretNEXTAUTH_SECRET
- A random string, preferably 16 bytes, used to hash JWTs (handled by thenext-auth
package)NEXTAUTH_URL
- set this to your project's domain (or you will be redirected incorrectly)SUBSCRIPTION_KEY
- the subscription key for the Microsoft Speech API (used for tamil audio)ADMINS
- a JSON array of admin emails (e.g.["email@example.com']
)
For production:
npm run build # if project isn't yet built
npm start
Development mode:
npm run dev
There are 6 root directories:
assets
- contains assets that will be imported to React componentscomponents
- this contains reusable components from the projectpages
- a required NextJS directory for file-system routingpublic
- assets you wish to be exposed by the server are stored hereserver
- this directory contains all the server-side logic for this project
Misc files:
next.config.js
- custom config for the nextjs appjsconfig.json
- used to configure import aliases (e.g.import xyz from "@/api/xyz"
instead ofimport xyz from "../../api/xyz"
)
This project uses SQLite as the database, and because this project doesn't rely on an API server, you can deploy your entire project just by running only this app!
The code is commented where comments are due, so go ahead! Remix and play around.
MIT
This project was written by @codergautam with special thanks to @codingjlu