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:covOnce 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=developmentsrc/
├── 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 user
- POST /api/auth/login- User login
- POST /api/auth/logout- User logout
- GET /api/projects- List all projects
- POST /api/projects- Create project
- GET /api/projects/:id- Get project
- PUT /api/projects/:id- Update project
- DELETE /api/projects/:id- Delete project
- GET /api/resources- List all resources
- POST /api/resources- Create resource
- GET /api/resources/:id- Get resource
- DELETE /api/resources/:id- Delete resource
Jawher Kallel
- Github: @JawherKl
This project is MIT licensed.
