A full-stack blogging platform with public reading and admin-only publishing.
Chronicle allows anyone to read published articles, while only an authenticated administrator can create, edit, publish, and delete content.
- Read published articles
- Search articles
- Filter by tags
- View reading time and view count
- Responsive design
- Markdown-rendered content
- JWT authentication
- Create, edit, and delete articles
- Save drafts or publish articles
- Markdown editor
- Optional cover images
- Manage published and draft articles
Frontend
- React
- React Router
- Axios
- React Markdown
Backend
- Express.js
- MongoDB
- Mongoose
- JWT
- bcrypt
Chronicle uses a single-administrator publishing model.
Create an administrator credential using the provided script:
node scripts/createCredential.js <username> <password> [role]Example:
node scripts/createCredential.js admin admin123 adminThe script:
- Connects to MongoDB.
- Checks whether the username already exists.
- Hashes the password using bcrypt.
- Stores the username, password hash, and role in MongoDB.
The password is never stored as plaintext.
The role defaults to admin if omitted:
node scripts/createCredential.js admin admin123There is no public user registration or public article posting. Visitors can only read published content.
cd backend
npm installConfigure the backend .env with your database and application settings:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/chronicle
JWT_SECRET=your-secret-keyCreate an admin credential:
node scripts/createCredential.js <username> <password>Start the backend:
npm run devcd frontend
npm installConfigure:
REACT_APP_API_URL=http://localhost:5000/apiStart:
npm startGET /api/articles
GET /api/articles/:slug
GET /api/articles/tags
POST /api/auth/login
GET /api/auth/verify
POST /api/articles
PUT /api/articles/:id
DELETE /api/articles/:id
GET /api/articles/admin/all
GET /api/articles/admin/:id
Protected article-management endpoints require administrator authentication.
Chronicle/
├── backend/
│ ├── models/
│ ├── controllers/
│ ├── routes/
│ ├── middleware/
│ ├── scripts/
│ │ └── createCredential.js
│ ├── server.js
│ └── .env
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ └── utils/
│ └── .env
└── README.md
- Create an administrator credential.
- Log in through
/login. - Open the Admin Dashboard.
- Create an article using Markdown.
- Save it as a draft or publish it.
Visitors can browse, search, filter, and read published articles without an account.
Chronicle supports:
- Headings
- Bold and italic text
- Links
- Lists
- Code blocks
- Blockquotes
- Images
MIT