Skip to content

Prolab-Project/Kisisel-Medya-Platformu

Repository files navigation

MediaRate - Personal Media Platform

MediaRate is a full‑stack personal media platform where users can discover and rate movies and books, create custom lists, and interact with other users. The project consists of a Node.js & Express.js RESTful API, a PostgreSQL database, and a Tailwind CSS + Vanilla JavaScript web frontend.


Features

  • User Management

    • Register / login / logout
    • JWT‑based authentication
    • Password reset flow
    • Profile editing (avatar, bio, etc.)
  • Content Management

    • Movie and book search
    • Detailed content pages
    • TMDb and Google Books API integrations
    • Persisting content to the database with simple caching logic
  • Ratings & Reviews

    • 1–10 rating system
    • Add, edit, and delete reviews
    • Average rating and user history
  • Social Features

    • Follow / unfollow users
    • Personalized feed (activities of followed users)
    • Like and comment on activities
  • List Management

    • Default lists: Watched, Watchlist, Read, To‑Read
    • Create, edit, and delete custom lists
    • Public / private lists
    • Cover image previews on list cards
  • User Experience

    • Responsive (mobile‑friendly) design
    • Dark / Light theme support
    • Toast notifications and loading states
    • Infinite scroll for a smooth feed experience

Tech Stack

  • Backend

    • Node.js
    • Express.js
    • PostgreSQL
    • JWT (JSON Web Token)
    • bcrypt
    • dotenv
    • axios
  • Frontend

    • HTML5
    • Tailwind CSS
    • Vanilla JavaScript
  • External Services

    • TMDb (The Movie Database) API
    • Google Books API

Project Structure

.
├── backend/          # Node.js/Express API server
│   ├── config/       # Database configuration
│   ├── controllers/  # Business logic (auth, feed, content, lists, etc.)
│   ├── middleware/   # Auth, upload, and other middleware
│   ├── routes/       # REST API endpoints
│   ├── uploads/      # Uploaded avatars and other files
│   └── server.js     # Express entry point
├── database/         # PostgreSQL connection and table setup scripts
│   ├── db.js
│   └── tables.js
└── frontend/         # Static frontend (HTML, CSS, JS)
    ├── index.html
    ├── pages/        # Feed, profile, content, lists, auth pages
    └── scripts/      # Page‑specific JS files

Getting Started

The following steps are for running the project in a local development environment.

1. Clone the Repository

git clone https://github.com/Prolab-Project/Kisisel-Medya-Platformu.git
cd Kisisel-Medya-Platformu

2. Database Setup

  1. Create a PostgreSQL database:

    CREATE DATABASE mediarate;
  2. Update connection settings in database/db.js (host, user, password, database, port) according to your local environment.

  3. Create tables and relationships:

    cd database
    npm install        # if needed
    node tables.js
    cd ..

Running the Backend

1. Install Dependencies

cd backend
npm install

2. Configure Environment Variables

Create a .env file in the backend directory and add at least the following variables (example):

PORT=5000
JWT_SECRET=super_secret_key
PGHOST=localhost
PGUSER=postgres
PGPASSWORD=postgres
PGDATABASE=mediarate
PGPORT=5432
TMDB_API_KEY=YOUR_TMDB_KEY
GOOGLE_BOOKS_API_KEY=YOUR_GOOGLE_BOOKS_KEY

3. Start the Server

npm start
# or
node server.js

By default, the server will run at http://localhost:5000.


Running the Frontend

The frontend is a static application and can be served in two ways:

1. Static Serving via Backend

backend/server.js is configured to serve the frontend folder statically. Once the backend is running, you can access the UI via:

  • http://localhost:5000/index.html
  • or specific pages such as feed.html, login.html, etc.

2. Separate Dev Server (optional)

If you prefer to run a separate dev server for the frontend:

cd frontend
# For example, using live-server:
npx live-server .

Example API Endpoints

For all endpoints, please check the backend/routes and backend/controllers directories.

  • Auth

    • POST /auth/register – Register
    • POST /auth/login – Login
    • POST /auth/forgot-password – Request password reset
    • POST /auth/reset-password – Reset password
  • User & Profile

    • GET /users/me – Get current user
    • GET /profile/:username – Get user profile and stats
    • PUT /profile – Update profile
  • Feed & Social

    • GET /feed – Get feed of followed users
    • POST /follow/:userId – Follow user
    • DELETE /follow/:userId – Unfollow user
  • Content

    • GET /content/search – Search movies/books
    • GET /content/:id – Get content details
    • POST /rating – Add or update rating
    • POST /review – Add review
  • Lists

    • GET /list – Get user lists
    • POST /list – Create new list
    • POST /user-lists/:listId/items – Add item to list

Developer Notes

  • The project follows a modular architecture (clear separation of controllers, routes, middleware).
  • Database relations (users, contents, ratings, reviews, activities, user_lists, followers, likes, comments, etc.) are modeled in detail.
  • Security relies on JWT, bcrypt, and dedicated auth middleware.
  • On the frontend, Tailwind CSS is used for rapid prototyping and responsive design.

Contributing

  1. Fork this repository.
  2. Create a new branch: feature/your-feature-name
  3. Commit your changes.
  4. Open a Pull Request.

License

This project has been developed for educational purposes. A dedicated LICENSE file can be added to this repository if needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors