https://github.com/ayush00git/yapspace
A blogging space to share your thoughts....
https://github.com/ayush00git/yapspace
docker docker-compose ejs expressjs mongodb nodejs
Last synced: 3 months ago
JSON representation
A blogging space to share your thoughts....
- Host: GitHub
- URL: https://github.com/ayush00git/yapspace
- Owner: ayush00git
- Created: 2025-05-31T17:13:33.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-28T10:52:02.000Z (about 1 year ago)
- Last Synced: 2025-06-28T11:37:47.179Z (about 1 year ago)
- Topics: docker, docker-compose, ejs, expressjs, mongodb, nodejs
- Language: EJS
- Homepage: https://yapspace.deznov.space
- Size: 7.14 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YapSpace ๐จ๏ธ
[](https://nodejs.org/)
[](https://expressjs.com/)
[](https://www.mongodb.com/)
[](https://www.docker.com/)
> **A modern, lightweight blogging platform designed for effortless content creation and sharing.**
YapSpace is a full-stack blogging application that empowers users to create, publish, and share their thoughts with the world. Built with modern web technologies, it provides a clean, intuitive interface backed by a robust and scalable architecture.
## โจ Features
- ๐๏ธ **Rich Content Creation** - Create and publish blog posts with an intuitive interface
- ๐ผ๏ธ **Media Management** - Upload and store images seamlessly using Cloudinary integration
- ๐ **Dynamic Rendering** - Server-side rendering with EJS templating for optimal performance
- ๐ **Secure Architecture** - Protected content management with API key integration
- ๐ณ **Containerized Deployment** - Fully Dockerized for consistent deployment across environments
- ๐ฆ **Scalable Storage** - MongoDB integration for fast, flexible data management
- ๐จ **Responsive Design** - Clean, modern UI built with HTML & CSS
- โก **Performance Optimized** - Lightweight and fast loading times
## ๐ ๏ธ Technology Stack
### Backend
- **Runtime**: Node.js
- **Framework**: Express.js
- **Database**: MongoDB with Mongoose ODM
- **Templating**: EJS (Embedded JavaScript)
### Frontend
- **Markup**: Semantic HTML5
- **Styling**: Modern CSS3
- **Architecture**: Server-side rendered pages
### Cloud Services
- **Media Storage**: Cloudinary API
- **Database Hosting**: MongoDB Atlas (recommended)
### DevOps
- **Containerization**: Docker & Docker Compose
- **Version Control**: Git
## ๐ Project Structure
```
YapSpace/
โโโ public/ # Static assets (CSS, images, client-side JS)
โโโ views/ # EJS templates and layouts
โโโ routes/ # Express route definitions
โโโ models/ # Mongoose schemas and data models
โโโ controllers/ # Business logic and route handlers
โโโ middleware/ # Custom middleware functions
โโโ config/ # Configuration files
โโโ uploads/ # Temporary file storage
โโโ .env.example # Environment variables template
โโโ .gitignore # Git ignore rules
โโโ Dockerfile # Docker container configuration
โโโ docker-compose.yml # Multi-container setup
โโโ app.js # Application entry point
โโโ package.json # Dependencies and scripts
โโโ README.md # Project documentation
```
## ๐ Quick Start
### Prerequisites
Ensure you have the following installed:
- [Node.js](https://nodejs.org/) (v14 or higher)
- [MongoDB](https://www.mongodb.com/) (local installation or Atlas account)
- [Git](https://git-scm.com/)
- [Docker](https://www.docker.com/) (optional, for containerized deployment)
### Installation
1. **Clone the repository**
```bash
git clone https://github.com/ayush00git/YapSpace.git
cd YapSpace
```
2. **Install dependencies**
```bash
npm install
```
3. **Environment Configuration**
Create a `.env` file in the root directory
4. **Database Setup**
For local MongoDB:
```bash
# Start MongoDB service
sudo systemctl start mongod # Linux
brew services start mongodb-community # macOS
```
5. **Start the application**
```bash
# Development mode
npm run dev
# Production mode
npm start
```
6. **Access the application**
Open your browser and navigate to `http://localhost:3000`
### ๐ณ Docker Deployment
For a containerized setup:
```bash
# Build and run with Docker Compose
docker-compose up --build
# Run in detached mode
docker-compose up -d
# Stop the application
docker-compose down
```
## ๐ Usage
### Creating Your First Blog Post
1. Navigate to the homepage
2. Click on "Create New Post"
3. Fill in the title and content
4. Upload images using the built-in media uploader
5. Publish your post to share with the world
### Managing Content
- **Edit Posts**: Click on any post to edit its content
- **Delete Posts**: Remove posts you no longer want to share
- **Media Management**: Upload, organize, and manage your images through Cloudinary
## ๐ง Configuration
### Environment Variables
| Variable | Description | Required | Default |
|----------|-------------|----------|---------|
| `PORT` | Server port number | No | 3000 |
| `NODE_ENV` | Environment mode | No | development |
| `MONGODB_URI` | MongoDB connection string | Yes | - |
| `CLOUDINARY_CLOUD_NAME` | Cloudinary cloud name | Yes | - |
| `CLOUDINARY_API_KEY` | Cloudinary API key | Yes | - |
| `CLOUDINARY_API_SECRET` | Cloudinary API secret | Yes | - |
| `SESSION_SECRET` | Session encryption key | Yes | - |
### Cloudinary Setup
1. Create a free account at [Cloudinary](https://cloudinary.com/)
2. Navigate to your dashboard
3. Copy your Cloud Name, API Key, and API Secret
4. Add these credentials to your `.env` file
## ๐ค Contributing
We welcome contributions from the community! Here's how you can help:
### Getting Started
1. **Fork the repository**
2. **Create a feature branch**
```bash
git checkout -b feature/amazing-feature
```
3. **Make your changes**
4. **Commit your changes**
```bash
git commit -m 'Add amazing feature'
```
5. **Push to the branch**
```bash
git push origin feature/amazing-feature
```
6. **Open a Pull Request**
### Contribution Guidelines
- Follow the existing code style and conventions
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure your code passes all existing tests
### Areas for Contribution
- Bug fixes and improvements
- New features from the roadmap
- Documentation enhancements
- Performance optimizations
- UI/UX improvements
- Test coverage expansion
## ๐งช Testing
```bash
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage
```
## ๐ API Documentation
### Blog Posts
- `GET /` - Homepage with recent posts
- `GET /posts` - All blog posts
- `GET /posts/:id` - Specific blog post
- `POST /posts` - Create new post
- `PUT /posts/:id` - Update existing post
- `DELETE /posts/:id` - Delete post
### Media
- `POST /upload` - Upload image to Cloudinary
- `GET /images` - List uploaded images
## ๐ Security
- Environment variables for sensitive data
- Input validation and sanitization
- Secure session management
- Image upload restrictions
## ๐ Acknowledgments
- [Express.js](https://expressjs.com/) - Web application framework
- [MongoDB](https://www.mongodb.com/) - Database solution
- [Cloudinary](https://cloudinary.com/) - Media management
- [EJS](https://ejs.co/) - Templating engine
- All contributors who help improve YapSpace