Skip to content

v1.0 Study Materials App

Choose a tag to compare

@mayank-0103 mayank-0103 released this 03 May 09:16
· 2 commits to main since this release
857e916

Study Materials Store (v1.0)

A full-stack web application for selling and distributing study materials with secure password-protected downloads.

🌟 Features

  • πŸ” User authentication (signup/login)
  • πŸ‘‘ Admin dashboard for managing content
  • πŸ›’ Shopping cart functionality
  • πŸ’³ Checkout system with GST calculation
  • πŸ“„ Automatic PDF bill generation
  • πŸ”‘ Secure one-time password for downloads
  • πŸ“š Subject-wise material organization
  • πŸ” Search and filter capabilities
  • 🌐 Easy server management with batch scripts

πŸ› οΈ Tech Stack

  • Frontend: HTML, CSS, JavaScript
  • Backend: Node.js, Express.js
  • File Handling: Multer
  • PDF Generation: PDFKit
  • Security: Crypto for OTP generation

πŸ“¦ Prerequisites

  • Node.js (v14+ recommended)
  • npm (comes with Node.js)
  • Python (for serving frontend)
  • Web browser with JavaScript enabled

⚑ Quick Start

  1. Clone the repository

    git clone <repository-url>
    cd study-materials-app
  2. Set up backend

    cd backend
    npm install
    npm start

    Server runs at: http://localhost:3000

  3. Launch frontend
    Using VS Code:

    • Install "Live Server" extension
    • Right-click frontend/index.html
    • Select "Open with Live Server"

    Or using Python's HTTP server:

    cd frontend
    python -m http.server 5500

    Access at: http://localhost:5500

  4. Automated Server Management

    • Start both servers using the batch script:
      start-servers.bat
    • Stop both servers using the batch script:
      stop-servers.bat

πŸ“ Project Structure

study-materials-app/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ server.js          # Express server & API endpoints
β”‚   β”œβ”€β”€ admin.json         # Admin credentials
β”‚   β”œβ”€β”€ users.json         # User data
β”‚   β”œβ”€β”€ files-config.json  # File mapping configuration 
β”‚   β”œβ”€β”€ subjects.json      # Subject definitions
β”‚   β”œβ”€β”€ bills/            # Generated PDF bills
β”‚   └── files/            # Protected study materials
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html        # Main store page
β”‚   β”œβ”€β”€ admin.html        # Admin dashboard
β”‚   β”œβ”€β”€ login.html        # User login
β”‚   β”œβ”€β”€ signup.html       # User registration
β”‚   β”œβ”€β”€ style.css         # Main styles
β”‚   β”œβ”€β”€ signup.css        # Auth pages styles
β”‚   β”œβ”€β”€ app.js           # Core application logic
β”‚   └── items.js         # Study materials data
β”œβ”€β”€ start-servers.bat     # Script to start servers
└── stop-servers.bat      # Script to stop servers

πŸ”‘ Authentication

User Login

  • Email and password based
  • Purchase history tracking
  • Password change functionality

Admin Login

  • Default credentials:
  • Access to user management
  • Material upload capabilities

πŸ’Ό Admin Features

  1. User Management

    • View all users
    • Track user purchases
    • View purchase history
  2. Content Management

    • Add/remove study materials
    • Set prices and descriptions
    • Upload protected PDF files
    • Manage subject categories

πŸ›οΈ Shopping Features

  1. Cart System

    • Add/remove items
    • Real-time price calculation
    • GST (18%) included
  2. Checkout Process

    • Automatic bill generation
    • Unique download passwords
    • Purchase history tracking
  3. Download Security

    • One-time passwords
    • Timed download links
    • Secure file access

πŸ” Security Features

  • Password-protected downloads
  • One-time use passwords
  • Secure file storage
  • Token-based downloads
  • Admin access control

πŸ› οΈ Configuration

Admin Settings

Edit backend/admin.json:

{
  "email": "admin@study.com",
  "password": "your-secure-password"
}

File Storage

Protected files location: backend/files

  • Supported format: All(.pdf recommended)
  • Auto-configured on upload

πŸ“ Development Notes

  1. Adding New Features

    • Backend: Add routes in server.js
    • Frontend: Extend app.js functionality
    • Styles: Modify appropriate CSS files
  2. Security Considerations

    • Use HTTPS in production
    • Implement proper password hashing
    • Add rate limiting for downloads

πŸš€ Production Deployment

  1. Backend Preparation

    • Set up proper database
    • Configure environment variables
    • Implement proper security measures
  2. Frontend Optimization

    • Minify JavaScript and CSS
    • Optimize images
    • Enable caching

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a pull request

πŸ“„ License

This project is licensed under the ISC License

Full Changelog: https://github.com/mayank-0103/study-materials-app/commits/v1.0