Skip to content

HackerSchool/HS-WebApp

Repository files navigation

πŸ† Hacker League

Hacker League Logo

Welcome to Hacker League!

A task-gamification system designed to recognize and reward the best contributors of HackerSchool through a structured competitive framework.


πŸ“œ Project History

This noble project, first wrought by the esteemed craftsman JosΓ© Lopes (known throughout the realm as @MIBismuth), was christened in days of yore as "HS-WebApp" and didst flourish under his skilled hand (consult ye the ancient scrolls preserved in the legacy branch for proof of these bygone times).

Verily, this humble creation served as the cornerstone most foundational in the construction of the grand Hacker League project. Through great toil and scholarly pursuit, the project hath been most triumphantly transmuted from the primitive tongue of vanilla JavaScript unto the more refined and courtly language of React, thereby achieving superior maintainability and providing a most pleasant experience for all who venture forth to use it.

πŸ”— Related Repositories

  • HS-API - Flask REST API backend for managing HackerSchool members and projects

βœ… Current Features

🏠 Leaderboard System

  • Interactive Leaderboard with team and individual classifications
  • Multiple Point Types: Total, PJ (Journey Points), and PCC (Community Contribution Points)
  • Dynamic Controls: Inline dropdown menus for classification type and point filtering
  • Medal System: πŸ₯‡πŸ₯ˆπŸ₯‰πŸŽ–️ for top 5 positions with position-specific colors
  • Statistics Dashboard: Total participants, active teams, and total points
  • Expandable History: Click rows to see recent activity with "See more" navigation
  • Real-time Sorting: Sort by Total Points, PJ Points, or PCC Points

πŸ“Š History Page

  • Comprehensive Activity Log: View all point attributions across teams and individuals
  • Advanced Filtering: Filter by entity type (Teams/Individuals), points type (PJ/PCC), and specific entities
  • Chronological Sorting: Automatically sorted from most recent to oldest entries
  • Pagination: Navigate through large datasets with 10 items per page
  • Expandable Details: Click rows to see full activity descriptions

πŸ‘€ User Profile System

  • Personal Profile Management: Edit user information, upload logos
  • Logo Upload: Local file upload with Base64 storage and persistence
  • Team Selection: Multi-team membership with checkbox interface
  • Profile Data: Display member number, join date, IST ID, roles, and additional info
  • Edit Mode: Toggle between view and edit modes with form validation

πŸ” Authentication System

  • Secure Login/Logout: Cookie and local storage support
  • Mock User System: Available for development testing (admin, alexchen, mariasantos, davidkim)
  • Session Management: Persistent login state
  • Role Management: Admin and user roles with appropriate permissions

πŸ› οΈ Admin Panel

User Management

  • Complete CRUD Operations: Create, edit, and delete users
  • Team Assignment: Add users to multiple teams with coordinator role selection
  • Create New Teams: Inline team creation when adding users
  • Role Management: Assign and manage user roles (member, dev, rh, admin, sysadmin, etc.)
  • Profile Management: Edit IST ID, name, email, and other user details
  • Pagination: Navigate through user lists efficiently
  • Form Validation: Complete validation with error handling

Points History Management

  • Award Points: Create point entries for team members
  • Multi-User Selection: Award points to multiple users at once
  • Points Types: Support for PJ (Project), PCC (Community Contribution), and PS (Special) points
  • Edit & Delete: Modify or remove existing point entries
  • Chronological Sorting: View entries from most recent to oldest
  • Team Integration: Automatic team member fetching for point attribution
  • Pagination: Navigate through large point history datasets

πŸ› οΈ Tech Stack

  • Frontend: React 18 with React Router v6
  • Backend API: Flask REST API with SQLite database (HS-API)
  • Local Backend: Node.js/Express server for admin operations
  • State Management: React Context API with hooks
  • Styling: CSS3 with responsive design and custom color scheme
  • Authentication: Cookie-based session management with Fenix OAuth integration
  • API Communication: Axios with CORS support
  • File Handling: FileReader API for local image uploads

πŸ“ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Admin/
β”‚   β”‚   β”œβ”€β”€ AdminPanel.jsx
β”‚   β”‚   β”œβ”€β”€ UserManagement/
β”‚   β”‚   β”‚   β”œβ”€β”€ UserManagement.jsx
β”‚   β”‚   β”‚   └── UserManagement.css
β”‚   β”‚   β”œβ”€β”€ PointsHistory/
β”‚   β”‚   β”‚   β”œβ”€β”€ PointsHistory.jsx
β”‚   β”‚   β”‚   └── PointsHistory.css
β”‚   β”‚   └── ContentManagement/
β”‚   β”‚       β”œβ”€β”€ HallOfFameAdmin.jsx
β”‚   β”‚       β”œβ”€β”€ SeasonAdmin.jsx
β”‚   β”‚       └── HackNightAdmin.jsx
β”‚   β”œβ”€β”€ Auth/
β”‚   β”‚   β”œβ”€β”€ LoginForm.jsx
β”‚   β”‚   └── Auth.css
β”‚   β”œβ”€β”€ History/
β”‚   β”‚   β”œβ”€β”€ History.jsx
β”‚   β”‚   └── History.css
β”‚   β”œβ”€β”€ Layout/
β”‚   β”‚   β”œβ”€β”€ Navbar.jsx
β”‚   β”‚   └── Navbar.css
β”‚   β”œβ”€β”€ Leaderboard/
β”‚   β”‚   β”œβ”€β”€ LeaderboardTable.jsx
β”‚   β”‚   └── Leaderboard.css
β”‚   β”œβ”€β”€ Profile/
β”‚   β”‚   β”œβ”€β”€ UserProfile.jsx
β”‚   β”‚   └── Profile.css
β”‚   β”œβ”€β”€ HallOfFame/
β”‚   β”‚   β”œβ”€β”€ HallOfFame.jsx
β”‚   β”‚   └── HallOfFame.css
β”‚   β”œβ”€β”€ Modal/
β”‚   β”‚   β”œβ”€β”€ Modal.jsx
β”‚   β”‚   └── Modal.css
β”‚   β”œβ”€β”€ Pagination/
β”‚   β”‚   β”œβ”€β”€ Pagination.jsx
β”‚   β”‚   └── Pagination.css
β”‚   └── PrivateRoute.jsx
β”œβ”€β”€ contexts/
β”‚   └── AuthContext.jsx
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ LeaderboardPage.jsx
β”‚   β”œβ”€β”€ HistoryPage.jsx
β”‚   β”œβ”€β”€ ProfilePage.jsx
β”‚   β”œβ”€β”€ HallOfFamePage.jsx
β”‚   └── AdminPage.jsx
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ apiService.js
β”‚   β”œβ”€β”€ memberService.js
β”‚   β”œβ”€β”€ projectService.js
β”‚   β”œβ”€β”€ taskService.js
β”‚   └── projectParticipationService.js
β”œβ”€β”€ App.jsx
└── index.js

πŸš€ Getting Started

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Python 3.11+ (for HS-API)
  • pip or uv (Python package manager)

Installation

  1. Clone the repositories

    # Clone the main web app
    git clone https://github.com/HackerSchool/Hacker-League.git
    cd Hacker-League/HS-WebApp
    
    # Clone the API (in a separate location)
    git clone https://github.com/HackerSchool/HS-API.git
  2. Setup Backend API (HS-API)

    cd HS-API
    # Install dependencies (using uv or pip)
    uv sync  # or: pip install -r requirements.txt
    
    # Run database migrations
    flask db upgrade
    
    # Start the API server
    flask run --port 8080
  3. Setup Local Backend Server

    cd HS-WebApp/backend
    npm install
    npm start
  4. Setup Frontend

    cd HS-WebApp
    npm install
    npm start
  5. Open your browser

    • Frontend: http://localhost:3000
    • Flask API: http://localhost:8080
    • Local Backend: Port varies (check backend logs)

Authentication

The application uses Fenix OAuth for authentication. Users can log in using their IST TΓ©cnico credentials.

For development/testing purposes, the backend includes populated test data with various users and teams.

Building for Production

npm run build

🎨 Design System

Color Scheme

  • Primary Dark: #2b2a28 (Dark gray)
  • Primary Green: #6dba76 (Green)
  • Primary Blue: #156082 (Blue)
  • Text: White for contrast
  • Accent: #90EE90 (Light green for username)

πŸ§ͺ Testing

# Run tests
npm test

# Run tests with coverage
npm test -- --coverage

πŸš€ Deployment

Build for Production

npm run build

Deploy to Static Hosting

The build folder contains static files that can be deployed to:

  • Netlify
  • Vercel
  • GitHub Pages
  • AWS S3

🀝 Contributing

Team Structure

  • Decider: GonΓ§alo Fecha
  • Developers: AndrΓ© Caseiro, AndrΓ© Santos, Armando GonΓ§alves, GonΓ§alo Azevedo
  • Technical Expert: JosΓ© Lopes, Filipe PiΓ§arra
  • Game Design: JoΓ£o Rodrigues, Filipe Vaz
  • Logo Design: Francisco GonΓ§alves

How to contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request
  6. Pls Pls Pls remember to update README and rest of documentation, if existing.

πŸ“ License

This project is licensed under the MIT License. Feel free to fork, modify, and share your improvements!

πŸ†˜ Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Contact the development team

About

Frontend for Hacker League

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •