Skip to content
Closed
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
5 changes: 0 additions & 5 deletions .firebaserc

This file was deleted.

132 changes: 132 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# MajorAudit

## Repository Layout
- `/frontend`: The current face of the site, built with React.
- `/backend`: The backend logic for the site, built with Flask.
- `/scrapers`: Chrome extensions for web scraping.
- `/docs`: Documentation.

## Local Development Environment

We're working fullstack.

### Requirements
- Access to MajorAudit GitHub repository.
- npm (Node Package Manager).

### Setup Instructions

0. Clone the MajorAudit Repository:
```bash
git clone <repository_url>
```

### Base Firebase Setup
1. In the root directory, run:
```bash
npm install -g firebase-tools
```
_Note: If it throws permission errors, prepend the command with `sudo`:_
```bash
sudo npm install -g firebase-tools
```

### Backend Setup (Python Virtual Environment)
2. Update Python to version 3.12.
- You can use [Homebrew](https://brew.sh/) to install the latest version of Python:
```bash
brew install [email protected]
```

3. Navigate to the `/backend` directory.
4. Create a virtual environment:
```bash
python3.12 -m venv venv
```
5. Activate the virtual environment:
```bash
source venv/bin/activate
```
6. Install the required dependencies:
```bash
pip install -r requirements.txt
```
7. Deactivate the virtual environment:
```bash
deactivate
```

### Secrets Setup
8. Create a `secrets` directory in the `/backend` folder:
```bash
mkdir secrets
```
9. Go to the [Firebase Console](https://console.firebase.google.com/).
10. Select the `majoraudit` project.
11. Click the gear icon next to "Project Overview" and select "Project Settings".
12. Navigate to the "Service Accounts" tab.
13. Generate a new Node.js private key.
14. Move the generated key file to your `secrets` directory.
15. Update the path to the key file in `main.py`:
```python
cred = credentials.Certificate(r'path_to_secrets_file')
```

### Running the Project
1. Install the required frontend dependencies:
```bash
cd frontend
npm i
```

2. Ensure you have Java version >= 20 installed.

3. Log in to Firebase:
```bash
firebase login
```

4. In the `/frontend` directory, build the frontend:
```bash
npm run build
```

5. In the root or `/frontend` directory, start the Firebase emulators:
```bash
firebase emulators:start
```

6. Troubleshoot any errors as needed.

### Notes
- **Frontend Changes**: Anytime you change the frontend code, stop the emulators, rebuild the frontend, and restart the emulators. The emulators only host the most recent build.
- **Web Scraper Changes**: If you modify the web scraper, remove and reconfigure the extension in Chrome.
- **Backend Changes**: You can modify the backend code on the fly. The emulators will automatically restart when you save changes.

### Strategies for Development
- **Frontend-Only Development**:
1. Change the `useState(auth)` value in `App.tsx` to `true`.
2. Modify the `initLocalStorage()` method in `Graduation.tsx` to use `MockStudent` instead of calling the `getData()` API.
3. Run the frontend in development mode:
```bash
npm start
```
4. The frontend will now automatically update as you make changes.

## Contributing
1. Create a branch for your feature:
```bash
git checkout -b <username>/<feature_name>
```
2. Make your changes.
3. Commit and push your changes to the origin:
```bash
git commit -m "Your commit message"
git push origin <branch_name>
```
4. Create a pull request and add reviewers. In the pull request, reference any relevant issue numbers.
5. Once the pull request is approved, merge it into the master branch.

## Roadmap
- We use GitHub issues to track bugs and feature requests: [GitHub Issues](https://github.com/YaleComputerSociety/MajorAudit/issues).
- We use GitHub projects to manage everything and do planning: [GitHub Projects](https://github.com/orgs/YaleComputerSociety/projects/2/).
66 changes: 0 additions & 66 deletions firebase.json

This file was deleted.

4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "new-audit",
"name": "majoraudit",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
Binary file added frontend/public/guy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions frontend/public/spring.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions frontend/src/api/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

import { Ryan } from "@/database/data-user";
import { NextRequest, NextResponse } from "next/server";

export function login(req: NextRequest) {
const user = Ryan;

const response = NextResponse.json(user, { status: 200 });

response.cookies.set("session", "true", {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
sameSite: "strict",
maxAge: 60 * 60,
path: "/",
});

return response;
}
35 changes: 35 additions & 0 deletions frontend/src/app/account/Account.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

.Row {
display: flex;
flex-direction: row;
}

.Column {
display: flex;
flex-direction: column;
}

.AccountPage {
position: absolute;
top: 75px;

display: flex;
flex-direction: column;
align-items: center;

width: 100%;
padding-top: 50px;
padding-bottom: 200px;
}

.AccountContent {
width: 600px; /* Adjust the width as needed */
padding: 20px;
background-color: white; /* Optional, just to make the box visible */
border-radius: 10px; /* Optional, for rounded corners */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional, for a subtle shadow */

display: flex;
flex-direction: column;
align-items: flex-start; /* Ensures text and elements inside are left-aligned */
}
Loading
Loading