Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
e2364de
feat: UML diagram of database entities
Alex-GF Jan 14, 2026
b981067
feat: UML with Organizations
Alex-GF Jan 16, 2026
3ab5b1f
feat: organizartion schema and repository
Alex-GF Jan 16, 2026
ed2f098
feat: updated user roles
Alex-GF Jan 16, 2026
4278925
feat: changed slug for id in organizations
Alex-GF Jan 16, 2026
9aa4e26
feat: organizations API and new API-key auth system
Alex-GF Jan 19, 2026
3600234
feat: first implementation of multiple api key authentication
Alex-GF Jan 19, 2026
f95aab5
feat: towards integrating organization permissions into services
Alex-GF Jan 19, 2026
881e1e0
feat: updated permissions
Alex-GF Jan 21, 2026
be193c5
feat: changed location of permission types
Alex-GF Jan 21, 2026
678d270
feat: updated sample data
Alex-GF Jan 21, 2026
c0778be
fix: import
Alex-GF Jan 21, 2026
58beb0c
fix: import
Alex-GF Jan 21, 2026
2b752ce
fix: mongo seeding
Alex-GF Jan 21, 2026
2b069cf
fix: import
Alex-GF Jan 21, 2026
dda67d3
fix: user tests
Alex-GF Jan 21, 2026
6efbca3
feat: towards organization tests
Alex-GF Jan 21, 2026
ba0985c
feat: organization test suite
Alex-GF Jan 22, 2026
c67fa58
feat: unit tests for route matching function
Alex-GF Jan 22, 2026
29e2566
feat: towards permission tests
Alex-GF Jan 22, 2026
adfef11
feat: permissions test
Alex-GF Jan 23, 2026
b159e2e
feat: services tests (without contract manipulation)
Alex-GF Jan 23, 2026
caa09b7
feat: towars updating service tests
Alex-GF Jan 23, 2026
ca936f5
feat: updated cacheService to manage Maps
Alex-GF Jan 25, 2026
ccd2c8b
feat: updated middlewares to handle Maps
Alex-GF Jan 25, 2026
f94f56f
fix: service tests
Alex-GF Jan 25, 2026
2210eed
fix: permissions test
Alex-GF Jan 25, 2026
6ce4644
fix: user tests
Alex-GF Jan 26, 2026
4cd7302
feat: extended user tests
Alex-GF Jan 26, 2026
701b405
feat: contract tests
Alex-GF Jan 26, 2026
fa0d284
refactor: remove unnecessary file
Alex-GF Jan 26, 2026
15cef62
feat: improved event tests
Alex-GF Jan 26, 2026
eb0eea0
feat: organization-scoped contract routes permission tests
Alex-GF Jan 26, 2026
52935f0
feat: authMiddleware tests
Alex-GF Jan 26, 2026
a56a494
refactor: location of middleware tests
Alex-GF Jan 26, 2026
112a379
feat: tests features
Alex-GF Jan 26, 2026
58bd5a7
feat: service disable tests
Alex-GF Jan 26, 2026
ca24fb1
fix: tests
Alex-GF Jan 27, 2026
8b6c186
refactor: removed dependency on seeders for testing
Alex-GF Feb 3, 2026
a7cf414
fix: feature evaluation revert
Alex-GF Feb 4, 2026
ce4c117
feat: add default organization to user on register
Alex-GF Feb 4, 2026
580d827
feat: added destroy method for services
Alex-GF Feb 4, 2026
cdd4d3f
feat: remove organizations by ID
Alex-GF Feb 4, 2026
91cda39
refactor: changed DELETE /organization/:organizationId/members by /or…
Alex-GF Feb 4, 2026
b5dac7f
fix: tests
Alex-GF Feb 4, 2026
1cc3dc5
feat: adding default organization management and testing
Alex-GF Feb 7, 2026
644169b
fix: test suit name
Alex-GF Feb 7, 2026
d89512c
feat: remove organizations when deleting users
Alex-GF Feb 7, 2026
1c95ead
fix: dont allow to regenrate api keys to other users
Alex-GF Feb 7, 2026
4ebaa84
feat: towards updating documentation
Alex-GF Feb 7, 2026
75fbd04
feat: adding cascading behaviour to keep services and contractedServi…
Alex-GF Feb 8, 2026
ce2c20d
fix: user tests
Alex-GF Feb 8, 2026
396c92c
fix: tests
Alex-GF Feb 8, 2026
c46c4d5
docs: towards updating api documentation
Alex-GF Feb 8, 2026
2265e26
feat: updated api documentation
Alex-GF Feb 8, 2026
70d8976
fix: tests
Alex-GF Feb 8, 2026
b21509b
refactor: removed old version of api docs
Alex-GF Feb 8, 2026
d536cdc
update: sample data
Alex-GF Feb 8, 2026
3e6203c
feat: update role endpoint
Alex-GF Feb 8, 2026
3a1d149
feat: towards frontend redesing
Alex-GF Feb 8, 2026
6128ad9
feat: improved workflow for adding members to organization
Alex-GF Feb 9, 2026
658013e
feat: updated response of member and api key management endpoints
Alex-GF Feb 9, 2026
16189d6
feat: api keys management
Alex-GF Feb 9, 2026
ad29079
feat: improved contracts dashboard
Alex-GF Feb 9, 2026
77164e5
fix: contracts seeders
Alex-GF Feb 9, 2026
2d10428
fix: organization GET by SPACE ADMIN
Alex-GF Feb 9, 2026
bc2ffac
feat: organization management in frontend and new welcome page
Alex-GF Feb 9, 2026
5c13f33
feat: admin based access to certain views
Alex-GF Feb 9, 2026
46a553b
fix: tests
Alex-GF Feb 9, 2026
2134e09
feat: towards organization management view
Alex-GF Feb 9, 2026
4ecb3c9
docs: added /users/me documentation
Alex-GF Feb 10, 2026
663db3f
feat: change whole context when updating organization metadata
Alex-GF Feb 10, 2026
ca29d14
feat: redirect to welcome page when registering
Alex-GF Feb 10, 2026
c3bb2d6
fix: self-removal of EVALUATORS from orgs
Alex-GF Feb 10, 2026
269098b
feat: improvements in members management
Alex-GF Feb 10, 2026
1a8b22f
feat: query parameter to filter usernames
Alex-GF Feb 10, 2026
0b133e0
feat: selector of users when adding new members to organization
Alex-GF Feb 10, 2026
ac3553f
feat: hot reload of server-side on development mode
Alex-GF Feb 11, 2026
9040dfd
feat: pagination to get users
Alex-GF Feb 11, 2026
74bd84e
feat: listing of users for admins and role management
Alex-GF Feb 11, 2026
1563fec
ifx: username update also updates organization data
Alex-GF Feb 11, 2026
c3e877a
fix: update organization context when removing user
Alex-GF Feb 11, 2026
2b773cd
feat: GET /organizacions can be used to filter organizations by name
Alex-GF Feb 11, 2026
57c0693
feat: organizations management view
Alex-GF Feb 11, 2026
b7c3927
refactor: removed unnecessary dependency
Alex-GF Feb 11, 2026
93920f3
refactor: changed position of instance monitoring
Alex-GF Feb 11, 2026
fc08a58
fix: tests
Alex-GF Feb 12, 2026
ed5f8bf
fix: tests
Alex-GF Feb 12, 2026
1ee7b37
feat: space as a service
Alex-GF Feb 12, 2026
a213400
fix: cd
Alex-GF Feb 12, 2026
69270b8
fix: pricing version formatter
Alex-GF Feb 12, 2026
8919c83
fix: feature evaluation tests
Alex-GF Feb 12, 2026
025b2dc
fix: cd
Alex-GF Feb 12, 2026
1447a88
fix: case insensitive subscription validation
Alex-GF Feb 12, 2026
7d27b3e
fix: contract retrieval and filtering
Alex-GF Feb 12, 2026
5ea4558
fix: evaluation with case mismatch plans
Alex-GF Mar 4, 2026
33dcdd2
fix: allow creation of same pricing in multiple orgs
Alex-GF Mar 4, 2026
9f52d00
feat: improved error messages on evaluation
Alex-GF Mar 4, 2026
5cb456b
feat: contract details page
Alex-GF Mar 4, 2026
e9bc660
feat: group id for bulk updating contracts
Alex-GF Mar 5, 2026
fd0a2bc
feat: added organizationId when group filtering contracts & added PUT…
Alex-GF Mar 5, 2026
bfa3059
feat: extended test suite
Alex-GF Mar 5, 2026
a48c17b
Merge pull request #43 from isa-group/feat/contracts-group-id
Alex-GF Mar 5, 2026
13d8428
hotfix: member addition
Alex-GF Mar 5, 2026
632e978
hotfix: cannot remove default orgs
Alex-GF Mar 5, 2026
8dd84eb
hotfix: personal organizations marked as default
Alex-GF Mar 5, 2026
30d2f6d
hotfix: maintain session when reloading and update organization conte…
Alex-GF Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,318 changes: 3,256 additions & 2,062 deletions api/docs/space-api-docs.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "src/main/index.ts",
"type": "module",
"scripts": {
"dev": "tsx src/main/index.ts",
"dev": "tsx --watch src/main/index.ts",
"dev:setup": "cd docker/dev && docker compose up -d --build",
"dev:setup:test": "pnpm run generate-test-env && pnpm run dev:setup && tsx scripts/seedMongodb.ts",
"test": "chmod +x run-tests.sh && ./run-tests.sh",
Expand Down Expand Up @@ -56,6 +56,7 @@
"mongo-seeding": "^4.0.2",
"mongoose": "^8.14.0",
"multer": "1.4.5-lts.2",
"nock": "^14.0.10",
"node-fetch": "^3.3.2",
"pricing4ts": "^0.10.3",
"redis": "^4.7.0",
Expand Down
70 changes: 70 additions & 0 deletions api/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/scripts/pricingJsonFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ interface AddOn {
interface Pricing {
_id: { $oid: string };
_serviceName: string;
_organizationId: string;
version: string;
currency: string;
createdAt: string;
Expand Down
6 changes: 5 additions & 1 deletion api/scripts/seedMongodb.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import mongoose from 'mongoose';
import {seedDatabase} from '../src/main/database/seeders/mongo/seeder';
import { getMongoDBConnectionURI } from '../src/main/config/mongoose';

await seedDatabase();
await mongoose.connect(getMongoDBConnectionURI());
await seedDatabase();
await mongoose.disconnect();
82 changes: 44 additions & 38 deletions api/src/main/app.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
import * as dotenv from "dotenv";
import express, {Application} from "express";
import type { Server } from "http";
import type { AddressInfo } from "net";
import * as dotenv from 'dotenv';
import express, { Application } from 'express';
import type { Server } from 'http';
import type { AddressInfo } from 'net';

import container from "./config/container";
import { disconnectMongoose, initMongoose } from "./config/mongoose";
import { initRedis } from "./config/redis";
import { seedDatabase } from "./database/seeders/mongo/seeder";
import loadGlobalMiddlewares from "./middlewares/GlobalMiddlewaresLoader";
import routes from "./routes/index";
import { seedDefaultAdmin } from "./database/seeders/common/userSeeder";
import container from './config/container';
import { disconnectMongoose, initMongoose } from './config/mongoose';
import { initRedis } from './config/redis';
import { seedDatabase } from './database/seeders/mongo/seeder';
import loadGlobalMiddlewares from './middlewares/GlobalMiddlewaresLoader';
import routes from './routes/index';
import { seedDefaultAdmin } from './database/seeders/common/userSeeder';

const green = "\x1b[32m";
const blue = "\x1b[36m";
const reset = "\x1b[0m";
const bold = "\x1b[1m";
const green = '\x1b[32m';
const blue = '\x1b[36m';
const reset = '\x1b[0m';
const bold = '\x1b[1m';

const initializeApp = async () => {
const initializeApp = async (seedDatabase: boolean = true) => {
dotenv.config();
const app: Application = express();
loadGlobalMiddlewares(app);
await routes(app);
await initializeDatabase();
await initializeDatabase(seedDatabase);
const redisClient = await initRedis();
if (["development", "testing"].includes(process.env.ENVIRONMENT ?? "")) {
if (['development', 'testing'].includes(process.env.ENVIRONMENT ?? '')) {
await redisClient.sendCommand(['FLUSHALL']);
console.log(`${green}➜${reset} ${bold}Redis cache cleared.${reset}`);
}
container.resolve("cacheService").setRedisClient(redisClient);
container.resolve('cacheService').setRedisClient(redisClient);
// await postInitializeDatabase(app)
return app;
};

const initializeServer = async (): Promise<{
const initializeServer = async (
seedDatabase: boolean = true
): Promise<{
server: Server;
app: Application;
}> => {
const app: Application = await initializeApp();
const port = 3000;
const app: Application = await initializeApp(seedDatabase);
const port = 3000;

// Using a promise to ensure the server is started before returning it
const server: Server = await new Promise((resolve, reject) => {
Expand All @@ -50,16 +52,16 @@ const initializeServer = async (): Promise<{
const addressInfo: AddressInfo = server.address() as AddressInfo;

// Inicializar el servicio de eventos con el servidor HTTP
container.resolve("eventService").initialize(server);
container.resolve('eventService').initialize(server);

console.log(
` ${green}➜${reset} ${bold}API:${reset} ${blue}http://localhost${addressInfo.port !== 80 ? `:${bold}${addressInfo.port}${reset}/` : "/"}`
` ${green}➜${reset} ${bold}API:${reset} ${blue}http://localhost${addressInfo.port !== 80 ? `:${bold}${addressInfo.port}${reset}/` : '/'}`
);
console.log(
` ${green}➜${reset} ${bold}WebSockets:${reset} ${blue}ws://localhost${addressInfo.port !== 80 ? `:${bold}${addressInfo.port}${reset}/events/pricings` : "/events/pricings"}`
` ${green}➜${reset} ${bold}WebSockets:${reset} ${blue}ws://localhost${addressInfo.port !== 80 ? `:${bold}${addressInfo.port}${reset}/events/pricings` : '/events/pricings'}`
);

if (["development", "testing"].includes(process.env.ENVIRONMENT ?? "")) {
if (['development', 'testing'].includes(process.env.ENVIRONMENT ?? '')) {
console.log(`${green}➜${reset} ${bold}Loaded Routes:${reset}`);
app._router.stack
.filter((layer: any) => layer.route)
Expand All @@ -71,20 +73,24 @@ const initializeServer = async (): Promise<{
return { server, app };
};

const initializeDatabase = async () => {
const initializeDatabase = async (seedDatabaseFlag: boolean = true) => {
let connection;
try {
switch (process.env.DATABASE_TECHNOLOGY ?? "mongoDB") {
case "mongoDB":
switch (process.env.DATABASE_TECHNOLOGY ?? 'mongoDB') {
case 'mongoDB':
connection = await initMongoose();
if (["development", "testing"].includes(process.env.ENVIRONMENT ?? "")) {
await seedDatabase();
}else{
await seedDefaultAdmin();
if (['development'].includes(process.env.ENVIRONMENT ?? '')) {
if (seedDatabaseFlag) {
await seedDatabase();
}
} else {
if (seedDatabaseFlag) {
await seedDefaultAdmin();
}
}
break;
default:
throw new Error("Unsupported database technology");
throw new Error('Unsupported database technology');
}
} catch (error) {
console.error(error);
Expand All @@ -94,16 +100,16 @@ const initializeDatabase = async () => {

const disconnectDatabase = async () => {
try {
switch (process.env.DATABASE_TECHNOLOGY ?? "mongoDB") {
case "mongoDB":
switch (process.env.DATABASE_TECHNOLOGY ?? 'mongoDB') {
case 'mongoDB':
await disconnectMongoose();
break;
default:
throw new Error("Unsupported database technology");
throw new Error('Unsupported database technology');
}
} catch (error) {
console.error(error);
}
};

export { disconnectDatabase,initializeServer };
export { disconnectDatabase, initializeServer };
Loading
Loading