First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to this project. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
-
Clone the repository:
git clone https://github.com/your-repo/stellarAid-api.git cd stellarAid-api -
Install dependencies:
npm install
-
Set up your environment variables:
Create a
.envfile in the root of the project and add the required environment variables. You can use the.env.examplefile as a template.cp .env.example .env
-
Run the development server:
npm run start:dev
Make sure to set the following environment variables in your .env file:
DATABASE_URL=
JWT_SECRET=
JWT_REFRESH_SECRET=
REDIS_URL=
STELLAR_NETWORK=
PLATFORM_WALLET_SECRET=
SENDGRID_API_KEY=
AWS_S3_BUCKET=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
WALLET_ENCRYPTION_KEY=
To run database migrations, use the following command:
npm run prisma:migrateTo seed the database, use the following command:
npm run prisma:seedThis API uses URI versioning to manage changes and maintain backward compatibility. All endpoints are prefixed with /v1/.
- Version 1 (v1): All existing endpoints are accessible under the
/v1/prefix - Example:
POST /v1/auth/register,GET /v1/health
When creating new controllers or routes, always specify the version:
@Controller({ version: '1', path: 'your-resource' })
export class YourController {
// Routes will be accessible at /v1/your-resource
}- URI Versioning: The version is part of the URL path
- Default Version: Version 1 is the default and currently active version
- Future Versions: When breaking changes are needed, create a new version (e.g., v2) while maintaining v1 for backward compatibility
When introducing breaking changes:
- Create new endpoints in the next version (e.g., v2)
- Maintain existing v1 endpoints for a deprecation period
- Communicate deprecation timeline to API consumers
- Eventually remove deprecated v1 endpoints
When testing API endpoints, always include the version prefix:
# Correct
curl http://localhost:3000/v1/health
# Incorrect (will not work)
curl http://localhost:3000/healthAll branches should be named using the following convention:
feat/: For new features (e.g.,feat/add-user-authentication)fix/: For bug fixes (e.g.,fix/resolve-login-issue)chore/: For routine tasks and maintenance (e.g.,chore/update-dependencies)
Before submitting a pull request, please ensure the following:
- Tests pass
- No lint errors
- Swagger docs updated
For more in-depth guides, please consult:
- Deployment Guide — Production deployment, Docker, database migrations, and rollback procedures.
- Troubleshooting Guide — Common startup errors, database, Redis, and Stellar network debugging.
If you're new to the project and looking for a place to start, check out the issues tagged with good first issue.