Skip to content
Open
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
21 changes: 21 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
25 changes: 25 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
package-lock.json
53 changes: 53 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Vercel Clone

This project is a clone of Vercel, built with React and Vite. It provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Project Structure

The frontend directory structure is as follows:
frontend/ .eslintrc.cjs index.html package.json
public/ src/ App.jsx
components/ Button.jsx ErrorBoundary.jsx Header.jsx Input.jsx Welcome.jsx index.css main.jsx
service/ apiService.js
View/ Home.jsx Submission.jsx


## Setup

To set up the frontend project, follow these steps:

1. Navigate to the `frontend` directory.
2. Run `npm install` to install the project dependencies.

## Boot

To start the frontend project, run `npm run dev` in the `frontend` directory. This will start the Vite development server.

## Dependencies

The frontend project uses the following dependencies:

- React for building the UI.
- Vite for building the project and providing a development server.
- Axios for making HTTP requests.
- Socket.io-client for real-time communication with the server.
- @emotion/react and @emotion/styled for styling components.

For more information, refer to the `package.json` file in the `frontend` directory.

## How to Use
- Navigate to the Submission Page: The submission page is where you can submit your GitHub repository for deployment. You can navigate to the submission page by clicking on the "Submission" link in the header.

- Enter your GitHub Repository Link: In the "GitHub Repo Link" field, enter the URL of the GitHub repository you want to deploy. The URL should be in the format https://github.com/username/repo.

- Enter a Slug (Optional): In the "Slug" field, you can enter a slug for your project. This is optional. If you don't provide a slug, one will be generated for you.

- Click "Deploy": Click the "Deploy" button to submit your repository for deployment. While your repository is being deployed, the button will display "In Progress".

- View the Logs: After you've submitted your repository, you can view the logs for your deployment. The logs will automatically update as new logs are generated.

- View Your Deployed Application: A preview URL will be displayed above the logs. You can click this URL to view your deployed application. (this may take few minutes)

- Start a New Submission: To start a new submission, click the "New Submission" button. This will take you back to the submission page where you can submit a new repository for deployment.

- Please note that this application is a clone of Vercel and is intended for educational purposes. It may not support all the features of Vercel.
13 changes: 13 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +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>Vercel Clone</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "vercel-clone",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"axios": "^1.6.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.0",
"socket.io-client": "^4.7.4"
},
"devDependencies": {
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.1.0"
}
}
1 change: 1 addition & 0 deletions frontend/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import styled from "@emotion/styled";
import Header from "./components/Header";
import Home from "./View/Home";
import Submission from "./View/Submission";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";

function App() {
const Styled = styled.div`
width: 100vw;
height: 100vh;
overflow: hidden;
.header {
height: 80px;
}
.body {
height: calc(100% - 80px);
display: flex;
justify-content: center;
align-items: center;
overflow-x: hidden;
overflow-y: auto;
}
`;

return (
<Router>
<Styled>
<Header />
<div className="body">
<Routes>
<Route path="*" element={<Home />} />
<Route path="/submission" element={<Submission />} />
</Routes>
</div>
</Styled>
</Router>
);
}

export default App;
19 changes: 19 additions & 0 deletions frontend/src/View/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import styled from "@emotion/styled";
import Welcome from "../components/Welcome";

const Home = () => {
const Styled = styled.div`
padding: 20px;
text-align: center;
@media (max-width: 768px) {
padding: 10px;
}
`;
return (
<Styled>
<Welcome />
</Styled>
);
};

export default Home;
Loading