A modern social media application built with Next.js featuring post creation, image uploads, and user interactions.
- Post Creation: Create posts with titles, content, and images
- Image Uploads: Seamless image uploading with Cloudinary integration
- Like System: Like and unlike posts with real-time updates
- Responsive Design: Modern UI that works across all devices
- SQLite Database: Lightweight database with Better SQLite3
- Server Actions: Modern Next.js server-side functionality
- Framework: Next.js 14.1.0
- Frontend: React 18
- Database: SQLite with Better SQLite3
- Image Storage: Cloudinary
- Styling: CSS Modules
- Language: JavaScript
-
Clone the repository
git clone https://github.com/b-antonenko/Explorer-Next-js.git cd explorer
-
Install dependencies
npm install
-
Set up environment variables Create a
.env.local
file in the root directory and add your Cloudinary credentials:CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret
-
Run the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000 to see the application.
- Navigate to
/new-post
- Fill in the post title and content
- Upload an image
- Submit the form to create your post
- The home page displays the latest posts
- Visit
/feed
to see all posts - Like posts by clicking the heart icon
explorer/
├── actions/ # Server actions for posts
├── app/ # Next.js app directory
│ ├── feed/ # Feed page with all posts
│ ├── new-post/ # Post creation page
│ └── layout.js # Root layout
├── components/ # Reusable React components
├── lib/ # Utility functions and database
├── assets/ # Static assets
└── public/ # Public files
The application uses SQLite with the following tables:
- users: User information (id, first_name, last_name, email)
- posts: Post data (id, image_url, title, content, created_at, user_id)
- likes: Post likes (user_id, post_id)
npm run dev
- Start development servernpm run build
- Build for productionnpm run start
- Start production servernpm run lint
- Run ESLint
- Create a Cloudinary account at cloudinary.com
- Get your Cloud Name, API Key, and API Secret from the dashboard
- Add these to your
.env.local
file
The SQLite database (posts.db
) is automatically created when you first run the application. No additional setup required.
Built with ❤️ using Next.js