Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into log-history-page
  • Loading branch information
naheyansheikh committed Nov 16, 2024
2 parents b7f7ffb + 3c41454 commit 82b2465
Show file tree
Hide file tree
Showing 27 changed files with 1,977 additions and 266 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
venv/
*.pyc
*.pyo
*.pyd
*.pyz
*.pyw
*.pyc
*.pyo
*.pyd
*.pyz
*.pyw
node_modules
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,71 @@ Our app will have the following components:
- Database
- Transcription

### Project Structure
```
├── assets # assets such as logos, marketing materials, transcription pages, provided to us by Flowleaflets. Please keep them here instead of the `public` folder in frontend
├── backend
│ ├── routes # most of the backend code for API routes should be here
│ ├── ├── ...
│ ├── index.js # Code for running the server and some basic routes
│ ├── package.json
│ ├── package_lock.json
│ ├── .env.example #example env file
│ └── .gitignore
└──
├── frontend
│ ├── src
│ ├── ├── assets
│ ├── ├── ├── ...
│ ├── ├── pages # frontend code for each page should go here
│ ├── ├── ├── ...
│ ├── ├── utils # put util or helper functions that are shared across multiple files here (eg: protectedRoutes)
│ ├── ├── ├── ...
│ ├── ├── App.jsx # Main component of the app, likely do not need to modify this
│ ├── ├── App.css # Styles for App.jsx, likely do not need to modify this
│ ├── ├── index.css # global css styles go here
│ ├── ├── main.jsx # root layout of app, wrap all pages inside it
│ ├── public # Use assets folder instead of this one for logos and visual assets
│ ├── ├── ...
│ ├── package.json
│ ├── package_lock.json
│ ├── other config files
│ ├── .env.example #example env file
│ └── .gitignore
└──
├── transcription # All code related to the transcription models should be here
│ ├── requirements.txt # list of required python packages
│ └── testing.py # run Microsoft Florence 2 model on a test file
└──
```
# Setup
- Install Node.js and npm
- Install Python version 3.12 or later
- Clone the repository

## Backend - Node.js
1. 'cd backend' to change directory to backend folder
2. 'npm install' to install dependencies
3. 'npm run dev' to run local development server

#### .env file
1. Create a new `.env` file in the backend directory, where the `.env.example` file is located.
2. Copy the contents of the `.env.example` file
3. Fill in with the correct credentials

## Frontend - React + Vite
1. 'cd frontend' to change directory to frontend folder
2. 'npm install' to install dependencies
3. 'npm run dev' to run local development server

#### .env file
1. Create a new `.env` file in the frontend directory, where the `.env.example` file is located.
2. Copy the contents of the `.env.example` file
3. Fill in with the correct credentials

## Transcription - Python
1. `cd transcription` to change directory to transcription folder
2. `pip install -r "requirements.txt"` to install required packages
3. `python testing.py` or `python3 testing.py` to run the script

NOTE: These packages are in the `requirements.txt` file, but if you get an error telling you to install einops or timm, use `pip install einops timm` to install einops and timm seperately.
4 changes: 4 additions & 0 deletions assets/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore every file in this folder
*
# Except this one
!.gitignore
3 changes: 3 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SUPABASE_JWT_SECRET=
SUPABASE_URL=
SUPABASE_ANON_KEY=
4 changes: 3 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,6 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

.env
21 changes: 14 additions & 7 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import express from "express";
import cors from "cors";
import dotenv from "dotenv";
import express from "express";
import authRoutes from "./src/routes/authRoutes.js";
import logRoutes from "./src/routes/logRoutes.js";

dotenv.config();

const corsOptions = {
origin: ["http://localhost:5173"],
};
const app = express();
const PORT = process.env.PORT || 8080;

app.use(cors(corsOptions));
app.use(express.json());

const PORT = process.env.PORT || 8080;

app.get("/api", (req, res) => {
res.json({ message: "Hello from server!" });
});
//Routes
app.use('/api/auth', authRoutes);
app.use('/api/log', logRoutes);

app.listen(PORT, () => {
console.log(`Server listening on ${PORT}`);
});
});

Loading

0 comments on commit 82b2465

Please sign in to comment.