Skip to content

Gem2005/feedback-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Feedback System

A lightweight feedback system for internal feedback sharing between managers and team members at a company. The system enables structured, ongoing feedback in a simple, secure, and friendly interface.

๐Ÿš€ Features

Core Features (MVP)

  • Authentication & Roles: Two user roles (Manager and Employee) with basic login system
  • Team Management: Managers can only see their team members
  • Feedback Submission: Managers can submit structured feedback with:
    • Strengths
    • Areas to improve
    • Overall sentiment (positive/neutral/negative)
    • Multiple feedback entries per employee
  • Feedback Visibility:
    • Employees can see feedback they've received
    • Managers can view and edit their past feedback
    • Employees can acknowledge feedback they have read
  • Dashboard:
    • Manager: Team overview with feedback count and sentiment trends
    • Employee: Timeline of feedback received

Additional Features

  • Responsive Design: Clean, modern UI that works on all devices
  • Real-time Updates: Instant feedback on actions
  • Data Visualization: Charts and graphs for better insights
  • Secure Authentication: JWT-based authentication system

๐Ÿ›  Tech Stack

Backend

  • Python: FastAPI framework
  • Database: PostgreSQL with SQLAlchemy ORM
  • Authentication: JWT tokens with bcrypt password hashing
  • API Documentation: Automatic OpenAPI/Swagger documentation
  • Docker: Containerized backend application

Frontend

  • React: TypeScript-based React application
  • Styling: Tailwind CSS for modern, responsive design
  • Routing: React Router for navigation
  • State Management: Context API for authentication
  • HTTP Client: Axios for API communication
  • Icons: Lucide React for consistent iconography
  • Date Handling: date-fns for date formatting

๐Ÿ“ฆ Installation & Setup

Prerequisites

  • Python 3.11+
  • Node.js 16+
  • PostgreSQL 12+
  • Docker (optional, for containerized deployment)

Backend Setup

  1. Clone the repository

    git clone <repository-url>
    cd feedback-system
  2. Set up Python environment

    cd backend
    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
  3. Set up environment variables

    cp .env.example .env
    # Edit .env with your database credentials and secret key
  4. Set up database

    # Create PostgreSQL database
    createdb feedback_db
    
    # Run the application (this will create tables automatically)
    uvicorn app.main:app --reload
  5. Access API documentation

Frontend Setup

  1. Install dependencies

    cd frontend
    npm install
  2. Set up environment variables

    # Create .env file (optional)
    echo "REACT_APP_API_URL=http://localhost:8000/api" > .env
  3. Start development server

    npm start
  4. Access application

Docker Setup (Backend only)

cd backend
docker build -t feedback-system-backend .
docker run -p 8000:8000 \
  -e DATABASE_URL="postgresql://user:password@host:5432/feedback_db" \
  -e SECRET_KEY="your-secret-key" \
  feedback-system-backend

๐ŸŽฏ Usage

Initial Setup

  1. Start the backend server
  2. Start the frontend development server
  3. Navigate to http://localhost:3000
  4. Register as a manager first (no manager_id required)
  5. Register employees and assign them to the manager

Manager Workflow

  1. Dashboard: View team statistics and feedback overview
  2. Manage Feedback: Create, edit, and delete feedback for team members
  3. Track Acknowledgments: See which feedback has been read by employees

Employee Workflow

  1. Dashboard: View personal feedback timeline
  2. Acknowledge Feedback: Mark feedback as read
  3. Track Progress: Monitor feedback trends over time

๐Ÿ— Architecture & Design Decisions

Database Schema

  • Users Table: Stores user information with role-based access
  • Feedback Table: Stores feedback with foreign key relationships
  • Hierarchical Structure: Manager-employee relationships through manager_id

API Design

  • RESTful API: Clear, consistent endpoints
  • Authentication: JWT-based stateless authentication
  • Role-based Access: Middleware for role-specific endpoints
  • Error Handling: Comprehensive error responses with proper HTTP status codes

Frontend Architecture

  • Component-based: Reusable React components
  • Context API: Global state management for authentication
  • Responsive Design: Mobile-first approach with Tailwind CSS
  • Type Safety: TypeScript for better development experience

Security Considerations

  • Password Hashing: bcrypt for secure password storage
  • JWT Tokens: Short-lived access tokens
  • CORS Configuration: Proper cross-origin resource sharing setup
  • Input Validation: Server-side validation for all inputs
  • SQL Injection Prevention: SQLAlchemy ORM with parameterized queries

๐Ÿ”’ Authentication & Authorization

User Roles

  • Manager: Can create, read, update, and delete feedback for their team
  • Employee: Can read their own feedback and acknowledge it

Access Control

  • Managers can only see their direct reports
  • Employees can only see their own feedback
  • JWT tokens expire after 30 minutes (configurable)

๐Ÿ“Š Database Schema

-- Users table
CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    email VARCHAR UNIQUE NOT NULL,
    hashed_password VARCHAR NOT NULL,
    full_name VARCHAR NOT NULL,
    role VARCHAR NOT NULL, -- 'manager' or 'employee'
    manager_id INTEGER REFERENCES users(id),
    created_at TIMESTAMP DEFAULT NOW()
);

-- Feedback table
CREATE TABLE feedback (
    id SERIAL PRIMARY KEY,
    manager_id INTEGER REFERENCES users(id) NOT NULL,
    employee_id INTEGER REFERENCES users(id) NOT NULL,
    strengths TEXT NOT NULL,
    areas_to_improve TEXT NOT NULL,
    overall_sentiment VARCHAR NOT NULL, -- 'positive', 'neutral', 'negative'
    created_at TIMESTAMP DEFAULT NOW(),
    updated_at TIMESTAMP DEFAULT NOW(),
    is_acknowledged BOOLEAN DEFAULT FALSE
);

๐Ÿš€ Deployment

Backend Deployment

The backend is containerized and can be deployed to any container platform:

# Build Docker image
docker build -t feedback-system-backend ./backend

# Run with environment variables
docker run -p 8000:8000 \
  -e DATABASE_URL="postgresql://user:password@host:5432/feedback_db" \
  -e SECRET_KEY="your-production-secret-key" \
  feedback-system-backend

Frontend Deployment

The frontend can be built and deployed to any static hosting service:

cd frontend
npm run build
# Deploy the build folder to your hosting service

๐Ÿงช Testing

Backend Testing

cd backend
pytest

Frontend Testing

cd frontend
npm test

๐Ÿ”ง Environment Variables

Backend (.env)

DATABASE_URL=postgresql://postgres:password@localhost:5432/feedback_db
SECRET_KEY=your-secret-key-change-this-in-production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

Frontend (.env)

REACT_APP_API_URL=http://localhost:8000/api

๐Ÿ“ API Endpoints

Authentication

  • POST /api/auth/register - Register new user
  • POST /api/auth/login - Login user
  • GET /api/auth/me - Get current user info

Users

  • GET /api/users/team - Get team members (managers only)
  • GET /api/users/managers - Get all managers
  • GET /api/users/dashboard - Get dashboard stats (managers only)

Feedback

  • GET /api/feedback/ - Get feedback (role-based)
  • POST /api/feedback/ - Create feedback (managers only)
  • PUT /api/feedback/{id} - Update feedback (managers only)
  • PATCH /api/feedback/{id}/acknowledge - Acknowledge feedback (employees only)
  • DELETE /api/feedback/{id} - Delete feedback (managers only)

๐ŸŽจ UI/UX Features

  • Clean, Modern Design: Tailwind CSS for consistent styling
  • Responsive Layout: Works on desktop, tablet, and mobile
  • Intuitive Navigation: Clear menu structure and breadcrumbs
  • Visual Feedback: Loading states, success/error messages
  • Accessibility: Proper ARIA labels and keyboard navigation
  • Color-coded Sentiments: Visual indicators for feedback types

๐Ÿ”ฎ Future Enhancements

  • Email Notifications: Notify employees of new feedback
  • Feedback Templates: Pre-defined feedback templates
  • Goal Tracking: Set and track performance goals
  • Peer Reviews: Employee-to-employee feedback
  • Analytics Dashboard: Advanced reporting and analytics
  • Export Functionality: PDF/CSV export of feedback data
  • Mobile App: Native mobile application
  • Integration: Slack/Teams integration for notifications

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ฅ Team

Built with โค๏ธ for improving workplace feedback culture.


For questions or support, please contact the development team.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors