A modern, responsive website built with Next.js 14, Tailwind CSS, TypeScript, and MariaDB. This project demonstrates a full-stack web application with a beautiful UI and robust backend functionality.
- Modern UI/UX: Beautiful, responsive design with Tailwind CSS
- Full-Stack: Next.js App Router with API routes
- Database: MariaDB with Prisma ORM
- Type Safety: TypeScript for better development experience
- Contact Form: Functional contact form with database storage
- Blog System: Blog posts with author information
- Responsive Design: Mobile-first approach
- SEO Optimized: Meta tags and proper structure
- Frontend: Next.js 14, React 18, TypeScript
- Styling: Tailwind CSS
- Database: MariaDB
- ORM: Prisma
- Deployment: Ready for Vercel, Netlify, or any hosting platform
Before running this project, make sure you have:
- Node.js 18+ installed
- MariaDB server running
- npm or yarn package manager
git clone <your-repo-url>
cd spherenpm install- Create a MariaDB database:
CREATE DATABASE website_db;- Update the
.envfile with your database credentials:
DATABASE_URL="mysql://username:password@localhost:3306/website_db"# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma migrate dev --name init
# (Optional) Seed the database with sample data
npx prisma db seednpm run devOpen http://localhost:3000 with your browser to see the result.
sphere/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API routes
│ │ ├── blog/ # Blog page
│ │ ├── about/ # About page
│ │ ├── contact/ # Contact page
│ │ ├── layout.tsx # Root layout
│ │ └── page.tsx # Home page
│ ├── components/ # React components
│ │ ├── Header.tsx # Navigation header
│ │ ├── Footer.tsx # Site footer
│ │ └── ContactForm.tsx # Contact form component
│ └── lib/ # Utility functions
│ └── db.ts # Database connection
├── prisma/ # Database schema and migrations
│ └── schema.prisma # Prisma schema
├── public/ # Static assets
└── package.json # Dependencies and scripts
The application includes the following database models:
- User: User accounts with authentication
- Post: Blog posts with author relationships
- Contact: Contact form submissions
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpx prisma studio- Open Prisma Studio for database management
- Home (
/) - Landing page with hero section and features - Blog (
/blog) - Display all blog posts - About (
/about) - Company information and team - Contact (
/contact) - Contact form and information
GET /api/posts- Fetch all blog postsPOST /api/posts- Create a new blog postPOST /api/contact- Submit contact form
The project uses Tailwind CSS for styling. You can customize the design by:
- Modifying the Tailwind configuration in
tailwind.config.ts - Updating component styles in the respective files
- Adding custom CSS in
src/app/globals.css
- Update the content in each page component
- Modify the database schema in
prisma/schema.prisma - Add new API routes in
src/app/api/
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
The project can be deployed to any platform that supports Node.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
Create a .env file in the root directory:
# Database
DATABASE_URL="mysql://username:password@localhost:3306/website_db"
# Next.js
NEXTAUTH_SECRET="your-secret-key-here"
NEXTAUTH_URL="http://localhost:3000"- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the development team
Built with ❤️ using Next.js, Tailwind CSS, and MariaDB