Prerequisites
Before you begin, ensure you have the following installed on your system:- Node.js version 18 or higher
- Docker and Docker Compose
- Git for cloning the repository
- A Google Cloud account for OAuth configuration
Installation
Configure environment variables
Create a Update the
.env file in the root directory by copying the example file:.env file with your configuration:Set up Google OAuth
To enable authentication, configure Google OAuth:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services → Credentials
- Create OAuth 2.0 Client ID credentials
- Add authorized redirect URIs:
http://localhost:3333/auth/google/callback(development)
- Copy the Client ID and Client Secret to your
.envfile
In production, the system restricts authentication to your corporate domain. Configure this in your API settings.
Start the database
Launch PostgreSQL using Docker Compose:Verify the database is running:You should see the
macondo_links_db container running on port 5432.Set up the database schema
Navigate to the API directory and run Prisma migrations:This will:
- Install backend dependencies
- Generate the Prisma Client
- Apply all database migrations
Download GeoLite database
The platform uses GeoIP for location tracking. Download the GeoLite database:
This script downloads the MaxMind GeoLite2 database for IP-based geolocation. The database is used to determine country and city from click IP addresses.
Start the backend (API)
Run the backend server in development mode:The API will start on
http://localhost:3333Start the frontend (Web)
Open a new terminal window, navigate to the web directory, and start the frontend:The frontend will start on
http://localhost:3000Access the application
Open your browser and navigate to:
- Frontend Application: http://localhost:3000
- API Health Check: http://localhost:3333/health
- API Documentation (Swagger): http://localhost:3333/docs
Verify Installation
Test the API health endpoint:Alternative: Docker Compose (Full Stack)
You can also run both the database and API using Docker Compose:- PostgreSQL on port 5432
- API on port 3333
The frontend (
web) is not included in Docker Compose by default. Run it separately using the steps above.Common Issues
Port Already in Use
If you encounter port conflicts:Database Connection Failed
Ensure:- PostgreSQL container is running:
docker ps DATABASE_URLin.envmatches your database configuration- No firewall blocking port 5432
Google OAuth Errors
Verify:- Redirect URIs in Google Cloud Console match your local URLs
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETare correct- Your email domain is allowed (check backend configuration)
Next Steps
Architecture
Understand the system architecture and domain model
API Reference
Explore available API endpoints
Core Features
Learn about link management and features
Deployment
Deploy to production on Vercel and Railway
