Skip to content

Commit

Permalink
Merge branch 'main' into fixingIssues
Browse files Browse the repository at this point in the history
  • Loading branch information
kidhanna authored Dec 15, 2024
2 parents 28d520e + e694536 commit 07d6e48
Show file tree
Hide file tree
Showing 58 changed files with 9,638 additions and 1,672 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI/CD Pipeline

on:
push:
branches: ['*']
pull_request:
branches: ['*']

jobs:
backend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
working-directory: ./backend
run: npm install

- name: Build backend
working-directory: ./backend
run: npm run build

frontend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
working-directory: ./frontend
run: npm install

- name: Start frontend
working-directory: ./frontend
run: |
npm run start &
sleep 60
- name: Check frontend status
run: |
if ! lsof -i:3000; then
echo "Frontend did not start successfully." >&2
exit 1
fi
- name: Ensure frontend build is error-free
working-directory: ./frontend
env:
CI: false
run: |
npm run build
if [ $? -ne 0 ]; then
echo "Frontend build failed." >&2
exit 1
fi
17 changes: 17 additions & 0 deletions backend/Types/events.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export interface Event {
id: number;
event_name: string;
event_date: Date;
start_time: string;
end_time: string;
location: string;
latitude: number;
longitude: number;
location_name: string;
bands: string[];
description: string;
genres: string[];
ticket_price: number;
created_at: Date;
updated_at: Date;
}
84 changes: 84 additions & 0 deletions backend/build/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { UserController } from './../src/Controllers/Users/UserController';
import { PostController } from './../src/Controllers/Posts/PostsController';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { PlacesController } from './../src/Controllers/GoogleAPI/GoogleAPIController';
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
import { EventController } from './../src/Controllers/Events/EventsController';
import type { Request as ExRequest, Response as ExResponse, RequestHandler, Router } from 'express';


Expand Down Expand Up @@ -120,6 +122,28 @@ const models: TsoaRoute.Models = {
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
"Event": {
"dataType": "refObject",
"properties": {
"id": {"dataType":"double","required":true},
"event_name": {"dataType":"string","required":true},
"event_date": {"dataType":"datetime","required":true},
"start_time": {"dataType":"string","required":true},
"end_time": {"dataType":"string","required":true},
"location": {"dataType":"string","required":true},
"latitude": {"dataType":"double","required":true},
"longitude": {"dataType":"double","required":true},
"location_name": {"dataType":"string","required":true},
"bands": {"dataType":"array","array":{"dataType":"string"},"required":true},
"description": {"dataType":"string","required":true},
"genres": {"dataType":"array","array":{"dataType":"string"},"required":true},
"ticket_price": {"dataType":"double","required":true},
"created_at": {"dataType":"datetime","required":true},
"updated_at": {"dataType":"datetime","required":true},
},
"additionalProperties": false,
},
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
};
const templateService = new ExpressTemplateService(models, {"noImplicitAdditionalProperties":"throw-on-extras","bodyCoercion":true});

Expand Down Expand Up @@ -536,6 +560,36 @@ export function RegisterRoutes(app: Router) {
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.post('/posts/newComment',
...(fetchMiddlewares<RequestHandler>(PostController)),
...(fetchMiddlewares<RequestHandler>(PostController.prototype.postNewComment)),

async function PostController_postNewComment(request: ExRequest, response: ExResponse, next: any) {
const args: Record<string, TsoaRoute.ParameterSchema> = {
body: {"in":"body","name":"body","required":true,"dataType":"any"},
};

// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa

let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args, request, response });

const controller = new PostController();

await templateService.apiHandler({
methodName: 'postNewComment',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get('/googleApi/placesAutocomplete',
...(fetchMiddlewares<RequestHandler>(PlacesController)),
...(fetchMiddlewares<RequestHandler>(PlacesController.prototype.getAutocomplete)),
Expand Down Expand Up @@ -598,6 +652,36 @@ export function RegisterRoutes(app: Router) {
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.post('/events/newEvent',
...(fetchMiddlewares<RequestHandler>(EventController)),
...(fetchMiddlewares<RequestHandler>(EventController.prototype.postEvent)),

async function EventController_postEvent(request: ExRequest, response: ExResponse, next: any) {
const args: Record<string, TsoaRoute.ParameterSchema> = {
eventBody: {"in":"body","name":"eventBody","required":true,"ref":"Event"},
};

// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa

let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({ args, request, response });

const controller = new EventController();

await templateService.apiHandler({
methodName: 'postEvent',
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
});
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa

// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa

Expand Down
140 changes: 137 additions & 3 deletions backend/build/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,94 @@
],
"type": "object",
"additionalProperties": false
},
"Event": {
"properties": {
"id": {
"type": "number",
"format": "double"
},
"event_name": {
"type": "string"
},
"event_date": {
"type": "string",
"format": "date-time"
},
"start_time": {
"type": "string"
},
"end_time": {
"type": "string"
},
"location": {
"type": "string"
},
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
},
"location_name": {
"type": "string"
},
"bands": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"genres": {
"items": {
"type": "string"
},
"type": "array"
},
"ticket_price": {
"type": "number",
"format": "double"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"id",
"event_name",
"event_date",
"start_time",
"end_time",
"location",
"latitude",
"longitude",
"location_name",
"bands",
"description",
"genres",
"ticket_price",
"created_at",
"updated_at"
],
"type": "object",
"additionalProperties": false
}
},
"securitySchemes": {}
},
"info": {
"title": "sound-circle",
"version": "1.0.0",
"license": {
"name": "ISC"
},
"contact": {}
},
"paths": {
Expand Down Expand Up @@ -844,6 +922,33 @@
]
}
},
"/posts/newComment": {
"post": {
"operationId": "PostNewComment",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserComment"
}
}
}
}
},
"security": [],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {}
}
}
}
}
},
"/googleApi/placesAutocomplete": {
"get": {
"operationId": "GetAutocomplete",
Expand Down Expand Up @@ -926,6 +1031,35 @@
}
]
}
},
"/events/newEvent": {
"post": {
"operationId": "PostEvent",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
}
}
}
}
},
"security": [],
"parameters": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
}
}
}
}
}
}
},
"servers": [
Expand Down
Loading

0 comments on commit 07d6e48

Please sign in to comment.