A full-stack application consisting of a landing page and an admin panel. The application should include various features for managing project and client information, viewing contact form details, and tracking newsletter subscriptions.
https://github.com/Raviast/front-end-project-demo
https://github.com/Raviast/react-backend-demo
Vercel link:
https://front-end-project-demo.vercel.app/
A full-stack application consisting of a landing page and an admin panel. The application should include various features for managing project and client information, viewing contact form details, and tracking newsletter subscriptions.
- Overview
- Approach
- Technologies Used
- Folder Structure
- Setup and Installation
- Running the Project Locally
- API Endpoints
This project is a full-stack web application built with the MERN (MongoDB, Express.js, React, Node.js and Tailwind CSS) stack. It is designed for managing projects, collecting client feedback, and capturing user subscriptions. Key features include CRUD operations for project management and client data, a contact form, and a subscription feature to store email addresses.
- Modular Structure: Organized as separate backend and frontend directories to keep the codebase scalable and maintainable.
- Backend API: Developed a RESTful API to handle requests, perform CRUD operations, and interact with MongoDB for data storage.
- Responsive UI: Created a user-friendly interface that aligns with the provided design specifications, focusing on accessibility and user experience.
- Frontend: React.js, HTML, TailwindCSS
- Backend: Node.js, Express.js
- Database: MongoDB with MongoDB Atlas
- Other Tools: Vercel (for deployment), Git (version control)
front-end-project-demo/
├── public/
│ ├── index.html
│ ├── favicon.ico
│ └── assets/
│ └── images/
│
├── src/
│ ├── components/
│ │ ├── common/
│ │ │ ├── Button/
│ │ │ ├── Input/
│ │ │ ├── Navbar/
│ │ │ └── Footer/
│ │ ├── layout/
│ │ ├── admin/
│ │ └── landing/
│ │
│ ├── pages/
│ │ ├── Home/
│ │ ├── Admin/
│ │ ├── Projects/
│ │ └── Contact/
│ │
│ ├── services/
│ │ ├── api.js
│ │ └── auth.js
│ │
│ ├── hooks/
│ │ └── useForm.js
│ │
│ ├── context/
│ │ └── AuthContext.js
│ │
│ ├── utils/
│ │ └── helpers.js
│ │
│ ├── styles/
│ │ └── tailwind.css
│ │
│ ├── App.js
│ └── index.js
│
├── package.json
├── tailwind.config.js
├── .env
├── .gitignore
└── README.md
react-backend-demo/
├── config/
│ └── db.js
├── controllers/
│ └── userController.js
├── models/
│ └── User.js
├── routes/
│ └── userRoutes.js
├── middleware/
│ └── auth.js
├── .env
├── .gitignore
├── package.json
└── server.js
- Node.js and npm installed
- MongoDB Atlas account and cluster set up
-
Navigate to the backend directory: bash cd react-backend-demo
-
Install dependencies: bash npm install
-
Create a .env file in the backend directory with the following environment variables: plaintext
MONGO_USER=<username> MONGO_PASS=<password>
- Inside src/config/config.js
You can also add your Mongodb atlas
connection string-
It should look like this-
dbUrl:`mongodb+srv://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@cluster0.ngfwe.mongodb.net/RealTrust`
-
Start the backend server: bash
npm start
-
Navigate to the frontend directory: bash
cd front-end-project-demo -
Install dependencies: bash
npm install -
Update any instances of the backend URL in the frontend code to point to your deployed backend URL (e.g., https://your-backend-url/).
-
Start the frontend server: bash
npm run dev
Running the Project Locally
- Run both the backend and frontend servers. The backend will run on http://localhost:4000 or any other available port, and the frontend on http://localhost:5173/.
- Open http://localhost:5173/in your browser to view the application.
API Endpoints Here are some of the key API endpoints:
- Projects: GET /project/allProject - Fetch all projects
- Projects: POST /project/addProject - POST Project data on database
- Clients: GET /client/allClient - Fetch all client
- Clients: GET /client/allClient - Fetch all client
- Clients: POST /client/addClient - POST Clinet data on database
- Contact Form Submission: POST /contact/addContact - Submit contact form data
- Contact Details Fetch: GET /contact/allContact - Fetch all contact form details
- Subscribe: POST /subscription/create-sub - Subscribe to newsletter
- Subscribe: GET /subscription/all-sub - Fetch details of Subscribe to newsletter