Skip to content

Commit

Permalink
feat: food app to work
Browse files Browse the repository at this point in the history
  • Loading branch information
mogobanyamwaro committed Mar 2, 2024
0 parents commit 917e1d0
Show file tree
Hide file tree
Showing 158 changed files with 22,900 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/node_modules

# lock files
/package-lock.json

# nx cache
.nx

# DS store
.DS_Store
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"WillLuke.nextjs.addTypesOnSave": true,
"WillLuke.nextjs.hasPrompted": true
}
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
![Project Image](./cover.png)
# Food Delivery Web Application using Microservice Architecture with Nest.js, GraphQL, Next.js, Prisma

Welcome to the open-source Food Delivery Web Application series utilizing Microservice Architecture. This project aims to create a comprehensive Food Delivery Web Application employing Microservice Architecture. Separate applications will be built for Admin, User, Restaurant Owner, and Delivery Man. The entire project will be freely accessible, and this README covers the initial part, with more to come.

## Open for Contributors

This project is open for contributions. Whether you want to modify aspects or collaborate on the entire project, you're welcome to join us. Given the scope of this significant project, your assistance can help bring it to completion quickly. Previous experience is not a barrier; if you possess frontend development skills, you can contribute.

## Technology Used

Given the Microservice Architecture, it's challenging to enumerate all the exact technologies we plan to use. However, for an overview, we intend to employ Nest.js as the backend framework, GraphQL for Microservice connection gateway, Docker for containerizing our application, Prisma as the Database ORM, and AWS ECS for deployment, along with other AWS platforms. On the frontend, Next.js will be used for speed optimization and superior SEO. As this is the first part of our project, not all technologies have been finalized.

## Support Our Work

You can support our efforts based on your eligibility. Your support is appreciated and encourages us to create more free projects. If you wish to contribute, you can donate starting from $1. [Click here to donate](https://www.becodemy.com/support/Food-Delivery-Web-Application-using-Microservice-Architecture-with-Nestjs-GraphQL-Nextjs-Prisma)
33 changes: 33 additions & 0 deletions apps/api-gateway/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": [
"../../.eslintrc.json"
],
"ignorePatterns": [
"!**/*"
],
"overrides": [
{
"files": [
"*.ts",
"*.tsx",
"*.js",
"*.jsx"
],
"rules": {}
},
{
"files": [
"*.ts",
"*.tsx"
],
"rules": {}
},
{
"files": [
"*.js",
"*.jsx"
],
"rules": {}
}
]
}
11 changes: 11 additions & 0 deletions apps/api-gateway/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'api-gateway',
preset: '../../jest.preset.js',
testEnvironment: 'node',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }]
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/apps/api-gateway'
};
61 changes: 61 additions & 0 deletions apps/api-gateway/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "api-gateway",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/api-gateway/src",
"projectType": "application",
"targets": {
"build": {
"executor": "@nx/webpack:webpack",
"outputs": [
"{options.outputPath}"
],
"defaultConfiguration": "production",
"options": {
"target": "node",
"compiler": "tsc",
"outputPath": "dist/apps/api-gateway",
"main": "apps/api-gateway/src/main.ts",
"tsConfig": "apps/api-gateway/tsconfig.app.json",
"assets": [
"apps/api-gateway/src/assets"
],
"webpackConfig": "apps/api-gateway/webpack.config.js"
},
"configurations": {
"development": {},
"production": {}
}
},
"serve": {
"executor": "@nx/js:node",
"defaultConfiguration": "development",
"options": {
"buildTarget": "api-gateway:build"
},
"configurations": {
"development": {
"buildTarget": "api-gateway:build:development"
},
"production": {
"buildTarget": "api-gateway:build:production"
}
}
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": [
"{options.outputFile}"
]
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": {
"jestConfig": "apps/api-gateway/jest.config.ts"
}
}
},
"tags": []
}
26 changes: 26 additions & 0 deletions apps/api-gateway/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Module } from '@nestjs/common';
import { AppService } from './app.service';
import { GraphQLModule } from '@nestjs/graphql';
import { ApolloGatewayDriver, ApolloGatewayDriverConfig } from '@nestjs/apollo';
import { IntrospectAndCompose } from '@apollo/gateway';

@Module({
imports: [
GraphQLModule.forRoot<ApolloGatewayDriverConfig>({
driver: ApolloGatewayDriver,
gateway: {
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{
name: 'users',
url: 'http://localhost:4001/graphql',
},
],
}),
},
}),
],
controllers: [],
providers: [AppService],
})
export class AppModule {}
8 changes: 8 additions & 0 deletions apps/api-gateway/src/app.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
getHello(): string {
return 'Hello!';
}
}
22 changes: 22 additions & 0 deletions apps/api-gateway/src/app/app.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Test, TestingModule } from '@nestjs/testing';

import { AppController } from './app.controller';
import { AppService } from './app.service';

describe('AppController', () => {
let app: TestingModule;

beforeAll(async () => {
app = await Test.createTestingModule({
controllers: [AppController],
providers: [AppService],
}).compile();
});

describe('getData', () => {
it('should return "Hello API"', () => {
const appController = app.get<AppController>(AppController);
expect(appController.getData()).toEqual({message: 'Hello API'});
});
});
});
13 changes: 13 additions & 0 deletions apps/api-gateway/src/app/app.controller.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Controller, Get } from '@nestjs/common';

import { AppService } from './app.service';

@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}

@Get()
getData() {
return this.appService.getData();
}
}
11 changes: 11 additions & 0 deletions apps/api-gateway/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Module } from '@nestjs/common';

import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
imports: [],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
21 changes: 21 additions & 0 deletions apps/api-gateway/src/app/app.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Test } from '@nestjs/testing';

import { AppService } from './app.service';

describe('AppService', () => {
let service: AppService;

beforeAll(async () => {
const app = await Test.createTestingModule({
providers: [AppService],
}).compile();

service = app.get<AppService>(AppService);
});

describe('getData', () => {
it('should return "Hello API"', () => {
expect(service.getData()).toEqual({message: 'Hello API'});
});
});
});
8 changes: 8 additions & 0 deletions apps/api-gateway/src/app/app.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
getData(): { message: string } {
return ({ message: 'Hello API' });
}
}
Empty file.
8 changes: 8 additions & 0 deletions apps/api-gateway/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(4000);
}
bootstrap();
20 changes: 20 additions & 0 deletions apps/api-gateway/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": [
"node"
],
"emitDecoratorMetadata": true,
"target": "es2021"
},
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts"
],
"include": [
"src/**/*.ts"
]
}
16 changes: 16 additions & 0 deletions apps/api-gateway/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"compilerOptions": {
"esModuleInterop": true
}
}
14 changes: 14 additions & 0 deletions apps/api-gateway/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
15 changes: 15 additions & 0 deletions apps/api-gateway/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

const { composePlugins, withNx} = require('@nx/webpack');

// Nx plugins for webpack.
module.exports = composePlugins(
withNx({
target: 'node',
}),
(config) => {
// Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())`
return config;
}
);

12 changes: 12 additions & 0 deletions apps/api-restuarants/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DATABASE_URL="mongodb+srv://shahriarsajeeb:5pcarMVchKjsqxxT@cluster0.cxswnbl.mongodb.net/test"
JWT_SECRET_KEY = 'eyJhbGciOiJIUzI1NiJ9.eyJSb2xlIjoiQWRtaW4iLCJJc3N1ZXIiOiJJc3N1ZXIiLCJVc2VybmFtZSI6IkphdmFJblVzZSIsImV4cCI6MTcwNTQzNzAyOCwiaWF0IjoxNzA1NDM3MDI4fQ.LMAbxfFDJSovaxvlo7QHbcW0ND8yZP1EZs0Bljwu-vI'
SMTP_HOST = smtp.gmail.com
SMTP_PORT = 465
SMTP_SERVICE = gmail
SMTP_MAIL = "sajeebshahriar665@gmail.com"
SMTP_PASSWORD = 'ninn ernu zeza nxyq'
ACCESS_TOKEN_SECRET = "5ygV>@]K-H(#\nP*$5;.H6{|v<bzsn6Vwe`EQ3)T8mvK6(x2F9"
REFRESH_TOKEN_SECRET = "&1pSt?EtBz#nhIJM6h)EU4=e\WmYVc7i2£F9o3]y50#:Zu;xVS"
FORGOT_PASSWORD_SECRET = "&{'T];l_\20|7SL*>&&qIO;67gZ&L/ERwo46#u5G{,%Mcfgsa"
CLIENT_SIDE_URI = "http://localhost:4200"

12 changes: 12 additions & 0 deletions apps/api-restuarants/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
DATABASE_URL="mongodb+srv://shahriarsajeeb:5pcarMVchKjsqxxT@cluster0.cxswnbl.mongodb.net/test"
ACTIVATION_SECRET = 59646039045
SMTP_HOST = smtp.gmail.com
SMTP_PORT = 465
SMTP_SERVICE = gmail
SMTP_MAIL = "sajeebshahriar665@gmail.com"
SMTP_PASSWORD = 'ninn ernu zeza nxyq'
ACCESS_TOKEN_SECRET = "5ygV>@]K-H(#\nP*$5;.H6{|v<bzsn6Vwe`EQ3)T8mvK6(x2F9"
REFRESH_TOKEN_SECRET = "&1pSt?EtBz#nhIJM6h)EU4=e\WmYVc7i2£F9o3]y50#:Zu;xVS"
FORGOT_PASSWORD_SECRET = "&{'T];l_\20|7SL*>&&qIO;67gZ&L/ERwo46#u5G{,%Mcfgsa"
CLIENT_SIDE_URI = "http://localhost:4200"

24 changes: 24 additions & 0 deletions apps/api-restuarants/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
},
{
"files": ["*.js", "*.jsx"],
"rules": {
"@typescript-eslint/no-explicit-any": "off"
}
}
]
}
Loading

0 comments on commit 917e1d0

Please sign in to comment.