The source code for the backend API can be found here.
This project is a comprehensive request management system that allows users to submit various types of requests, including reports, support requests, and applications. Administrators have the ability to manage these requests through an administrative dashboard.
The system utilizes React for the frontend and Node.js with MongoDB for the backend. Key features include JWT-based authentication, email notifications, request status updates, and an admin dashboard for managing requests.
- Request Form Pages: Users can submit various types of requests, including reports, support requests, and applications.
- Authentication: JWT-based login/logout with dynamic status display in the navbar.
- Admin Panel: Administrators can view, approve, reject, or cancel requests and leave review messages.
- User Dashboard: Users can view their request history and status updates.
- Responsive Design: Optimized for various devices using modern design practices.
- Request Routes: Handles support, report, and application requests.
- JWT Authentication: Secure token-based access control.
- Request Status: Tracks requests with status updates (Approved, Denied, Cancelled, Pending) and review messages.
- Admin Routes: Admin-specific routes for managing requests and users.
- Email Notifications: Automatic notifications for request status updates.
- IP Tracking: Captures user IP addresses for security.
- React: For building the user interface.
- React Router: For navigation.
- DaisyUI/TailwindCSS: For UI components and styling.
- Axios: For API requests.
- React-Icons: For scalable icons.
- React Hot-Toast: For notifications.
- Node.js: Server-side runtime.
- Express.js: Web framework.
- MongoDB: NoSQL database.
- JWT: For authentication.
- Nodemailer: For sending emails.
- Cloudflare Workers: For hosting the backend API (optional).
- Login/Logout: JWT-based authentication via Discord OAuth or email authentication.
- Protected Routes: Restricted access to certain pages based on authentication.
- Token Verification: Validates JWT for secure access.
- Forms: For Reports, support requests, and applications.
- Validation & Sanitization: Ensures correct input and prevents malicious data.
- Request Management: View, approve, reject, cancel, or delete requests. Leave review messages.
- User Management: Block/unblock users (IP address blocking is under development).
- Status Updates: Administrators can update request statuses and send notifications to the user's email.
- Auto-notifications: Sends emails on request status updates.
- Custom Messages: Administrators can include custom review messages in notifications.
- User Dashboard: View request history and status updates.
- Admin Dashboard: Manage requests and user actions.
- Node.js and npm installed.
- MongoDB Atlas or local MongoDB setup.
- (Optional) Cloudflare Workers account for backend hosting.
- Clone the repository:
git clone https://github.com/NotReal003/Requests.git
- Install dependencies:
npm install
- Create a
.env
file and add your API URL:REACT_APP_API=your_api_url CI=false
- Start the React app:
npm start
for development ornpm run build
for production (output will be in/build
).
- Clone the repository:
git clone https://github.com/NotReal003/API.git
- Install dependencies:
npm install
- Configure environment variables:
MONGODB_URI=mongodb+srv://[email protected]/database JWT_SECRET=your_jwt_secret DISCORD_CLIENT_ID=your_discord_client_id DISCORD_CLIENT_SECRET=your_discord_client_secret NODE_ENV=production DISCORD_REDIRECT_URI=callback_url DISCORD_WEBHOOK_URL=first_request_route_webhookurl DISCORD_WEBHOOK_URL1=second_request_route_webhookurl EMAIL=email EPASS=email_password NODE_ENV=production SESSION_SECRET=... WEB_TOKEN=an_webhook_url USER_AUTH_WEBTOKEN=user_auth_logger_webhookurl ADMIN_ID=theAdminId G_ID=github_client_id (optional) G_SECRET=github_client_secret (optional)
- Start the backend server:
node index.js
- Login: Authenticate via Discord OAuth or SignUp / SignIn using Email.
- Submit Request: Fill out and submit request forms.
- View Requests: Check request history and status updates.
- Email Notifications: Receive email updates on request status.
- Manage Requests: Approve, reject, or cancel requests. Leave review messages.
- Review Messages: Administrators can add messages visible to users.
- User Management: Block/unblock users as needed.
- Request Status: Update request statuses directly from the dashboard.
- JWT Authentication: Secures routes and user access.
- Sanitization: Prevents malicious input.
- IP Logging: Tracks user IP addresses for security.
- GET
/auth/login
: Login and return JWT token. - GET
/users/@me
: Get current user details. - GET
/auth/signout
: Logout user. - and more...
- POST
/requests/report
: Submit a Discord report request. - POST
/requests/support
: Submit a support request. - POST
/requests/guild-application
: Submit a guild application request. - GET
/requests
: Get all requests for the current user. - PUT
/requests/:requestId
: Update request status (Admin only). - and more...
- GET
/admin/requests
: Get all submitted requests. - PUT
/admin/requests/:id
: Update request status. - DELETE
/admin/requests/:id
: Delete a request. - PUT
/admin/users/block
: Block a user. - PUT
/admin/users/unblock
: Unblock a user. - and more...
This project is licensed under the MIT License.
For further details, customization, or support, please contact me on Discord.