This repository contains the source code and documentation for SUP, a client-server web application designed to connect tutors and students within a high school environment. While developed for a specific gymnasium, the platform is built with scalability in mind and can be adapted for use in other educational institutions, including universities.
SUP is available here.
- Project Overview
- Features
- Technical Stack
- Database Architecture
- Application Structure
- Installation and Setup
- Usage
- Future Plans
- Author
- License
The primary goal of SUP is to provide a convenient and efficient platform for communication between student tutors and students needing academic assistance. This addresses the long-standing challenge of informal tutor groups lacking a centralized communication system, which often hindered their effectiveness. The application aims to streamline the process of requesting and offering help, making tutoring more accessible and impactful.
The SUP application includes the following key functionalities:
- Multi-language Support: Available in both Russian and English.
- Theme Options: Supports light and dark UI themes.
- Cross-platform Compatibility: Fully responsive and accessible on all browsers, operating systems, and device sizes (desktop, tablet, smartphone).
- User Roles: Two levels of user access: regular user and moderator.
- User Authentication: Secure user authentication process.
- Post Management: Users can publish, modify, and delete posts requesting or offering help.
- Post Viewing and Interaction: View posts from other users, including a list of all responses to a post.
- Responding to Posts: Ability to respond to other users' posts.
- Tutor Selection: Post owners can select a tutor from the list of users who have responded to their post.
- Search Functionality: Search for posts by title and subject.
- User Search: Search for users by name and class.
- Profile Management: View personal and other user profiles, including mutual responses to posts. Ability to edit personal information (phone number, name, class, etc.).
- Reporting and Blocking: Functionality to report and block user accounts violating application rules.
The application is built using a modern JavaScript-centric stack to ensure performance, reliability, and ease of development:
- Frontend: React (for building single-page applications and user interfaces).
- Backend: Node.js (as the server-side runtime environment) with Express.js (for routing and middleware).
- Database: MongoDB (NoSQL database, chosen for its flexibility in handling varied document structures).
- Vercel: Hosted on Vercel.
The database is designed to be efficient and flexible, leveraging MongoDB's NoSQL capabilities. It is organized into collections, with each collection containing individual documents that can have varying fields and data types.
The core collections and their fields are:
id: String (Unique identifier for the user)pfp: String (Path to profile picture)name: Stringsurname: Stringgrade: Stringbio: String (User's biography)email: String (Unique email for login)password: String (Hashed password)phone: Stringverified: Boolean (Indicates if user is verified)banned: String (Timestamp or 'false'/'forever' for ban status)moderator: Boolean (Indicates if user has moderator privileges)accessLevel: Numberrole: String (e.g., 'student', 'teacher')subjectsNeedHelp: Array of StringssubjectsCanHelp: Array of StringspostsUserRespondedTo: Array (References to posts the user has responded to)usersRespondedToUser: Array (References to users who responded to this user's posts)
id: String (Unique identifier for the post)userId: String (ID of the user who created the post)title: Stringdescription: Stringdeadline: String (Date of deadline)subjects: Array of Stringsstatus: String (e.g., 'pending', 'in_progress', 'completed')
id: String (Unique identifier for the report)userId: String (ID of the user who filed the report)targetType: String ('user' or 'post')targetId: String (ID of the user or post being reported)status: String (e.g., 'pending', 'dismissed')
genid: Functionname: Stringsecret: Stringresave: BooleansaveUninitialized: Booleanrolling: Booleanstore: Booleancookie: Object
The application follows a client-server architecture.
-
Frontend (Client): Developed using React, it provides a single-page application experience. It includes a reusable page template with common components (like the menu) and dynamically adjusts content based on screen size, ensuring cross-platform compatibility and multi-language support. Key pages include:
- Landing Page
- Sign In / Sign Up
- Authorization
- User Preferences
- Work Page (for viewing/creating posts)
- Edit Post
- View Post
- Users Page (for browsing other users)
- View User Profile
- User Jobs (user's posts and responses)
- Moderation Page
-
Backend (Server): Built with Node.js and Express.js, it handles all business logic and API requests from the frontend. This includes user authentication, data management (posts, users, reports), and session handling.
To set up the project locally:
-
Clone the repository:
git clone [your-repository-url] cd sup-project -
Install dependencies: Navigate to both the client and server directories and install the necessary packages.
# In the server directory (e.g., `server/`) npm install # In the client directory (e.g., `client/`) npm install
-
Configure environment variables: Create a
.envfile in the server directory and add the following:DB_URI=your_mongodb_connection_string SESSION_NAME=your_session_name SESSION_SECRET=your_session_secret_key POSTS_PER_PAGE=10 PORT=3001 # Or any preferred portReplace
your_mongodb_connection_string,your_session_name, andyour_session_secret_keywith your actual values. -
Start the development servers:
# In the server directory npm start # In the client directory (usually 'npm start' for React apps) npm start
The application should now be accessible in your browser, typically at http://localhost:3000 for the client and http://localhost:3001 for the server.
- Registration and Login: New users can sign up and create an account.
- Profile Setup: Users can fill in their profile details, including subjects they need help with and subjects they can help with.
- Creating Posts: Verified users can create new posts, specifying a title, description, deadline, and relevant subjects.
- Browsing Posts: Users can view existing posts, filter them by subject, and search by title.
- Responding to Posts: Students can respond to posts where they can offer help, and tutors can accept or decline these responses.
- User Profiles: View detailed profiles of other users, including their contact information if a mutual "help" relationship is established.
- Moderation: Moderators have additional privileges to verify users, manage reports, and ban users.
Planned updates for the SUP application include:
- Implementation of new features based on user feedback.
- Further optimization for improved performance and responsiveness.
- Ongoing bug fixes and maintenance.
- Timofei Polivanov
SUP © 2022 by Timofei Polivanov is licensed under CC BY-NC-ND 4.0.
