
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@noatgnu/cupcake-core
Advanced tools
A reusable Angular library that provides user management, authentication, and site configuration functionality for cupcake applications.
The cupcake-core library provides essential services, components, and models for building Angular applications that interact with a Cupcake backend. It simplifies authentication, API communication, and provides a set of reusable UI components.
To install the @noatgnu/cupcake-core library, run the following command:
npm install @noatgnu/cupcake-core
Then, import the CupcakeCoreModule into your application's AppModule (or any other feature module):
import { CupcakeCoreModule } from '@noatgnu/cupcake-core';
@NgModule({
imports: [
// ... other modules
CupcakeCoreModule
],
// ...
})
export class AppModule { }
Additionally, you need to provide the CUPCAKE_CORE_CONFIG in your AppModule to configure the API URL:
import { CUPCAKE_CORE_CONFIG } from '@noatgnu/cupcake-core';
@NgModule({
// ...
providers: [
{
provide: CUPCAKE_CORE_CONFIG,
useValue: { apiUrl: 'YOUR_API_URL_HERE' }
}
]
})
export class AppModule { }
The AuthService handles user authentication, including login, logout, and token management. It uses JWT for authentication and stores tokens in local storage.
Usage:
import { AuthService } from '@noatgnu/cupcake-core';
@Component({ ... })
export class MyComponent {
constructor(private authService: AuthService) {
this.authService.isAuthenticated$.subscribe(isAuthenticated => {
// ...
});
this.authService.currentUser$.subscribe(user => {
// ...
});
}
login() {
this.authService.login('username', 'password').subscribe(response => {
// ...
});
}
logout() {
this.authService.logout().subscribe(() => {
// ...
});
}
}
The ApiService is the primary service for communicating with the Cupcake backend. It provides methods for a wide range of functionalities, including user management, site configuration, and more.
Automatic Case Transformation:
The ApiService automatically transforms request data from camelCase (frontend) to snake_case (backend) and response data from snake_case to camelCase. This eliminates the need for manual transformations in your components and services.
Usage:
import { ApiService } from '@noatgnu/cupcake-core';
@Component({ ... })
export class MyComponent {
constructor(private apiService: ApiService) {
this.apiService.getUsers().subscribe(response => {
// `response` is already transformed to camelCase
console.log(response.results);
});
}
}
The library provides the following route guards:
AuthGuard: Ensures that a route can only be accessed by authenticated users.AdminGuard: Ensures that a route can only be accessed by admin users.Usage (in your routing module):
import { AuthGuard, AdminGuard } from '@noatgnu/cupcake-core';
const routes: Routes = [
{
path: 'profile',
component: UserProfileComponent,
canActivate: [AuthGuard]
},
{
path: 'admin',
component: AdminDashboardComponent,
canActivate: [AdminGuard]
}
];
The AuthInterceptor automatically attaches the JWT access token to outgoing HTTP requests. It also handles token refreshing when the access token expires.
The cupcake-core library includes a variety of reusable components, such as:
The library defines a comprehensive set of TypeScript interfaces that correspond to the backend data models. These models provide type safety and autocompletion when working with API responses. Some of the key models include:
UserSiteConfigAnnotationResourcePermissionBy leveraging the services, components, and models provided by cupcake-core, you can significantly accelerate the development of your Angular application and ensure consistency with the Cupcake backend.
FAQs
A reusable Angular library that provides user management, authentication, and site configuration functionality for cupcake applications.
The npm package @noatgnu/cupcake-core receives a total of 347 weekly downloads. As such, @noatgnu/cupcake-core popularity was classified as not popular.
We found that @noatgnu/cupcake-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.