-
Fork the repository (https://help.github.com/articles/fork-a-repo/)
-
Clone the repository to your local machine (https://help.github.com/articles/cloning-a-repository/)
git clone git@github.com:[username]/rsschool-app.git -
Navigate into the directory where you've cloned the source code and install NPM dependencies
cd rsschool-app npm install -
Create a branch for your feature. Prefix the branch with your GitHub Username. Example:
git checkout -b AlreadyBored/feature-x mastergit checkout -b <username>/feature-x master -
The application requires a connection to a Postgres database. Here is how to get test database running locally:
Run a Postgres Database locally using Podman & podman-compose
npm run db:upRestore a test database snapshot
npm run db:restoreIf you are done with development, stop the database;
npm run db:down -
Run the application in development mode with live reload:
npm start -
Do hacking 👩💻👨💻
-
You could specify any environment variable during development using
.envfile. Make a copy ofserver/.env.exampleandnestjs/.env.exampleand rename it toserver/.envornestjs/.envrespectively. We support it viadotenvpackage. More information about usage here: https://github.com/motdotla/dotenv -
By default locally, you will be logged with
adminaccess. If you want to change it, need to setRSSCHOOL_AUTH_DEV_ADMINtofalseinnestjs/.envfileIMPORTANT: Never commit changes to
.envfile -
Do not forget to write unit-tests for your feature following Unit-Tests Style Guide. We use Jest for unit-tests.
-
Write end-to-end tests for your feature if applicable. Please see
client/specsdirectory for more information. We use Playwright for end-to-end tests. You can run them usingnpm run test:e2ecommand and they supposed to work against test database snapshot. -
Make sure tests, lints pass and code formatted properly (they'll be run on a git pre-commit hook too)
npm test npm run lint npm run pretty -
Commit your changes using a descriptive commit message that follows our Commit Message Conventions
git commit -m "feat: implement feature X" -
Push your branch to GitHub:
git push origin <username>/feature-x -
Create a pull request. We support "feature branch" deployments. If you want to deploy your pull request, please add
deploylabel during creation.
We use OpenAPI Generator to generate API client for NestJS API. Here are steps how to do it:
-
Make sure database is running locally
-
Navigate to
./nestjs -
Run
npm run openapi
-
Commit updated files (
/client/src/api/*and./nestjs/src/spec.json)
NOTE: in case of problems with running openapi you might need to install Java or use some other way from OpenAPI Generator Installation docs
If you made changes to DB models, you need to create a DB migration. Here are steps how to do it
- Go to
/server - Run
npm run typeorm:migration:generate src/migrations/{MigrationName}where{MigrationName}is your migration name. - Import your migration to
migrationsarray at./server/src/migrations/index.ts - Commit and push your changes
See more about TypeORM migrations at official docs Migrations
- Branch name must be prefixed with your GitHub Username. Example:
AlreadyBored/feature-x. For LLM agents, useagent/prefix. Example:agent/feature-x. - Check how to create a Pull Request (PR).
- PR titles must follow Conventional Commits.
- Do not include issue IDs in the PR title.
- Use GitHub's Draft PR feature instead of using "WIP" (Work In Progress) in the title.
- Consider adding relevant
area:*label(s) to your PR. - Add the
deploylabel if you want the PR deployed to the staging environment. NOTE: This feature does not work for PRs opened from forks due to security limitations. - Write a clear and meaningful description for your PR.
- Include screenshots and animated GIFs in your PR description whenever possible to demonstrate changes.
- Use Conventional Commits format
- Allowed Types:
- build: - changes that affect the build system or external dependencies (example scopes: npm, webpack)
- ci: - changes to our CI configuration files and scripts (example scopes: drone)
- docs: - documentation only changes
- feat: - a new feature
- fix: - a bug fix
- perf: - a code change that improves performance
- refactor: - a code change that neither fixes a bug nor adds a feature
- style: - changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: - adding missing tests or correcting existing tests
- Use the present tense ("add feature" not "added feature")
- Use the imperative mood ("move cursor to..." not "moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line