Skip to content

Commit

Permalink
Remove unused entities (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjula-sack authored Jul 20, 2024
1 parent bac4dff commit 5a851cc
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 930 deletions.
76 changes: 42 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ We welcome contributions to make ScholarX even better! Feel free to send us a pu

Before you can start using this project, make sure you have the following installed on your machine:

- Node.js (version 14 or later)
- npm (version 6 or later)
- Node.js (version 18 or later)
- npm (version 9 or later)

## Getting Started

Expand Down Expand Up @@ -69,29 +69,27 @@ If you prefer to use Docker for development, follow these steps:

2. Build the Docker images:

```docker-compose build```
`docker-compose build`

3. Start the Docker containers:

```docker-compose up```
`docker-compose up`

4. The application and its services are now running in Docker containers. You can access the application at ```http://localhost:${SERVER_PORT}```, where ```SERVER_PORT``` is the port number specified in your ```.env``` file.
4. The application and its services are now running in Docker containers. You can access the application at `http://localhost:${SERVER_PORT}`, where `SERVER_PORT` is the port number specified in your `.env` file.

5. To stop the Docker containers, use the following commnd:

```docker-compose down```
`docker-compose down`

Please note that the Docker Compose setup assumes that you have a ```.env``` file in your project root. You can create one by copying the ```.env.example``` file:
Please note that the Docker Compose setup assumes that you have a `.env` file in your project root. You can create one by copying the `.env.example` file:

```cp .env.example .env```
`cp .env.example .env`

Then, replace the environment variables in the newly created ```.env``` file with your configuration.
Then, replace the environment variables in the newly created `.env` file with your configuration.

The environment directive sets environment variables inside the Docker container. These variables are used to configure the PostgreSQL server. The values for ```${DB_USER}```, ```${DB_PASSWORD}```, and ```${DB_NAME}``` should be specified in your .env file.


Remember to replace ```${SERVER_PORT}``` with the actual port number if it's a fixed value. If it's specified in the ```.env``` file, you can leave it as is.
The environment directive sets environment variables inside the Docker container. These variables are used to configure the PostgreSQL server. The values for `${DB_USER}`, `${DB_PASSWORD}`, and `${DB_NAME}` should be specified in your .env file.

Remember to replace `${SERVER_PORT}` with the actual port number if it's a fixed value. If it's specified in the `.env` file, you can leave it as is.

In the `docker-compose.yml` file, we also have a `db` service for the PostgreSQL database:

Expand All @@ -106,16 +104,15 @@ db:
- POSTGRES_DB=${DB_NAME}
```

This service uses the official postgres:15 Docker image. The ports directive maps port 5432 inside the Docker container to port 5432 on your host machine, allowing you to connect to the PostgreSQL server at ```localhost:5432```.
This service uses the official postgres:15 Docker image. The ports directive maps port 5432 inside the Docker container to port 5432 on your host machine, allowing you to connect to the PostgreSQL server at `localhost:5432`.

Now, you can connect to the PostgreSQL server running inside the Docker container using a database client. Use ```localhost:5432``` as the server address, and the ```${DB_USER}```, ```${DB_PASSWORD}```, and ```${DB_NAME}``` values from your ```.env``` file for the username, password, and database name, respectively.
Now, you can connect to the PostgreSQL server running inside the Docker container using a database client. Use `localhost:5432` as the server address, and the `${DB_USER}`, `${DB_PASSWORD}`, and `${DB_NAME}` values from your `.env` file for the username, password, and database name, respectively.

### Note
### Note

If you have a local PostgreSQL server running on port 5432, you will need to stop it before starting the Docker container, or change the port mapping to avoid a conflict.


Remember to replace ```${SERVER_PORT}``` with the actual port number if it's a fixed value. If it's specified in the ```.env``` file, you can leave it as is.
Remember to replace `${SERVER_PORT}` with the actual port number if it's a fixed value. If it's specified in the `.env` file, you can leave it as is.

---

Expand Down Expand Up @@ -172,6 +169,7 @@ scholarx-backend/
- `tsconfig.json`: Configuration file for the TypeScript compiler.

## Setting up Google Authentication

1. Open Google Cloud Console:

Visit https://console.cloud.google.com
Expand Down Expand Up @@ -200,22 +198,23 @@ Once the details are filled, click the "Create" button at the bottom.

Google Cloud Platform will now create your project. This might take a few moments.


## Enabling Google+ API for the Project

1. Navigate to the Google Cloud Console.
Select your project using the project selector at the top.
In the left navigation pane, click on "APIs & Services" and then click on "Library."
Select your project using the project selector at the top.
In the left navigation pane, click on "APIs & Services" and then click on "Library."

2. Search for "Google+ API" in the library.

3. Click on the Google+ API and then click the "Enable" button.

## Create OAuth Consent Screen

1. Navigate to the API & Services Dashboard:
Open the Google Cloud Console.
Select your project.
Open the Google Cloud Console.
Select your project.

3. Open the API & Services Dashboard:
2. Open the API & Services Dashboard:

In the left navigation pane, click on "APIs & Services" and then click on "Credentials."

Expand All @@ -225,22 +224,23 @@ Click on "Create Credentials" and choose "OAuth consent screen."
Fill in the required details for your OAuth consent screen, such as product name, user support email, and developer contact information.

5. Save and Continue:
Save the consent screen configuration.

Save the consent screen configuration.

## Create OAuth Client ID Credentials

1. Navigate to the API & Services Dashboard:
In the "Credentials" page, click on "Create Credentials" and choose "OAuth client ID."
Configure OAuth Client ID:
Select the application type and
Enter a name for your client ID.
Configure the authorized redirect URIs.
In the "Credentials" page, click on "Create Credentials" and choose "OAuth client ID."
Configure OAuth Client ID:
Select the application type and
Enter a name for your client ID.
Configure the authorized redirect URIs.

2. Save Credentials:

Click "Create" to generate your OAuth client ID and client secret.

## Set Environment Variables

After obtaining the OAuth client ID and client secret,set the environment variables in your application to use these credentials.

Ex:
Expand All @@ -249,7 +249,6 @@ process.env.GOOGLE_CLIENT_ID = 'your-client-id';
process.env.GOOGLE_CLIENT_SECRET = 'your-client-secret';
process.env.GOOGLE_REDIRECT_URL = 'your-redirect-uri';


We appreciate your interest in ScholarX. Happy contributing! If you have any questions or need assistance, please don't hesitate to reach out to us.

## Setting up LinkedIn Authentication
Expand All @@ -259,6 +258,7 @@ We appreciate your interest in ScholarX. Happy contributing! If you have any que
2. Navigate to https://developer.linkedin.com/

3. Select "Create App":

- Add App name.
- Search for the LinkedIn page that was previously created.
- Upload an image as a Logo.
Expand All @@ -270,6 +270,14 @@ We appreciate your interest in ScholarX. Happy contributing! If you have any que

6. Copy Client Id and Client Secret from the Auth Section.

6. In setting section verify the LinkedIn Page and generate URL.
7. In setting section verify the LinkedIn Page and generate URL.

8. Verify it from your account.

7. Verify it from your account.
## Create dummy data

1. Run the seeding script:

```bash
npm run seed
```
80 changes: 0 additions & 80 deletions src/controllers/admin/emailTemplate.controller.ts

This file was deleted.

70 changes: 0 additions & 70 deletions src/controllers/admin/platform.controller.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/entities/emailTemplate.entity.ts

This file was deleted.

37 changes: 0 additions & 37 deletions src/entities/platform.entity.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/routes/admin/admin.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import express from 'express'
import userRouter from './user/user.route'
import mentorRouter from './mentor/mentor.route'
import categoryRouter from './category/category.route'
import platformRouter from './platform/platform.route'
import emailTemplateRouter from './email/emailTemplate.route'
import menteeRouter from './mentee/mentee.route'

const adminRouter = express()
Expand All @@ -12,7 +10,5 @@ adminRouter.use('/users', userRouter)
adminRouter.use('/mentors', mentorRouter)
adminRouter.use('/mentees', menteeRouter)
adminRouter.use('/categories', categoryRouter)
adminRouter.use('/platform', platformRouter)
adminRouter.use('/emailTemplate', emailTemplateRouter)

export default adminRouter
Loading

0 comments on commit 5a851cc

Please sign in to comment.