This application is custom built for managing the Versus Virus hackathon. It is a Next.js project bootstrapped with create-next-app
.
- Dependencies
- Production Environment
- Development Environment
- Project Structure
- Database
- Conventions
- Creators
The project uses Yarn for managing all dependencies. To install all necessary Node modules execute yarn
from the root folder.
The app was manged with GitLab for the Versus Virus hackathons, but can be run with any service that supports Node.js and PostgreSQL.
The app runs on the latest LTS version of Node.js. It relies on PostgreSQL 11 and a mailserver like Nodemailer App. Note that the mail server needs to be available for sending a magic link for logging into the app.
The package.json file contains all the commands for starting the application.
Rename the .env.example
file to .env
and load it before running the dev command. For example:
npx env-cmd yarn dev
When you make changes in prisma/schema.prisma, you can create a migration by running yarn prisma:migrate:save
. Apply it to your local db with yarn prisma:migrate:up
.
A database import is not necessary for development, as Prisma will create the necessary structure.
Tests are run using Jest. Simply execture npx jest
from the command line to run.
For information on how the teams are created and how challenges are assigened, see the Readme file in the teamCreation folder.
A GraphQl tool is available on the endpoing /api/graphql
. You will need to be logged into the application as an administrator in order to execute mutations. Typical queries can be found in the file example-queries.graphql.
The working branch for production is "master". The titles of commits to master should be prefixed with a semantic description of the nature of the change. For example fix:
or feat:
. This will provide more meaning during the release process.
Code formatting is done with Prettier. The build process may fail if the format is not followed well enough.
(in alphabetical order)