Installation
Get Fastly running on your local machine
Prerequisites
Before you begin, ensure you have the following installed:
| Requirement | Version | Notes |
|---|---|---|
| Node.js | 18.17 or higher | Required for Next.js 16 |
| pnpm | 8.0 or higher | Recommended package manager |
| MongoDB | 6.0 or higher | Local instance or MongoDB Atlas |
| Git | 2.0 or higher | For cloning the repository |
MongoDB Atlas offers a free tier that works well for development. Create an account at mongodb.com/atlas.
Installation
Clone the repository
git clone --filter=blob:none --sparse https://github.com/nabinkhair42/fastly.git my-appInstall dependencies
pnpm installnpm installyarn installCreate environment file
cp env.example .env.localOpen .env.local and configure the required variables. See Environment Setup for details.
Start the development server
pnpm devnpm run devyarn devThe application will be available at http://localhost:3000.
Verify Installation
After starting the server, verify that everything is working:
| URL | Expected Result |
|---|---|
/ | Landing page loads |
/create-account | Registration form appears |
/log-in | Login form appears |
If you see database connection errors, verify your MONGODB_URI is correct and the database is accessible.
Production Build
Build the application
pnpm buildnpm run buildyarn buildStart the production server
pnpm startnpm startyarn startThe production server runs on port 3000 by default. Use the PORT environment variable to change it.
Common Issues
Port already in use
If port 3000 is occupied, specify a different port:
PORT=3001 pnpm devModule not found errors
Clear the cache and reinstall dependencies:
rm -rf node_modules .next
pnpm installTypeScript errors
Ensure you're using the correct Node.js version:
node --version # Should be 18.17+Next Steps
Continue to Environment Setup to configure your database, OAuth providers, and email service.