2025 Discover Program Project Templates
This template was created by the DISC tech leads of 2024-2025:
Check out DISC:
npm i
If you are contributing to this repo, you must make sure ALL your code is
formatted according to our eslint.config.mjs and .prettierrc.json configs.
The best way to make sure you are always sticking to our guidelines is by having
prettier & eslint automatically format your code when you save.
Here's how to set that up:
-
If you are using VSCode, do the following:
- Install the Prettier ESLint VSCode extension
- Install the ESLint VSCode extension
- Restart VSCode completely (quit app and reopen).
-
If you are NOT using VSCode, either use VSCode or you'll have to figure out how to format-on-save on your own.
Find more details about our linting config here
npm run dev
Launch the test runner in interactive watch mode:
npm test
Start the server in production mode:
npm start
Feel free to modify stuff inside the src directory or the README:
├── src
│ ├── config // configuration files
│ │ └── supabase.js // database configuration
│ ├── controllers // business logic
│ │ └── authController.js // authentication logic
│ ├── middleware // request processing
│ │ └── authMiddleware.js // authentication middleware
│ ├── routes // API endpoints
│ │ └── authRoutes.js // authentication routes
│ └── server.js // main server file
└── README.md // project documentationEverything else: DO NOT TOUCH!!!
- many of these are modified as side-effects of normal development, that's okay
- just never modify these directly
├── node_modules // external libraries and dependencies
├── eslint.config.mjs // linting config
├── package-lock.json // detailed description of the entire dependency tree
└── package.json // project dependenciesWe enforce the following rules across all of our code.
Code that deviates is always flagged as an error.
- Always have semicolons at the end of expressions
- Single quotes only
- Line widths around 80, wrapping everything including prose
- Code has a tab width of 2. Editor displays a tab size of 2.
- Imports
- Unused imports are not allowed
- Relative import paths are only permitted if the imported file is inside the
same directory. In all other cases, absolute paths only.
srcis the base directory for absolute import paths. - Imports are roughly bundled into 3 groups, in this order:
- Node.js built-in modules (e.g., "fs", "path")
- third party modules (things that dont fit other rules)
- absolute paths in
src(begin withconfig,controllers, etc.) - relative paths (begin with
.or/)
- Within each import group, imports are sorted alphabetically
- Line of space between each import group
- If importing multiple things from one file, items imported are sorted alphabetically
- Imports that don't exist are not allowed
- Plus the default rules in the following eslint plugins:
- js plugin recommended
- import plugin errors
- prettier plugin recommended
This project uses Express.js as the web application framework.
We use Prettier and ESLint with various plugins to handle code formatting.
We use Supabase as our database and authentication provider.
For testing, we use Jest as our testing framework.
Nodemon is used for automatic server restarts during development.