A full-stack Trello clone project built with Next.js, Express, and MongoDB.
- Getting Started
- Project Structure
- Frontend (Next.js)
- Backend (Express)
- Database (MongoDB)
- Authentication
- API Routes
- Deployment
- Node.js (version 16.0.0 or later)
- MongoDB
-
Clone the repository:
git clone https://github.com/your-username/crework-trello-clone.git
-
Install dependencies for both client and server:
cd client && npm install cd ../server && npm install
-
Set up environment variables:
- Create a
.env
file in the server directory - Add necessary environment variables (e.g.,
MONGODB_URI
,JWT_SECRET
,CLIENT_URL
)
- Start the development servers:
- For the client:
npm run dev
(runs on http://localhost:3000) - For the server:
npm run dev
(runs on http://localhost:4000)
The project is divided into two main parts:
client/
: Next.js frontend applicationserver/
: Express backend application
The frontend is built using Next.js, a React framework that enables server-side rendering and generates static websites.
Key features:
- Server-side rendering
- API routes
- Tailwind CSS and Shadcn UI for styling
- TypeScript as a language
To start the frontend development server:
cd client npm run dev
The backend is built using Express.js, a minimal and flexible Node.js web application framework.
Key features:
- RESTful API design with MVC Architecture
- JWT authentication
- Middleware for request processing
To start the backend development server:
cd server npm run dev
MongoDB is used as the database for this project. Ensure you have MongoDB installed and running locally, or use a cloud-hosted solution like MongoDB Atlas.
User authentication is implemented using JSON Web Tokens (JWT). The verifyToken
middleware in server/src/middlewares/verifyToken.ts
handles token verification for protected routes.
The main API routes are defined in:
server/src/routes/userRouter.ts
: User-related operationsserver/src/routes/tasksRouter.ts
: Task-related operations
The easiest way to deploy the Next.js frontend is using the Vercel Platform.
The Express backend can be deployed to various platforms such as Heroku, DigitalOcean, or AWS.
For more detailed deployment instructions, refer to the documentation of your chosen hosting platform.