Welcome to the CRISP (Classroom Repository Interaction and Status Platform) developer guide. We appreciate your interest in contributing to our project! This guide will help you get started with setting up the project, making changes, and submitting those changes for review.
CRISP utilises a MERN (MongoDB, Express.js, React, Node.js) stack and follows a monorepo structure with the following main folders:
multi-git-dashboard - Next.js frontend applicationbackend - Express.js API server with MongoDBshared - Shared TypeScript types and utilitiesBefore you begin, make sure you have the following installed:
NextAuth with Credentials provider. Session-based auth protects most routes. Public routes: home, auth, and guide pages.
REST API built with Express. Routes are organized by domain (accounts, courses, assessments, etc.). MongoDB + Mongoose for data persistence.
Octokit for GitHub API. Used for repository access, PR data, and code analysis. Requires GitHub tokens in environment config.
git clone https://github.com/NUS-CRISP/CRISP.git
Environment Setup: Copy each package's .env.example to .env.development. The example files already contain the full key list; use the notes below to understand what each key is for. Feel free to contact current developers for clarifications/specific credentials.
Frontend environment (multi-git-dashboard/.env.example):
GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY: GitHub App credentials used by the app's GitHub integration flows. See GitHub App documentation for more details.MONGODB_URI: MongoDB connection string for the frontend's server-side data access.DB_NAME: crispNEXTAUTH_SECRET, NEXTAUTH_URL: NextAuth session secret and frontend base URL (http://localhost:3002) for auth callbacks.NODE_ENV: Runtime environment, set as development for local development.NEXT_PUBLIC_DOMAIN: localhostNEXT_PUBLIC_BACKEND_PORT: 3002BACKEND_PORT: 3003TELEGRAM_BOT_NAME, TELEGRAM_BOT_HANDLE: If you need to test the Telegram bot during development, you can set these to your own Telegram bot name and handle after creating one using @BotFather.Backend environment (backend/.env.example):
GITHUB_APP_ID: GitHub App credentials used by the app's GitHub integration flows. See GitHub App documentation for more details.GITHUB_APP_PRIVATE_KEY, GITHUB_APP_INSTALLATION_ID: GitHub App credentials and installation ID used for backend GitHub API access. Contact current developers for credentials.MONGODB_URI: mongodb://localhost:27017/crispPORT: 3003RUN_JOB_NOW: Set to true to run scheduled jobs immediately on startup.NEXTAUTH_SECRET: Generated key from local terminal: openssl rand -base64 32NEXTAUTH_TOKEN_HEADER: next-auth.session-tokenGOOGLE_CLIENT_EMAIL: crisp-web@rising-solstice-414305.iam.gserviceaccount.comGOOGLE_PRIVATE_KEY: Contact current developers for credentials.FRONTEND_URI: http://localhost:3002CLIENT_ID, CLIENT_SECRET: OAuth credentials for Jira integration. Contact current developers for credentials.SONAR_URI: `http://localhost:9000SONAR_TOKEN: SonarQube server URL and access token used by code analysis jobs. Contact current developers for credentials.SONAR_PATH, REPO_PATH: Sonar scanner path and local repository base path used during analysis runs.AI_TOKEN: API token used by the AI insights job. Contact current developers for credentials.TEST_EMAIL_ON_NOTIFICATION_JOB_START:, RUN_NOTIFICATION_JOB: Flags for testing email and notification job. Default to false.SMTP_SERVICE, SMTP_USER, SMTP_PASS: SMTP credentials for outgoing email. Contact current developers for credentials if necessary.TEST_TO_EMAIL: Recipient for notification test emails.TELEGRAM_BOT_TOKEN: If you need to test the Telegram bot during development, you can set this to your own Telegram bot token after creating one using @BotFather.Install: Navigate to both multi-git-dashboard and backend directories and run npm install.
You may choose to run the system manually or using Docker.
npm install in both the frontend and backend directories.npm run dev in both directories simultaneously.docker compose up --build -d to startdocker compose down to stop.http://localhost.To deploy in SoC Staging VM (using Docker):
sudo -sdocker compose downgit fetchgit pulldocker compose up --build -dTo deploy in SoC Production VM (using Docker):
sudo -ssudo rebootdocker compose downsudo lsof -i :27017sudo lsof -i :80sudo kill -9 <pid> Kill any running instances of MongoDB and NGINX.cd CRISPgit fetchgit pulldocker compose up --build -ddocker ps to view all running containers.docker logs <id> to view the logs of a specific container.
where <id> is the respective container ID: multi-git-dashboard, backend, mongo, nginx.docker system prune -a --volumes and delete old course repos from /sadm/home/Repositories/.docker start sonarqube.docker compose down and docker compose up again.docker compose down and reboot the VM.Write clear and detailed commit messages. A commit message consists of a header, a body, and a footer. The header has a special format that includes a type, a scope, and a subject:
<type>(<optional scope>): <description>
<optional body>
<optional footer>
Types:
feat: Commits that add or remove a new featurefix: Commits that fix a bugrefactor: Commits that rewrite/restructure your code, however does not change any API behaviourperf: Commits that improve performancestyle: Commits that do not affect the meaning (white-space, formatting, missing semi-colons, etc)test: Commits that add missing tests or correcting existing testsdocs: Commits that affect documentation onlybuild: Commits that affect build components like build tool, ci pipeline, dependencies, project version, ...ops: Commits that affect operational components like infrastructure, deployment, backup, recovery, ...chore: Miscellaneous commits e.g. modifying .gitignoreOnce you're ready to share your contributions, follow these steps to submit a Pull Request using the forking workflow:
Create a New Branch: Create a new branch for your changes based on the main branch on your GitHub fork.
git checkout -b feature/my-new-feature main
Make Your Changes: Implement your feature or fix and commit your changes using the provided format.
Keep Your Branch Updated: Regularly pull the latest changes from the upstream repository and merge them into your branch to keep it up to date.
git fetch upstream
git rebase upstream/main
Run the code formatter: Run the Prettier script in both the frontend and the backend
cd multi-git-dashboard
npm run prettier-format
cd ../backend
npm run prettier-format
Push Your Changes: Push your branch and changes to your GitHub fork.
git push origin feature/my-new-feature
Open a Pull Request (PR): Go to your fork on GitHub and create a new Pull Request against the staging branch of the upstream repository. Make sure to fill out the Pull Request Template with the necessary details.
To connect to the VM DB using MongoDB Compass:
admin.For end-user documentation, see the User Guide. Check the README in each package for more detailed setup instructions. Feel free to contact the CRISP team at crisp@nus.edu.sg for any clarifications or feedback.