Skip to content

Commit

Permalink
Merge pull request #22 from fless-lab/revert-21-fix/import-errors
Browse files Browse the repository at this point in the history
Revert "Fix/import errors"
  • Loading branch information
fless-lab authored Sep 2, 2024
2 parents 7a8b4a1 + 5a97394 commit 05dd9a3
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 30 deletions.
16 changes: 6 additions & 10 deletions bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ echo "✅ Docker is installed."

echo "🔄 Checking for Docker Compose installation..."

# Check if Docker Compose is installed and determine which command to use
if command -v docker-compose &> /dev/null; then
DOCKER_COMPOSE_CMD="docker-compose"
echo "✅ Docker Compose (standalone) is installed."
elif docker compose version &> /dev/null; then
DOCKER_COMPOSE_CMD="docker compose"
echo "✅ Docker Compose (plugin) is installed."
else
# Check if Docker Compose is installed
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose could not be found. Please install Docker Compose and try again."
exit 1
fi

echo "✅ Docker Compose is installed."

# Run the install script
echo "🔄 Running install.sh..."
bash "$PROJECT_ROOT/bin/install.sh"
Expand All @@ -46,5 +42,5 @@ echo "🔄 NODE_ENV set to $ENVIRONMENT in .env file."

# Start the Docker containers
echo "🔄 Starting Docker containers in $ENVIRONMENT mode..."
$DOCKER_COMPOSE_CMD up --build
echo "✅ Docker containers started."
docker-compose up --build
echo "✅ Docker containers started."
3 changes: 2 additions & 1 deletion src/apps/auth/repositories/otp.repo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Model } from 'mongoose';
import { IOTPModel, TOTPPurpose } from '../types';
import { generateRandomOTP } from '../../../helpers';
import { BaseRepository, config } from '../../../core';
import { BaseRepository } from '../../../common';
import { config } from '../../../core';

class OTPRepository extends BaseRepository<IOTPModel> {
constructor(model: Model<IOTPModel>) {
Expand Down
3 changes: 2 additions & 1 deletion src/apps/auth/services/otp.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {
BaseService,
ErrorResponse,
ErrorResponseType,
MailServiceUtilities,
SuccessResponseType,
} from '../../../common';
import { BaseService, config } from '../../../core';
import { config } from '../../../core';
import { generateRandomOTP } from '../../../helpers';
import { IUserModel, UserService } from '../../users';
import { OTPModel } from '../models';
Expand Down
2 changes: 1 addition & 1 deletion src/apps/users/repositories/user.repo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Model } from 'mongoose';
import { IUserModel } from '../types';
import { BaseRepository } from '../../../core';
import { BaseRepository } from '../../../common';

export class UserRepository extends BaseRepository<IUserModel> {
constructor(model: Model<IUserModel>) {
Expand Down
2 changes: 1 addition & 1 deletion src/apps/users/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { IUserModel } from '../types';
import { UserRepository } from '../repositories';
import { UserModel } from '../models';
import {
BaseService,
ErrorResponse,
ErrorResponseType,
SuccessResponseType,
} from '../../../common';
import { config } from '../../../core';
import { BaseService } from '../../../core';

class UserService extends BaseService<IUserModel, UserRepository> {
constructor() {
Expand Down
1 change: 1 addition & 0 deletions src/common/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './types';
export * from './utils';
export * from './services';
export * from './middlewares';
export * from './repositories';
File renamed without changes.
1 change: 1 addition & 0 deletions src/common/shared/repositories/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './base.repo';
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { Document } from 'mongoose';
import { escapeRegex, slugify } from '../../../../helpers';
import { BaseRepository } from '..';
import {
ErrorResponse,
ErrorResponseType,
SuccessResponseType,
} from '../../../../common';
import { BaseRepository } from '../repositories';
import { ErrorResponse } from '../utils';
import { escapeRegex, slugify } from '../../../helpers';
import { ErrorResponseType, SuccessResponseType } from '../types';

export class BaseService<T extends Document, R extends BaseRepository<T>> {
protected repository: R;
Expand Down
1 change: 1 addition & 0 deletions src/common/shared/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './base.service';
export { default as JwtService } from './jwt.service';
export { default as ViewService } from './view.service';
export * from './mail';
Expand Down
Empty file.
2 changes: 0 additions & 2 deletions src/core/engine/base/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/core/engine/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './config';
export { default as config } from './config';
export * from './framework';
export * from './engine';
3 changes: 2 additions & 1 deletion src/helpers/db-connection-test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { config, DB } from '../core';
import config from '../config';
import { DB } from '../framework';

export async function testDatabaseConnection() {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/minio-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { logger } from '../common';
import { S3 } from '../core';
import { logger } from '../apps';
import { S3 } from '../framework';

async function testMinioConnection(): Promise<void> {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/redis-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { logger } from '../common';
import { DB } from '../core';
import { logger } from '../apps';
import { DB } from '../framework';

async function testRedisConnection(): Promise<void> {
try {
Expand Down

0 comments on commit 05dd9a3

Please sign in to comment.