A modern, scalable blog system with a REST API backend and two separate frontend applications. This project demonstrates proficiency in full-stack development, API design, and authentication implementation.
- RESTful API: Built with Express.js and Prisma ORM
- Authentication: Secure JWT-based authentication system
- Dual Frontend:
- Public blog for readers
- Admin dashboard for content management
- Database: PostgreSQL for robust data storage
- Rich Text Editing: Integrated TinyMCE for a superior writing experience
- Responsive Design: Mobile-friendly interfaces for both frontends
-
Node.js
-
Express.js
-
Prisma ORM
-
PostgreSQL
-
JSON Web Tokens (JWT)
- React.js
- React Router
- Axios
- TinyMCE
- Docker
- GitHub Actions (CI/CD)
This project follows a microservices architecture:
- API Server: Handles all database operations and serves data to both frontends
- Public Blog Frontend: Displays published posts and allows comments
- Admin Dashboard: Provides full CRUD functionality for posts and user management
The following Entity-Relationship Diagram (ERD) represents the database structure of our blog system:
This diagram illustrates the relationships between the main entities in our system:
- User: Represents both blog authors and commenters. Each user can write multiple posts and comments.
- Post: Represents blog posts. Each post is written by one user (author) and can have multiple comments.
- Comment: Represents comments on blog posts. Each comment is associated with one post and one user (commenter).
The use of foreign keys (FK) ensures referential integrity in our database, while the inclusion of createdAt
and updatedAt
fields allows for efficient tracking of data changes over time.
- Node.js (v14+)
- PostgreSQL
- Docker (optional)
-
Clone the repository
git clone https://github.com/obre-bjorn/full-stack-blog-system.git
-
Install dependencies
cd full-stack-blog-system npm install
-
Set up environment variables
cp .env.example .env
Edit the
.env
file with your database credentials and JWT secret -
Run database migrations
npx prisma migrate dev
-
Start the development server
npm run dev
Visit http://localhost:3000
for the public blog and http://localhost:3001
for the admin dashboard.
Run the test suite with:
npm test
API documentation is available at /api-docs
when running the server.
- JWT authentication for protected routes
- Passwords hashed using bcrypt
- CORS configured for frontend origins
- Rate limiting on API endpoints
This project is set up for easy deployment to cloud platforms:
- Backend: Heroku
- Frontend: Netlify
- Database: Heroku Postgres
Detailed deployment instructions are available in DEPLOYMENT.md
.
- Implement real-time comments with WebSockets
- Add social media sharing functionality
- Integrate an email newsletter system
Contributions are welcome! Please read the CONTRIBUTING.md
for details on our code of conduct and the process for submitting pull requests.