This is a starter template for building applications using Next.js version 14. The template is pre-configured to work seamlessly with environment variables, authentication, and backend API integration.
- Next.js v14
- Tailwind CSS
- TypeScript
- Environment variable setup for frontend and backend URLs
- Authentication support using
npx auth secret
- Node.js >= 16.x
- npm >= 8.x
-
Clone the repository:
git clone <repository_url> cd <repository_folder>
-
Install dependencies:
npm install
-
Set up authentication secret:
npx auth secret
Copy the generated secret and paste it into the
AUTH_SECRETfield in the.envfile. -
Configure environment variables:
Rename the
.env.localfile to.envand update the variables:# Backend API URL NEXT_PUBLIC_BASE_URL_API=https://your-backend-url.com # Frontend URL NEXT_PUBLIC_BASE_URL=https://your-frontend-url.com # Authentication Secret AUTH_SECRET=your-generated-auth-secret
To start the development server:
npm run devThe application will be available at http://localhost:3000.
To build the application for production:
npm run buildTo start the production server:
npm start.
├── src/
│ ├── components/ # Reusable components
│ ├── app/ # Application routes
├── .env # Environment variables
├── next.config.js # Next.js configuration
└── tsconfig.json # TypeScript configuration
This project follows the Conventional Commits specification to maintain consistent commit messages.
Each commit message should include a type, an optional scope, and a description:
<type>(<scope>): <description>
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc.)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- chore: Changes to the build process or auxiliary tools and libraries
feat(auth): add login functionalityfix(api): resolve timeout issue in fetch requestsdocs(readme): update installation steps
This template is open-source and available under the MIT License.
Test