The Headless CMS project is a basic content management system with CRUD (Create, Read, Update, Delete) functionality. It allows users to create custom entities with specified attributes and manage entries for these entities via a simple React.js frontend. The backend is built with Express.js and connects to a MySQL database.
- Entity Creation: Users can create entities by specifying their name and attributes (e.g.,
name<string>
,email<string>
,mobileNumber<number>
,dateOfBirth<date>
). - CRUD Operations: Perform Create, Read, Update, and Delete operations on entries for each entity directly from the frontend.
- Dynamic Table Creation: Automatically creates a corresponding table in the MySQL database based on the defined entity and attributes.
- Interactive Interface: React.js frontend for easy interaction and management of entities and entries.
git clone https://github.com/TusharKesarwani/Headless-CMS.git
cd Headless-CMS
npm install
-
Create a MySQL database named
cms
. -
Update the database connection details in
models/db.js
:const db = mysql.createConnection({
host: 'localhost',
user: 'yourusername',
password: 'yourpassword',
database: 'cms'
});
node server.js
The backend server will run at http://localhost:3000.
cd ../headless-cms-frontend
npm install
npm run build
-
Ensure the backend server is configured to serve static files from the React app's build directory.
-
Start the backend server again if it's not running:
cd ..
node server.js
The full application will be accessible at http://localhost:3000.
- Open your browser and navigate to http://localhost:3000.
- Use the "Create Entity" form to define new entities with custom attributes.
- Add entries to the created entities using the "Add Entry" form.
- View, update, and delete entries using the "Entity List" section.
- Frontend: React.js, HTML, CSS, JavaScript
- Backend: Node.js, Express.js
- Database: MySQL
This project was created by Tushar Kesarwani as a basic headless CMS with CRUD functionality.