Skip to content

a modern social app with a stunning UI with a native mobile feel, a special tech stack, an infinite scroll feature, and amazing performance using Next,js, Appwrite, TypeScript, and more. 🀳

License

Notifications You must be signed in to change notification settings

ladunjexa/nextjs14-snapshot

Repository files navigation

Next.js 14 SnapShot

Latest release Stars Fork GitHub commits Pull requests

demo

ladunjexa License Top Language Contributors Release PRs deployment Known Vulnerabilities

🌐 Live Demo

Explore the live demonstration of the project: nextjs14-snapshot

πŸ“ Description

SnapShot is a modern social app with a stunning UI with a native mobile feel, a special tech stack, an infinite scroll feature, and amazing performance using Next.js, Appwrite, TypeScript, and more.

Folder Structure
nextjs14-snapshot/
β”œβ”€β”€ app/
β”œ   β”œβ”€β”€ (auth)/
β”œ   β”œ   β”œβ”€β”€ sign-in/[[...sign-in]]/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   β”œβ”€β”€ sign-up/[[...sign-up]]/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   └── layout.tsx
β”œ   β”œβ”€β”€ (root)/
β”œ   β”œ   β”œβ”€β”€ layout.tsx
β”œ   β”œ   β”œβ”€β”€ (home)/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   β”œβ”€β”€ collection/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   β”œβ”€β”€ community/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   β”œβ”€β”€ explore/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   β”œβ”€β”€ create-post/
β”œ   β”œ   β”œ   └── page.tsx
β”œ   β”œ   β”œβ”€β”€ edit-post/
β”œ   β”œ   β”œ   └── [id]/
β”œ   β”œ   β”œ       └── page.tsx
β”œ   β”œ   β”œβ”€β”€ edit-profile/
β”œ   β”œ   β”œ   └── [id]/
β”œ   β”œ   β”œ       └── page.tsx
β”œ   β”œ   β”œβ”€β”€ posts/
β”œ   β”œ   β”œ   └── [id]/
β”œ   β”œ   β”œ       └── page.tsx
β”œ   β”œ   └── profile/
β”œ   β”œ       └── [id]/
β”œ   β”œ           β”œβ”€β”€ followers/
β”œ   β”œ           β”œ   └── page.tsx
β”œ   β”œ           β”œβ”€β”€ following/
β”œ   β”œ           β”œ   └── page.tsx
β”œ   β”œ           └── page.tsx
β”œ   β”œβ”€β”€ favicon.ico
β”œ   β”œβ”€β”€ globals.css
β”œ   β”œβ”€β”€ layout.tsx
β”œβ”€β”€ components/
β”œ   β”œβ”€β”€ cards/
β”œ   β”œ   β”œβ”€β”€ FollowCard.tsx
β”œ   β”œ   β”œβ”€β”€ PostCard.tsx
β”œ   β”œ   └── UserCard.tsx
β”œ   β”œβ”€β”€ forms/
β”œ   β”œ   β”œβ”€β”€ Auth.tsx
β”œ   β”œ   β”œβ”€β”€ Post.tsx
β”œ   β”œ   └── Profile.tsx
β”œ   β”œβ”€β”€ scenes/
β”œ   β”œ   β”œβ”€β”€ AllStories.tsx
β”œ   β”œ   β”œβ”€β”€ AllUsers.tsx
β”œ   β”œ   β”œβ”€β”€ Follows.tsx
β”œ   β”œ   β”œβ”€β”€ Post.tsx
β”œ   β”œ   β”œβ”€β”€ Profile.tsx
β”œ   β”œ   β”œβ”€β”€ RecentPosts.tsx
β”œ   β”œ   └── SavedPosts.tsx
β”œ   β”œβ”€β”€ shared/
β”œ   β”œ   β”œβ”€β”€ FileUploader.tsx
β”œ   β”œ   β”œβ”€β”€ GridPostList.tsx
β”œ   β”œ   β”œβ”€β”€ PostStats.tsx
β”œ   β”œ   β”œβ”€β”€ Story.tsx
β”œ   β”œ   β”œβ”€β”€ atoms/
β”œ   β”œ   β”œ   β”œβ”€β”€ Alert.tsx
β”œ   β”œ   β”œ   └── Loader.tsx
β”œ   β”œ   β”œβ”€β”€ layout/
β”œ   β”œ   β”œ   β”œβ”€β”€ Bottombar.tsx
β”œ   β”œ   β”œ   β”œβ”€β”€ LeftSidebar.tsx
β”œ   β”œ   β”œ   β”œβ”€β”€ RightSidebar.tsx
β”œ   β”œ   β”œ   └── Topbar.tsx
β”œ   β”œ   └── search/
β”œ   β”œ       β”œβ”€β”€ LocalResult.tsx
β”œ   β”œ       └── LocalSearchbar.tsx
β”œ   └── ui/ (generated by shadcn-ui)
β”œ       β”œβ”€β”€ button.tsx
β”œ       β”œβ”€β”€ dialog.tsx
β”œ       β”œβ”€β”€ form.tsx
β”œ       β”œβ”€β”€ input.tsx
β”œ       β”œβ”€β”€ label.tsx
β”œ       β”œβ”€β”€ tabs.tsx
β”œ       β”œβ”€β”€ textarea.tsx
β”œ       β”œβ”€β”€ toast.tsx
β”œ       β”œβ”€β”€ toaster.tsx
β”œ       └── use-toast.ts
β”œβ”€β”€ appwrite/
β”œ   β”œβ”€β”€ env.ts
β”œ   β”œβ”€β”€ client.ts
β”œ   β”œβ”€β”€ actions/
β”œ   β”œ   β”œβ”€β”€ post.action.ts
β”œ   β”œ   β”œβ”€β”€ save.action.ts
β”œ   β”œ   └── user.action.ts
β”œ   └── conf/
β”œ       └── index.ts
β”œβ”€β”€ constants/
β”œ   └── index.ts
β”œβ”€β”€ context/
β”œ   └── AuthContext.tsx
β”œβ”€β”€ hooks/
β”œ   └── useDebounce.ts
β”œβ”€β”€ lib/
β”œ   β”œβ”€β”€ utils.ts
β”œ   β”œβ”€β”€ react-query/
β”œ   β”œ   β”œβ”€β”€ Provider.tsx
β”œ   β”œ   β”œβ”€β”€ QueryKeys.ts
β”œ   β”œ   β”œβ”€β”€ mutations/
β”œ   β”œ   β”œ   β”œβ”€β”€ post.mutation.ts
β”œ   β”œ   β”œ   β”œβ”€β”€ save.mutation.ts
β”œ   β”œ   β”œ   └── user.mutation.ts
β”œ   β”œ   └── queries/
β”œ   β”œ       β”œβ”€β”€ post.mutation.ts
β”œ   β”œ       └── user.mutation.ts
β”œ   └── validations/
β”œ       └── index.ts
β”œβ”€β”€ public/
β”œ   β”œβ”€β”€ next.svg
β”œ   β”œβ”€β”€ vercel.svg
β”œ   └── assets/
β”œ       β”œβ”€β”€ icons/[[...]].svg
β”œ       └── images/[[...]].{svg,png}
β”œβ”€β”€ styles/
β”œ   β”œβ”€β”€ prism.css
β”œ   └── theme.css
β”œβ”€β”€ types/
β”œ   └── index.d.ts
β”œβ”€β”€ .eslintrc.json
β”œβ”€β”€ .prettierrc
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
β”œβ”€β”€ components.json
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.js
β”œβ”€β”€ tailwind.config.ts
└── tsconfig.ts

πŸ“– Table of Contents

Table of Contents

✨ Technologies Used

SnapShot is built using the following technologies:
  • TypeScript: TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
  • Next.js: Next.js is a React framework for building server-side rendered and statically generated web applications.
  • Tailwind CSS: Tailwind CSS is a utility-first CSS framework for rapidly building custom user interfaces.
  • ESLint: ESLint is a static code analysis tool for identifying problematic patterns found in JavaScript code.
  • Prettier: Prettier is an opinionated code formatter.
  • Shadcn-UI: Shadcn UI is a React UI library that helps developers rapidly build modern web applications.
  • Appwrite: Appwrite is a secure end-to-end backend server for Web, Mobile, and Flutter developers that is packaged as a set of Docker containers for easy deployment.
  • React Query: React Query is a data-fetching library for React.
  • Query String: Parse and stringify URL query strings.
  • Zod: Zod is a TypeScript-first schema declaration and validation library.
  • Vercel: Vercel is a cloud platform for frontend developers, providing the frameworks, workflows, and infrastructure to build a faster, more personalized Web.

Technologies Used

🧰 Get Started

To get this project up and running in your development environment, follow these step-by-step instructions.

πŸ“‹ Prerequisites

In order to install and run this project locally, you would need to have the following installed on your local machine.

βš™οΈ Installation and Run Locally

Step 0:

Note ‼️ the application uses Appwrite for Authentication and User Management, therefore, you need to create Appwrite account here and sets the NEXT_PUBLIC_APPWRITE_PROJECT_ID and NEXT_PUBLIC_APPWRITE_URL environment variables in .env file.

Also,

  • you need to create a new storage in Appwrite called media and set the NEXT_PUBLIC_APPWRITE_STORAGE_ID environment variable in .env file.
  • you need to create a new database in Appwrite and set the NEXT_PUBLIC_APPWRITE_DATABASE_ID environment variable in .env file.
  • within the database, you need to create those collections: posts, users, and saves and set the NEXT_PUBLIC_APPWRITE_{NAME}_COLLECTION_ID environment variable in .env file.

(the storage and database design can be found in Reference)

Step 1:

Download or clone this repo by using the link below:

git clone https://github.com/ladunjexa/nextjs14-snapshot.git

Step 2:

Execute the following command in the root directory of the downloaded repo in order to install dependencies:

npm install

Step 3:

Execute the following command in order to run the development server locally:

npm run dev

Step 4:

Open http://localhost:3000 with your browser to see the result.

πŸ“œ Scripts

All scripts are defined in the package.json file. Here is a list of all scripts:

Script Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./dist/
npm run start Start your production site locally
npm run lint Run ESLint

πŸ”’ Environment Variables

Environment variables[^7] can be used for configuration. They must be set before running the app.

Environment variables are variables that are set in the operating system or shell, typically used to configure programs.

SnapShot uses Appwrite as external service. You need to create an account on Appwrite and get the required credentials to run the app.

Create a .env file in the root directory of the project and add the following environment variables:

NEXT_PUBLIC_APPWRITE_PROJECT_ID=<NEXT_PUBLIC_APPWRITE_PROJECT_ID>
NEXT_PUBLIC_APPWRITE_URL=<NEXT_PUBLIC_APPWRITE_URL>

NEXT_PUBLIC_APPWRITE_STORAGE_ID=<NEXT_PUBLIC_APPWRITE_STORAGE_ID>
NEXT_PUBLIC_APPWRITE_DATABASE_ID=<NEXT_PUBLIC_APPWRITE_DATABASE_ID>

NEXT_PUBLIC_APPWRITE_USER_COLLECTION_ID=<NEXT_PUBLIC_APPWRITE_USER_COLLECTION_ID>
NEXT_PUBLIC_APPWRITE_POST_COLLECTION_ID=<NEXT_PUBLIC_APPWRITE_POST_COLLECTION_ID>
NEXT_PUBLIC_APPWRITE_SAVES_COLLECTION_ID=<NEXT_PUBLIC_APPWRITE_SAVES_COLLECTION_ID>

πŸš€ Deployment

Deploy to production (manual)

You can create an optimized production build with the following command:

npm run build

Deploy on Vercel (recommended)

The easiest way to deploy this Next.js app is to use the Vercel Platform.

Deploy with Vercel

Deploy on Netlify

You can also deploy this Next.js app with Netlify.

Deploy with Netlify

Check out Next.js deployment documentation for more details.

πŸ”§ Contributing

contributors

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

To fix a bug or enhance an existing module, follow these steps:

  1. Fork the repo
  2. Create a new branch (git checkout -b improve-feature)
  3. Make the appropriate changes in the files
  4. Commit your changes (git commit -am 'Improve feature')
  5. Push to the branch (git push origin improve-feature)
  6. Create a Pull Request πŸŽ‰

πŸ“© Bug / Feature Request

If you find a bug (failure of a module to execute its intended function), kindly open an issue here by including the issue with a title and clear description.

If you'd like to request a new function, feel free to do so by opening an issue here. Please include sample queries and their corresponding results.

πŸ’Ž Acknowledgements

I'd like to express my gratitude to the following people who helped me with this project and made it possible:

πŸ“š References

JSMastery. (2023). Build and Deploy a Full Stack Social Media App | React JS, Appwrite, Tailwind CSS, React Query. YouTube.

πŸ“ž Contact Us

Telegram LinkedIn Instagram Discord

πŸ“‹ License

SnapShot is open source software licensed as MIT and is free to use β€” See LICENSE for more details.

About

a modern social app with a stunning UI with a native mobile feel, a special tech stack, an infinite scroll feature, and amazing performance using Next,js, Appwrite, TypeScript, and more. 🀳

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published