This is a Next.js project template with an Express backend. It's designed to be used as a starting point for your Next.js and Express projects.
-
Clone this repository:
git clone https://github.com/yourusername/next-express-template.git cd next-express-template
-
Install dependencies:
npm install
-
Run the development server:
npm start
This will start both the Next.js frontend and Express backend concurrently. Open http://localhost:3000 with your browser to see the frontend. The backend API will be available at http://localhost:3001.
In the project directory, you can run:
npm start
: Runs both frontend and backend in development mode.npm run build-frontend
: Builds the Next.js frontend for production.npm run build-backend
: Compiles the TypeScript backend for production.
src/
: Contains the Next.js frontend codeapp.ts
: Entry point for the Express backendtsconfig.json
: TypeScript configuration for the project
- Next.js
- React
- Express
- TypeScript
- SASS
- Concurrently (for running multiple scripts)
This template is set up with a specific structure, but contributions are welcome! Feel free to open a pull request if you have suggestions for improvements.