A complete full-stack application built with vanilla HTML, CSS, JavaScript for the frontend and Python Flask for the backend.
- Our Projects Section: Displays all projects with images, names, and descriptions
- Happy Clients Section: Shows client testimonials with images, names, and designations
- Contact Form: Submit contact information (Full Name, Email, Mobile Number, City)
- Newsletter Subscription: Subscribe to newsletter with email address
- Project Management: Add, edit, and delete projects with images
- Client Management: Manage client information with images
- Contact Form Details: View all contact form submissions
- Newsletter Subscribers: View all subscribed email addresses
- Image Cropping: Images automatically cropped to 450x350 ratio (for projects) and 150x150 (for clients)
- Responsive Design: Works on desktop, tablet, and mobile devices
- Python 3.8+
- Flask (Web framework)
- Flask-CORS (Cross-origin resource sharing)
- PyMongo (MongoDB driver)
- Pillow (Image processing)
- MongoDB (Database)
- HTML5
- CSS3
- Vanilla JavaScript (ES6 Modules)
- Fetch API for HTTP requests
- Python 3.8 or higher
- MongoDB Atlas account (free tier) or local MongoDB installation
- pip (Python package manager)
Navigate to the backend directory:
cd backendInstall Python dependencies:
pip install -r requirements.txtCreate a .env file in the backend directory:
PORT=5000
MONGODB_URI=mongodb+srv://username:[email protected]/
DB_NAME=fullstack-task
NODE_ENV=developmentReplace the MONGODB_URI with your MongoDB Atlas connection string.
The frontend files are static HTML/CSS/JS files. You can:
- Open them directly in a browser (with CORS limitations)
- Use a simple HTTP server (recommended)
Option 1: Using Python HTTP Server
cd frontend
python -m http.server 3000Option 2: Using Node.js http-server
cd frontend
npx http-server -p 3000Option 3: Using VS Code Live Server Extension
- Install "Live Server" extension in VS Code
- Right-click on
index.htmland select "Open with Live Server"
cd backend
python app.pyThe backend server will run on http://localhost:5000
Use one of the methods mentioned above. The frontend will run on http://localhost:3000
- Landing Page: http://localhost:3000/index.html (or http://localhost:3000/)
- Admin Panel: http://localhost:3000/admin.html
javascriptandbackend/
├── backend/
│ ├── app.py # Flask application
│ ├── requirements.txt # Python dependencies
│ ├── uploads/ # Uploaded images (created automatically)
│ └── .env # Environment variables (create this)
├── frontend/
│ ├── index.html # Landing page
│ ├── admin.html # Admin panel
│ ├── styles.css # Landing page styles
│ ├── admin.css # Admin panel styles
│ ├── api.js # API functions
│ ├── app.js # Landing page JavaScript
│ └── admin.js # Admin panel JavaScript
└── README.md # This file
GET /api/projects- Get all projectsGET /api/projects/:id- Get single projectPOST /api/projects- Create project (Admin)PUT /api/projects/:id- Update project (Admin)DELETE /api/projects/:id- Delete project (Admin)
GET /api/clients- Get all clientsGET /api/clients/:id- Get single clientPOST /api/clients- Create client (Admin)PUT /api/clients/:id- Update client (Admin)DELETE /api/clients/:id- Delete client (Admin)
POST /api/contacts- Submit contact formGET /api/contacts- Get all contacts (Admin)DELETE /api/contacts/:id- Delete contact (Admin)
POST /api/newsletters- Subscribe to newsletterGET /api/newsletters- Get all subscribers (Admin)DELETE /api/newsletters/:id- Delete subscriber (Admin)
- Create a free account at MongoDB Atlas
- Create a new cluster (free tier M0)
- Create a database user
- Whitelist your IP address (0.0.0.0/0 for development)
- Get your connection string
- Update the
MONGODB_URIin your.envfile
- Make sure Flask-CORS is installed and enabled in
app.py - Check that backend is running on port 5000
- Verify frontend is making requests to the correct API URL
- Ensure the
uploadsdirectory exists in the backend folder - Check file size limits (5MB max)
- Verify image file formats (png, jpg, jpeg, gif, webp)
- Verify your MongoDB Atlas cluster is running
- Check that your IP address is whitelisted
- Verify your connection string is correct in
.env
- Make sure you're using a web server (not opening HTML files directly)
- Check browser console for CORS or module errors
- Verify all JavaScript files are in the same directory
- Backend Development: Use
python app.py- Flask runs in debug mode by default - Frontend Development: Use a local server (not file://) to avoid CORS issues
- Database: MongoDB collections are created automatically on first insert
- Images: Uploaded images are automatically cropped and stored in
backend/uploads/
This project is created for educational purposes.