Dielan's Vault is a personal blog application designed to document and share insights, adventures, and knowledge in a well-organized and visually appealing format. The project leverages modern web technologies, including React for the frontend, Node.js for the backend, and Contentful as the Content Management System (CMS). The application is hosted on Render and GitHub Pages for seamless accessibility.
- Built with React.
- Utilizes React Router for seamless page navigation.
- Dynamic components for fetching and displaying blog posts.
- Rich text content rendering using @contentful/rich-text-react-renderer.
- Powered by Node.js with the Express framework.
- Interfaces with Contentful’s API to retrieve blog posts.
- Exposes RESTful API endpoints for frontend data requests.
- Blog content is managed using Contentful.
- Supports fields for title, post image, content, author, and publish date.
- Frontend: Deployed on GitHub Pages.
- Backend: Hosted on Render for scalable server management.
- React: A JavaScript library for building user interfaces.
- React Router: For routing and navigation.
- Axios: For making HTTP requests.
- @contentful/rich-text-react-renderer: For rendering rich text content.
- Node.js: JavaScript runtime for server-side development.
- Express: Web application framework for Node.js.
- Contentful JavaScript SDK: For integrating with the Contentful CMS.
- Cors: Middleware for handling cross-origin resource sharing.
- Dotenv: For managing environment variables.
- GitHub Pages: Static file hosting for the frontend.
- Render: Hosting for the Node.js server.
- App.jsx: Configures the routes and layout of the application.
- Components:
Header
: Provides site-wide navigation.Homepage
: Displays a list of blog posts with brief details.Post
: Shows detailed content for a specific post.
- Pages:
Homepage
: The main landing page displaying all blog posts.
- Styles: Includes custom CSS for styling the components.
- Express Server:
- Connects to the Contentful API.
- Exposes endpoints:
/api/posts
: Retrieves a list of all blog posts./api/posts/:postId
: Retrieves details of a specific post by ID.
- Environment Variables: Uses a
.env
file to store sensitive credentials such as the Contentful API keys and space ID.
- Managed on Contentful.
- Blog posts are structured with fields for title, image, content (rich text), author, and publish date.
- Node.js and npm installed on your system.
- Contentful account with a space set up.
git clone https://github.com/DGwebdes/vault.git
cd vault
-
Navigate to the backend directory (if applicable):
cd backend
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add the following:SPACE=your_contentful_space_id ACCESS_TOKEN=your_contentful_access_token PORT=3000 # or any preferred port
-
Start the server:
node server.js
The backend will run on
http://localhost:3000
.
-
Navigate to the frontend directory (if applicable):
cd frontend
-
Install dependencies:
npm install
-
Start the development server:
npm start
The frontend will run on
http://localhost:3000
.
- Backend:
- Push the backend code to a GitHub repository.
- Deploy the server to Render by connecting the repository and configuring the environment variables.
- Frontend:
-
Build the React application:
npm run build
-
Deploy the
build
folder to GitHub Pages or your preferred static hosting provider.
-
-
Description: Fetches all blog posts.
-
Response:
[ { "sys": { "id": "postId" }, "fields": { "title": "Post Title", "postImage": { "fields": { "file": { "url": "image_url" } } }, "publishDate": "YYYY-MM-DD", ... } } ]
-
Description: Fetches detailed data for a specific post by ID.
-
Response:
{ "title": "Post Title", "postImage": "image_url", "content": "rich_text_content", "author": "Author Name", "publishDate": "YYYY-MM-DD" }
- Add user authentication for creating and managing posts.
- Implement a search feature for easier navigation.
- Enable commenting functionality for posts.
- Enhance responsiveness and mobile support.
-
Fork the repository.
-
Create a new branch for your feature or bug fix:
git checkout -b feature-name
-
Commit your changes:
git commit -m "Description of changes"
-
Push to your branch:
git push origin feature-name
-
Open a pull request on GitHub.
This project is open-source and available under the MIT License.