Skip to content

πŸ“‚ File management system for MIT Preparation Academy. Securely store, manage, and serve user-generated content with a focus on performance, accessibility, and scalability.

License

Notifications You must be signed in to change notification settings

MITPAcademy/files.mitpa.tech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MITPA SE File Server

This is a simple Express.js server that connects to a DigitalOcean Spaces bucket to list and serve PDF files β€” primarily used to distribute Simulated Exams (SEs) for the MITPA community.

πŸ“ This service provides a user-friendly interface and a JSON API to access available SEs.

⚠️ All SEs are for practice and should not be considered official content.

πŸ”— Visit: https://files.mitpa.tech


πŸš€ Endpoints

1. /

  • Method: GET
  • Description: Renders an HTML page listing all SEs (.pdf files).
  • Includes: File sizes and a friendly MITPA usage warning.

2. /files

  • Method: GET

  • Description: Returns a JSON array of all available SEs with:

    • name
    • size
    • url
  • Example Response:

[
  {
    "name": "MITPA_SE_Math1.pdf",
    "size": "324.56 KB",
    "url": "http://files.mitpa.tech/download?file=MITPA_SE_Math1.pdf"
  }
]

3. /download

  • Method: GET
  • Query Param: file (required)
  • Description: Downloads the specified file directly from the bucket.
  • Example:
    http://files.mitpa.tech/download?file=MITPA_SE_Math1.pdf

🌱 Environment Variables

You must create a .env file in the root with the following:

DO_SPACES_ENDPOINT=nyc3.digitaloceanspaces.com
DO_SPACES_KEY=your-access-key
DO_SPACES_SECRET=your-secret-key
DO_SPACES_BUCKET=mitpa-se-files

⚠️ Never commit your .env file to version control.


πŸ› οΈ Installation & Running

# 1. Clone the repo
git clone https://github.com/MITPAcademy/files.mitpa.tech.git

# 2. Navigate into project
cd se-file-server

# 3. Install dependencies
npm install

# 4. Start the server
npm start

πŸ“¦ Built With


🀝 Contributing

We welcome your contributions to improve this server and make SE access even better for MITPA members!

  • Fork the repo
  • Create a branch (fix/se-listing, feat/download-logging, etc.)
  • Commit your changes
  • Open a pull request

For major changes, please open an issue first.


πŸ“« Contact

About

πŸ“‚ File management system for MIT Preparation Academy. Securely store, manage, and serve user-generated content with a focus on performance, accessibility, and scalability.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project