I recreated the Threads application to improve my web development skills, particularly focusing on React and Next.js.
- For the frontend, I used React and Next.js to build a dynamic server-rendered application, with Tailwind CSS for styling and next-themes for dark mode support.
- For authentication, I integrated next-auth to handle user sign-ins securely.
- For the database, I chose MongoDB, and I used bcrypt to encrypt passwords.
- To enhance user experience, I implemented react-toastify for notifications.
- The entire project is written in TypeScript for better type safety and maintainability.
Make sure you have Node.js v18.18 or later installed.
- Clone this repository
git clone https://github.com/extrymes/Threads.git
cd Threads- Install dependencies
npm install- Create
.envfile containing the required environment variables (see below)
touch .env- Build and run the project
npm run build
npm startThese keys are necessary for the project and must be declared as environment variables in the .env file.
| Variable name | Description |
|---|---|
MONGODB_CLIENT |
The MongoDB connection string (take a look at MongoDB Manual). |
MONGODB_DATABASE |
The name of the database to connect to. |
NEXTAUTH_SECRET |
A random string used to hash tokens, sign/encrypt cookies and generate cryptographic keys. |
NEXTAUTH_URL |
The canonical URL of the site (e.g. http://localhost:3000 for local development). |
Contributions are welcome! Please open an issue or submit a pull request.
This project is released under the MIT License.
