Skip to content
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
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## React Compiler

The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.

Note: This will impact Vite dev & build performances.

## Expanding the ESLint configuration

If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
# React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## React Compiler
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
Note: This will impact Vite dev & build performances.
## Expanding the ESLint configuration
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the [TS template](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) for information on how to integrate TypeScript and [`typescript-eslint`](https://typescript-eslint.io) in your project.
12 changes: 12 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Step 1: Build stage using Maven and Java 21
FROM maven:3.9.6-eclipse-temurin-21 AS build
WORKDIR /app
COPY . .
RUN mvn clean package -DskipTests

# Step 2: Runtime stage to minimize image size
FROM eclipse-temurin:21-jre-jammy
WORKDIR /app
COPY --from=build /app/target/*.war app.war
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.war"]
12 changes: 12 additions & 0 deletions backend/railway.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "mvn clean package -DskipTests"
},
"deploy": {
"startCommand": "java -jar target/iiit-insider.war",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
18 changes: 16 additions & 2 deletions backend/src/main/java/com/iiitinsider/config/FirebaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

@Configuration
public class FirebaseConfig {

@Value("${firebase.credentials.path}")
private String credentialsPath;

@Value("${firebase.service-account-json:}")
private String serviceAccountJson;

@Value("${firebase.database.url:}")
private String databaseUrl;

@Bean
@ConditionalOnExpression("'${firebase.credentials.path:}' != ''")
@ConditionalOnExpression("'${firebase.credentials.path:}' != '' || '${firebase.service-account-json:}' != ''")
public FirebaseMessaging firebaseMessaging() throws IOException {
FirebaseOptions.Builder optionsBuilder = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.fromStream(new FileInputStream(credentialsPath)));
.setCredentials(GoogleCredentials.fromStream(credentialsStream()));

if (databaseUrl != null && !databaseUrl.isBlank()) {
optionsBuilder.setDatabaseUrl(databaseUrl);
Expand All @@ -37,4 +43,12 @@ public FirebaseMessaging firebaseMessaging() throws IOException {

return FirebaseMessaging.getInstance(app);
}

private InputStream credentialsStream() throws IOException {
if (serviceAccountJson != null && !serviceAccountJson.isBlank()) {
return new ByteArrayInputStream(serviceAccountJson.getBytes(StandardCharsets.UTF_8));
}

return new FileInputStream(credentialsPath);
}
}
3 changes: 2 additions & 1 deletion backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Server Configuration
spring.config.import=optional:file:.env[.properties]
server.port=${SERVER_PORT:8080}
server.port=${SERVER_PORT:${PORT:8080}}
server.servlet.context-path=${SERVER_CONTEXT_PATH:/api}

# Database Configuration
Expand Down Expand Up @@ -28,6 +28,7 @@ jwt.refresh-expiration-ms=${JWT_REFRESH_EXPIRATION_MS:604800000}

# Firebase Configuration
firebase.credentials.path=${FIREBASE_CREDENTIALS_PATH:}
firebase.service-account-json=${FIREBASE_SERVICE_ACCOUNT_JSON:}
firebase.database.url=${FIREBASE_DATABASE_URL:}

# CORS Configuration
Expand Down
58 changes: 29 additions & 29 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
26 changes: 13 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>iiit_insider</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>iiit_insider</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
84 changes: 42 additions & 42 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}
#root {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
filter: drop-shadow(0 0 2em #61dafbaa);
}
@keyframes logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: no-preference) {
a:nth-of-type(2) .logo {
animation: logo-spin infinite 20s linear;
}
}
.card {
padding: 2em;
}
.read-the-docs {
color: #888;
}
52 changes: 26 additions & 26 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Navbar from "./Components/Navbar";
import Home from "../src/Pages/Home";
import College from "../src/Pages/College";
import Navbar from "./Components/Navbar";
import Home from "../src/Pages/Home";
import College from "../src/Pages/College";
import Compare from "../src/Pages/Compare";
import User_table from "../src/Pages/User_table";
import Register from "../src/Pages/Register";
Expand All @@ -9,18 +9,18 @@ import Contact from "../src/Pages/Contact";
import Support from "../src/Pages/Support";
import Privacy from "../src/Pages/Privacy";
import { Route, Routes } from "react-router-dom";
import QuickLink from "./Components/QuickLink";

const App = () => {
return (
<div className="bg-black min-h-screen text-white flex flex-col">
<header>
<Navbar />

<main className="grow">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/college" element={<College />} />
import QuickLink from "./Components/QuickLink";
const App = () => {
return (
<div className="bg-black min-h-screen text-white flex flex-col">
<header>
<Navbar />
<main className="grow">
<Routes>
<Route path="/" element={<Home />} />
<Route path="/college" element={<College />} />
<Route path="/compare" element={<Compare />} />
<Route path="/userTable" element={<User_table />} />
<Route path="/register" element={<Register />} />
Expand All @@ -29,14 +29,14 @@ const App = () => {
<Route path="/support" element={<Support />} />
<Route path="/privacy" element={<Privacy />} />
</Routes>
</main>
</header>

<footer className="mt-auto">
<QuickLink />
</footer>
</div>
);
};

export default App;
</main>
</header>
<footer className="mt-auto">
<QuickLink />
</footer>
</div>
);
};
export default App;
Loading