Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure and update the codebase #21

Merged
merged 13 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Houses Dataset/
**/Dockerfile
.vercel
**/node_modules
19 changes: 19 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Database
DB_PORT=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DATABASE_URL="postgresql://DB_USER:DB_PASS@DB_HOST:DB_PORT/DB_NAME?schema=public"
# Server
SERVER_PORT=
# JWT
JWT_SECRET=
# Mailer
MAILER_SERVICE=
MAILER_USER=
MAILER_PASS=
MAILER_FROM=
MAIL_SECRET=
# Domain
DOMAIN=
3 changes: 2 additions & 1 deletion server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
# Keep environment variables out of version control
.env
/node_modules
27 changes: 0 additions & 27 deletions server/Dockerfile

This file was deleted.

47 changes: 0 additions & 47 deletions server/README.md

This file was deleted.

114 changes: 0 additions & 114 deletions server/database.sql

This file was deleted.

67 changes: 67 additions & 0 deletions server/docs/swagger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import swaggerAutogen from 'swagger-autogen';

const doc = {
info: {
version: '1.0.0',
title: 'GharBikri APIs',
description: 'API for GharBikri',
contact: {
name: 'API Support',
email: '[email protected]',
},
},
host: 'localhost:5000', // TODO: Change this to 'gharbikri.com.np' in production
basePath: '/api/v2',
schemes: ['http'],
consumes: ['application/json'],
produces: ['application/json'],
tags: [
{
name: 'GharBikri CRUD',
description: 'GharBikri related APIs',
},
{
name: 'Health',
description: 'Health Check',
},
],
securityDefinitions: {
apiKey: {
type: 'apiKey',
name: 'Authorization',
in: 'header',
},
},
definitions: {
healthResponse: {
type: 'object',
properties: {
code: {
type: 'integer',
format: 'int32',
},
message: {
type: 'string',
},
},
},
errorResponse: {
type: 'object',
properties: {
code: {
type: 'integer',
format: 'int32',
},
message: {
type: 'string',
},
},
},
},
};

const outputFile = './docs/swagger.json';
const endpointsFiles = ['./src/index.js', './src/controllers/*.js'];

// Generate Swagger documentation
swaggerAutogen(outputFile, endpointsFiles, doc);
Loading