π A simple URL shortener service.
This guide explains how to self-host the backend services of siker.im using Docker Compose. The frontend (Next.js 15) is hosted on Vercel, while the backend stack β built with Go (Fiber), MongoDB, and Redis β is deployed on your own machine.
- Next.js 15 β Frontend app, hosted on Vercel.
- Go (Fiber) β REST API backend.
- MongoDB - A NoSQL database.
- Redis β In-memory store used for rate-limiting.
- Docker Compose β Container orchestration for local development.
To set up the server, follow these steps:
git clone [email protected]:lareii/siker.im.git
cd siker.im/server
cp .env.example .env
Update the values in the file according to your environment.
make run
This will build the Docker images, generate TLS certificates, and start all backend services.
- API:
http://localhost:1209
- MongoDB:
mongodb://localhost:27017
- Redis:
redis://localhost:6379
Note
MongoDB and Redis services are configured to persist data across restarts.
Located in .env
inside /server
.
Name | Description | Default Value |
---|---|---|
MONGODB_URI |
Full MongoDB URI (with credentials and TLS if applicable) | mongodb://mongodb:27017 |
MONGODB_NAME |
Name of the MongoDB database | db |
MONGODB_USERNAME |
MongoDB username | β |
MONGODB_PASSWORD |
MongoDB password | β |
REDIS_HOST |
Redis hostname | redis |
REDIS_PORT |
Redis port | 6379 |
REDIS_PASSWORD |
Redis password (if any) | β |
REDIS_DB |
Redis DB index | 0 |
PORT |
Port that the API server listens on | 1209 |
ALLOWED_ORIGINS |
CORS origin whitelist (comma-separated) | * |
LOG_LEVEL |
Logging level (debug , info , warn , error ) |
info |
RATE_LIMIT_ENABLED |
Enable rate limiting | true |
RATE_LIMIT_REQUESTS |
Max requests per window | 100 |
RATE_LIMIT_WINDOW_MINUTES |
Rate-limiting window in minutes | 1 |
RATE_LIMIT_BLOCK_MINUTES |
Block time (in minutes) after rate limit exceeded | 5 |
TURNSTILE_SECRET |
Cloudflare Turnstile secret key | 1x0000000000000000000000000000000AA |
git clone [email protected]:lareii/siker.im.git
cd siker.im/client
npm install
cp .env.example .env
Edit it as needed for your environment.
npm run dev
Open your browser and go to http://localhost:3000
.
Located in .env
inside /client
.
Name | Description |
---|---|
NEXT_PUBLIC_BASE_URL |
Public-facing URL of your site |
NEXT_PUBLIC_API_URL |
Base URL of the API (e.g., http://localhost:1209 ) |
NEXT_PUBLIC_TURNSTILE_SITE_KEY |
Cloudflare Turnstile site key |
This project is licensed under the AGPL-3.0 License. See the LICENSE file for details.