Enterprise-grade NestJS backend for managing developer projects, resources, secrets, and API keys with Keycloak authentication.
- Framework: NestJS + Fastify
- Database: PostgreSQL with Prisma ORM
- Auth: Keycloak Integration
- Docs: OpenAPI/Swagger
- Testing: Jest + Supertest
- Keycloak integration
- JWT token validation
- Role-based access control
- User registration & login
- Token refresh support
- CRUD operations
- Ownership validation
- Soft delete functionality
- Pagination & filtering
- Search capabilities
- Secure secrets storage
- API keys management
- Project-based organization
- Resource type validation
- Archive/restore support
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Run database migrations
npx prisma migrate dev
# Development
npm run start:dev
# Production
npm run start:prod
# Unit tests
npm run test
# E2E tests
npm run test:e2e
# Test coverage
npm run test:cov
Once the application is running, access the Swagger documentation at:
http://localhost:3000/api/docs
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/neststack"
# Keycloak
KEYCLOAK_AUTH_SERVER_URL="http://localhost:8080/auth"
KEYCLOAK_REALM="realm-name"
KEYCLOAK_CLIENT_ID="client-name"
KEYCLOAK_CLIENT_SECRET="your-client-secret"
# App
PORT=3000
NODE_ENV=development
src/
├── auth/ # Authentication & authorization
├── project/ # Project management
├── resource/ # Resource management
├── prisma/ # Database schema & migrations
├── dto/ # Data transfer objects
└── config/ # Configuration files
# Create test database
psql -U postgres -c "CREATE DATABASE neststack_test;"
# Run tests with test environment
NODE_ENV=test npm run test
POST /api/auth/register
- Register new userPOST /api/auth/login
- User loginPOST /api/auth/logout
- User logout
GET /api/projects
- List all projectsPOST /api/projects
- Create projectGET /api/projects/:id
- Get projectPUT /api/projects/:id
- Update projectDELETE /api/projects/:id
- Delete project
GET /api/resources
- List all resourcesPOST /api/resources
- Create resourceGET /api/resources/:id
- Get resourceDELETE /api/resources/:id
- Delete resource
Jawher Kallel
- Github: @JawherKl
This project is MIT licensed.