QuizMe is a flashcard webapp that makes studying for tests easier and more fun!
-> Available at quizme.naspoapps.com
It first started as a university project of mine which I took a step further and decided to make it an actual deployed side-project of mine.
- Create flashcards.
- Create topics to categorize flashcards.
- Quiz yourself on the flashcards you made.
- Quizzes can be timed or not.
Steps from /client
- Build the project:
npm run build - Deploy the static files on a web server.
Steps from /server
Step 1: Build the docker image
docker build -t naspo/quizme-server:<tag> .
The tag should be the version number of the application.
Step 2: Push the image
Push the docker image to the docker hub.
docker push naspo/quizme-server:<tag>
Step 3: Pull the image
Pull the image on the server.
docker image pull naspo/quizme-server:<tag>
Step 4: Create .env file
Create a .env file containing the following properties:
PROD_DB_HOST=
PROD_DB_PORT=
PROD_DB_USER=
PROD_DB_PASSWORD=
PROD_DB_NAME=
NODE_ENV=production
This .env file will be passed to the docker container when we run the image.
(The .env file must be kept private and should not be committed to version control).
Step 5: Run the image in a container
docker run -d -p 3000:3000 --name quizme-server --env-file path/to/.env --restart unless-stopped --add-host=host.docker.internal:host-gateway naspo/quizme-server:<tag>
Note for the above command: QuizMe's database is deployed on the same server, so host.docker.internal is used to access the host machine. However this doesn't implicitly work on Linux so a mapping is created, hence the --add-host flag.