Contributing to JWTPlus

Thank you for your interest in contributing to JWTPlus! Whether you're a seasoned developer or someone looking to contribute in other ways, we welcome all kinds of support. JWTPlus is an enterprise-ready JWT management platform built with Golang. Below, you'll find all the necessary steps to get started.

For Non-Technical Contributions

Even if you're not a developer, you can contribute by:

  • Writing and improving documentation (doc repo)
  • Translating documentation into different languages
  • Reporting bugs and suggesting features

For Technical Contributions

Prerequisites

Before contributing, ensure you have the following installed on your system:

  • Golang (Go 1.19+ recommended)
  • Make (to manage migrations and other tasks)
  • Docker (optional but useful for testing and running services)
1. Clone the Repository

Start by cloning the JWTPlus GitHub repository:

git clone https://github.com/jwtplus/jwtplus.git
cd jwtplus
2. Configure JWTPlus

JWTPlus requires two configuration files in development: jwtplus.yaml and dev.env

Both files are present on the top level of your source code folder.

Content of jwtplus.yaml

debug: false
server:
    ip: 0.0.0.0
    port: 2025
db:
    location: 127.0.0.1
    port: 3306
    username: jwtengine
    password: 123456
    dbname: jwtengine

Content of dev.env

DB_USER=jwtengine
DB_PASSWORD=123456
DB_HOST=127.0.0.1
DB_PORT=3306
DB_NAME=jwtengine
TEST_DB_USER=testuser
TEST_DB_PASSWORD=testpass
TEST_DB_HOST=127.0.0.1
TEST_DB_PORT=3306
TEST_DB_NAME=testdb
3. Start database using docker compose

Run the below command to start the database MySQL container, which will also include phpMyAdmin for easy database management.

Have a look at docker-compose.yaml file for more information. It's available in the top-level folder of your cloned source code.

docker compose up -d

This command will start and

  • MySql database service at 127.0.0.0:3306
  • phpMyAdmin at 127.0.0.1:8080

Security Tip: Avoid using weak passwords like 123456. Instead, generate a strong password and store it securely.

4. Import the tables (run only once)

The codes will import all the tables and generate the root key by executing the below command. Please be sure to note down the root key, as it's needed for all root-based API calls.

go run main.go install
5. Start the JWTPlus services

Use the following command to start the JWTPlus. You are now all set and you can start the coding.

make run
Submitting a Pull Request
  • Fork the repository.
  • Create a new branch (git checkout -b your-branch-name).
  • Make your changes and commit them (git commit -m "Your message").
  • Push the changes (git push origin your-branch-name).
  • Open a pull request on GitHub.
Join the Community

For discussions and support, connect with the JWTPlus community on GitHub: JWTPlus GitHub Repository

Quick Commands

The make file consists of the command which is needed to help you in your development. Below are the commands while working on the JWTPlus codes.

1. Create a New Migration

make create-migration name={your_migration_name}

2. Generate SQLC code of your SQL queries

make sqlc-generate

3. Apply Migrations on development db

make migrate-up

4. Apply Migrations on test db

make migrate-test-up

5. Rollback Last Migration on development db

make migrate-down

6. Rollback Last Migration on test db

make migrate-test-down

7. To run tests

make test

8. To run tests with coverage:

make test-coverage

9. To run app

make run

10. To build production app

make build

11. For performance analysis, use:

make benchmark