Installation Guide
This guide walks you through installing and configuring both the client and server applications.Prerequisites
Before you begin, ensure you have the following installed on your system:| Requirement | Minimum Version | Check Installation |
|---|---|---|
| Node.js | 18.x | node --version |
| npm | 9.x | npm --version |
| Git | 2.x | git --version |
You’ll also need a MongoDB Atlas account (free tier available) or a local MongoDB instance.
Installation Steps
Configure Server Environment
Create a Edit the
.env file in the server directory:.env file with your configuration:.env
Environment Variables Explained
| Variable | Description | Example |
|---|---|---|
PORT | Port for the Express server | 3001 |
NODE_ENV | Environment mode | development, production |
MONGODB_URI | MongoDB connection string | See example above |
JWT_SECRET | Secret key for signing JWT tokens | Use a strong random string |
JWT_EXPIRES_IN | Token expiration time | 7d, 24h, 30m |
Set Up MongoDB Atlas
If you don’t have a MongoDB Atlas cluster yet:
- Go to MongoDB Atlas
- Create a free account and cluster
- Click “Connect” on your cluster
- Choose “Connect your application”
- Copy the connection string
- Replace
<password>with your database user password - Paste the complete URI into your
.envfile
Make sure to whitelist your IP address in MongoDB Atlas Network Access settings, or allow access from anywhere (0.0.0.0/0) for development.
Install Client Dependencies
Open a new terminal window and navigate to the client directory:
The client uses Next.js 16, React 19, TanStack Query, Zustand, and Tailwind CSS 4.
Configure Client Environment (Optional)
The client works out of the box with default settings. If you need to customize the API URL, create a
.env.local file:.env.local
Variables prefixed with
NEXT_PUBLIC_ are exposed to the browser.Verify Installation
Open your browser and visit:
- Component Showcase: http://localhost:3000
- Server Status: http://localhost:3000/status
- API Health Check: http://localhost:3001/api/health
Verification Checklist
Make sure everything is working correctly:- Server responds at
http://localhost:3001/api/healthwith status “healthy” - Client loads at
http://localhost:3000 - Status page shows server as “connected”
- You can register a new user at
http://localhost:3000/register - You can login at
http://localhost:3000/login - Component interactions are tracked (check dashboard)
Available Commands
Server Commands
Client Commands
Troubleshooting
Server won't start - Port already in use
Server won't start - Port already in use
Another process is using port 3001. Either:
- Stop the other process
- Change the
PORTin your.envfile to a different port
Database connection failed
Database connection failed
Common causes:
- Invalid MongoDB URI in
.env - Incorrect username/password
- IP address not whitelisted in MongoDB Atlas
- Network/firewall issues
Client can't connect to server
Client can't connect to server
Ensure:
- Server is running on port 3001
NEXT_PUBLIC_API_URLpoints to the correct server URL- No CORS issues (server has CORS enabled by default)
Module not found errors
Module not found errors
Delete
node_modules and reinstall:Next Steps
Now that you have everything installed:Quick Start Guide
Learn how to use the component showcase
API Reference
Explore the REST API endpoints
Components
Browse available components
Testing Guide
Learn about the testing workflow