We're so excited you're interested in helping with SuperTokens! We are happy to help you get started, even if you don't have any previous open-source experience 😊
- Take a look at How to Contribute to an Open Source Project on GitHub
- Go through the SuperTokens Code of Conduct
- Check our Github Issues to see if someone has already answered your question.
- Join our community on Discord and feel free to ask us your questions
- OS: Linux or macOS (recommended)
- Nodejs & npm
- IDE: VSCode(recommended) or equivalent IDE
- Clone the repository:
git clone https://github.com/supertokens/create-supertokens-app
cd create-supertokens-app
- Install project dependencies
npm install
- Add the git pre-commit hook
npm run set-up-hooks
- The core functionality of the tool can be found in
lib/ts
, to make changes to the way the tool functions you can start withlib/ts/index.ts
. - After modifying the code you need to build the project:
npm run build-pretty
To add new boilerplate apps to support more tech stacks or to handle a specific use case, you first need to create a folder inside /boilerplate
.
- For frontend only stacks, create the folder inside
boilerplate/frontend
- For backend only stacks, create the folder inside
boilerplate/backend
- For stacks that provide both a frontend and backend (RedwoodJS, NextJS etc for example), create a folder in
boilerplate/fullstack
Edit the configuration of apps in lib/ts/config.ts
, by updating the array in either getFrontendOptions
or getBackendOptions
. Note that for fullstack frameworks we modify the frontend array only.
Modifying the array automatically includes the stack in the list of choices when the user is answering the question (Refer to QuestionOption
in lib/ts/types
to see how to configure each options in the list)
To add a new flag that a user can pass when using the tool, first modify the UserFlags
type in lib/ts/types
. userArguments
will contain the value of the flag, there should be no mandatory flags so make sure to have the type of the flag be optional.
Questions prompted to the user are controlled by getQuestions
in lib/ts/config.ts
. The order of the questions is determined by the order of the items in the array.
Modify the array to add/remove/reorder questions. Some questions use the previous answers, make sure to be careful of this when modifying questions.
Before you push your code make sure you have followed the project setup section and added the pre commit hooks.
After building your code you can use npx .
to run the tool locally, make sure the changes you have made work for
- Any new stacks you may have added
- Existing Frontend + Backend selection logic
- Existing full stack selection logic
If you are testing an example app you have created on your own branch, you can pass an additional flag to have the tool use your branch instead of master
Note: The branch has to actually get on GitHub first before it can be tested.
npx . --branch=your_branch
You should update the package's version following semantic versioning rules. This needs to be done in these files:
package.json
lib/ts/version.ts
- Reference the relevant issue or pull request and give a clear description of changes/features added when submitting a pull request
- Make sure the PR title follows conventional commits specification
SuperTokens is made possible by a passionate team and a strong community of developers. If you have any questions or would like to get more involved in the SuperTokens community you can check out:
Additional resources you might find useful: