Skip to content

shayanheidari01/SimorghCMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SimorghCMS

FastAPI Python SQLite HTML5 CSS3 JavaScript

A Modern and Powerful Content Management System

Built with FastAPI and Pure HTML/CSS/JS

πŸ“‹ Project Overview

SimorghCMS is a modern, fast, and user-friendly Content Management System inspired by WordPress. This CMS is built using modern technologies like FastAPI and provides advanced features such as user management, articles, categories, and comments management.

πŸš€ Features

Backend (FastAPI)

  • βœ… JWT Authentication System
  • βœ… User Management with Different Roles (Admin, Editor, Author, Subscriber)
  • βœ… Create, Edit, and Delete Articles
  • βœ… Article Categorization and Tagging
  • βœ… Comment System with Status Management
  • βœ… Media File Upload and Management
  • βœ… Documented API with Swagger and ReDoc
  • βœ… Asynchronous Database with SQLAlchemy
  • βœ… High Security and Data Validation

Frontend (Pure HTML/CSS/JS)

  • βœ… Responsive and Modern Design
  • βœ… Advanced User Dashboard
  • βœ… Article and Comment Management
  • βœ… User Profile Management
  • βœ… Multi-language Support (Persian/English)
  • βœ… High Performance and Speed
  • βœ… No Heavy Framework Dependencies
  • βœ… Clean and Intuitive User Interface

πŸ› οΈ Technologies

Backend

  • FastAPI - High-performance Python web framework
  • SQLAlchemy - Python ORM for database operations
  • SQLite - Lightweight and portable database
  • JWT - Secure tokens for authentication
  • Alembic - Database migration tool
  • Pydantic - Data validation and settings management

Frontend

  • HTML5 - Markup language for web pages
  • CSS3 - Styling and responsive design
  • JavaScript (ES6+) - Client-side scripting
  • Fetch API - Modern HTTP client for API calls
  • No Framework Dependencies - Pure vanilla JavaScript

πŸ“¦ Installation and Setup

Prerequisites

  • Python 3.8+
  • pip
  • Git

Backend Installation

# Clone the repository
git clone https://github.com/yourusername/SimorghCMS.git
cd SimorghCMS

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create database
alembic revision --autogenerate -m "Initial migration"
alembic upgrade head

Running the Backend

# Run development server
uvicorn app.main:app --reload

# Server will be available at http://localhost:8000

Frontend Setup

# Create static directory for frontend files
mkdir -p static/frontend

# Copy frontend files to static directory
cp -r frontend/* static/frontend/

Running the Frontend (for development)

# From the project root directory
python -m http.server 3000

# Frontend will be available at http://localhost:3000

πŸ“š API Documentation

After starting the server, you can access the API documentation:

  • Swagger UI: http://localhost:8000/api/docs
  • ReDoc: http://localhost:8000/api/redoc

πŸ—‚οΈ Project Structure

SimorghCMS/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ api/          # API endpoints
β”‚   β”œβ”€β”€ core/         # Core configurations and security
β”‚   β”œβ”€β”€ crud/         # Database operations
β”‚   β”œβ”€β”€ database/     # Database configuration
β”‚   β”œβ”€β”€ models/       # Database models
β”‚   β”œβ”€β”€ schemas/      # Pydantic schemas
β”‚   └── main.py       # Main application file
β”œβ”€β”€ frontend/         # Frontend files (lightweight version)
β”œβ”€β”€ static/           # Static files
β”œβ”€β”€ alembic/          # Migration files
β”œβ”€β”€ requirements.txt  # Python dependencies
└── README.md         # This file

πŸ”§ Environment Variables

Create a .env file in the project root:

DATABASE_URL=sqlite+aiosqlite:///./cms.db
SECRET_KEY=your-super-secret-key-change-this-in-production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30

🐳 Docker Deployment

# Build and run with Docker
docker-compose up --build

πŸš€ Production Deployment

With Nginx

server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

    location /api/ {
        proxy_pass http://127.0.0.1:8000;
    }
}

πŸ“– Usage Guide

First Admin User

After first run, create an admin user:

  1. Visit http://localhost:8000
  2. Click on "Register"
  3. Enter your user information
  4. Change the user role to "admin" in the database

Creating Articles

  1. Log in to your account
  2. Go to the dashboard
  3. Click on "Create New Article"
  4. Enter article information and publish

🀝 Contributing

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

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

πŸ™ Acknowledgments

  • FastAPI for the excellent framework
  • Python community
  • Open source community

πŸ“ž Contact

SimorghCMS Project - @shythonx - shayanheidari01@gmail.com

Project Link: SimorghCMS


Made with ❀️ and Python

Β© 2023 SimorghCMS. All rights reserved.

About

Simorgh content management system.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published