Skip to content

About

full-stack social web application built with PHP, MySQL, and vanilla JavaScript, themed around space exploration and community storytelling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Cosmic Diary Logo

A space-themed social platform where users write blog entries, build custom planets, follow other explorers, and chat in a global community space.


Features

  • User authentication with bcrypt password hashing
  • Captain's Log blog system with image uploads and infinite scroll
  • Interactive planet builder with live canvas rendering
  • Galaxy gallery with likes and lazy-loaded infinite scroll
  • Global chat with replies, mentions, custom emojis, and live updates
  • Stories system with 24-hour expiry
  • Follow system with private account support and requests
  • Notifications with unread badge and favicon indicator
  • User profiles with avatars, bios, and activity stats
  • Online status and last seen tracking
  • Responsive mobile-first design
  • PNG and GIF export for planets

Tech Stack

  • PHP 8.2
  • MySQL / MariaDB
  • Vanilla JavaScript
  • HTML5 Canvas API
  • CSS3 with custom properties
  • Font Awesome 6
  • gif.js for GIF encoding

Requirements

  • XAMPP (or any LAMP/WAMP stack)
  • PHP 8.0 or higher
  • MySQL 5.7 or higher
  • Node.js and npm (for local libraries)

Installation

  1. Clone the repository into your web server root:
git clone <repository-url> CosmicDiary
  1. Navigate to the project directory:
cd CosmicDiary
  1. Install Node dependencies:
npm install
  1. Create the database and import the schema:
mysql -u root -p cosmic_diary < database.sql

Tip

The database is exported as schema only. Register a new account to begin.

  1. Configure database credentials in includes/config.php:
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'cosmic_diary');
define('BASE_URL', 'http://localhost/CosmicDiary/');
  1. Ensure the following directories exist and are writable:
uploads/
uploads/avatars/
uploads/stories/
  1. Start your Apache and MySQL servers and visit:
http://localhost/CosmicDiary

Project Structure

CosmicDiary/
├── api/              Backend endpoints (JSON responses)
│   ├── auth/         Authentication handlers
│   ├── blog/         Blog CRUD operations
│   ├── chat/         Chat messaging and updates
│   ├── cron/         Activity simulation and maintenance
│   ├── planet/       Planet CRUD and likes
│   ├── stories/      Story creation and viewing
│   └── user/         User profiles, follows, notifications
├── assets/
│   ├── css/          Stylesheets
│   ├── fonts/        Local font files
│   ├── images/       Logos, icons, emojis
│   └── js/           Client-side scripts
├── includes/         Shared PHP (config, header, footer, functions)
├── pages/            User-facing pages
├── uploads/          User-generated content (excluded from git)
├── database.sql      Full database schema
├── package.json      Node dependencies
└── README.md

Security Notes

  • Passwords are hashed using bcrypt via password_hash()
  • All database queries use prepared statements
  • Session-based authentication with cookie path scoping
  • Input sanitization on all user-submitted data
  • File uploads restricted to image types

License

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

About

full-stack social web application built with PHP, MySQL, and vanilla JavaScript, themed around space exploration and community storytelling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages