Median is a web platform designed for sharing and discovering articles. Built with a modern stack, it offers a smooth user experience for writing, editing, and interacting with content. Users can engage with the platform through features like article publishing, commenting, following other users, and more.
- Backend: Express.js
- Database: MongoDB (via Mongoose)
- Frontend: Next.js with ShadCN UI components
- Image Uploads: Cloudinary
- Email Service: Mailtrap for sending transactional emails
- Authentication: Access and Refresh tokens for secure user sessions
- Sign up and log in using email/password.
- Token-based authentication (access and refresh tokens).
- Users can post articles with Markdown support.
- Edit or delete articles.
- Comment on articles (Markdown supported), with the ability to edit or delete comments.
- View user-specific statistics including:
- Total articles and comments.
- Total followers and followings.
- View recent activity: articles, comments, followers.
- Manage profile settings (bio, avatar, name, and password).
- View other users' profiles, including:
- Their recent articles and comments.
- List of followers and followings.
- Follow and unfollow users.
- View all articles.
- Filter articles by name or tags.
- Pagination support for browsing articles.
- Supports password reset functionality via email with reset tokens.
- Frontend implementation is pending.
- Supports dark mode for a better user experience.
The project is divided into two separate directories for the frontend and backend.
- Frontend: Located in the
frontend
directory. - Backend: Located in the
backend
directory.
Both the frontend and backend require separate environment files to configure necessary variables.
NODE_ENV
NEXT_PUBLIC_BACKEND_PORT
NEXT_PUBLIC_BACKEND_URL
NEXT_PUBLIC_FRONTEND_PORT
NEXT_PUBLIC_FRONTEND_URL
NODE_ENV
BACKEND_PORT
BACKEND_URL
FRONTEND_PORT
FRONTEND_URL
MONGODB_URI
CLOUDINARY_URL
MAILTRAP_HOST
MAILTRAP_PORT
MAILTRAP_USERNAME
MAILTRAP_PASSWORD
ACCESS_TOKEN_SECRET
ACCESS_TOKEN_EXPIRATION_TIME
REFRESH_TOKEN_SECRET
REFRESH_TOKEN_EXPIRATION_TIME
RESET_PASSWORD_TOKEN_SECRET
RESET_PASSWORD_TOKEN_EXPIRATION_TIME
-
Navigate to the backend directory:
cd backend
-
Install dependencies:
npm install
-
Create the
.env
file based on the variables listed above. -
Run the backend:
npm run dev
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies:
npm install
-
Create the
.env
file based on the variables listed above. -
Run the frontend:
npm run dev
-
Open the app in your browser using the frontend URL.
- Remove fetching simulation functions in the frontend.
- Implement frontend for password reset flow.
- Optimize image handling (e.g., lazy loading or compression).
- Improve user notifications (e.g., for new comments, followers).
- Improve unit and integration testing coverage.
- Enhance security features (e.g., rate limiting, brute-force protection).
- Implement article and comment reactions (like/dislike).