๐ Add Frontend Apps
You can add different frontend frameworks such as Next.js, Vue.js, React or any other frontend frameworks.
๐ Guidelinesโ
- Rename this folder with your frontend application name.
- Example:
nextjs-appfor Next.js,vuejs-appfor Vue.js,react-appfor a pure React app, etc. - For multiple frontend apps, create separate folders inside the
apps/directory with relevant names likenext-dashboard-app,vue-dashboard-app,react-chat-app, etc.
๐ Quick Start:
You can follow the detailed documentation provided in this workspace to integrate your preferred frontend framework seamlessly.
๐ Adding Frontend Applications to Your Workspaceโ
We provide boilerplates for various frontend frameworks to make your integration process smoother. You can download and add these frameworks to your workspace apps/ folder.
๐ Available Frontend Boilerplatesโ
- Next.js: Download Next.js Boilerplate
- React: To be added
- Vue.js: To be added
Note: Download the repositories as a ZIP file to avoid git reference issues.
๐ Integrating into the Workspaceโ
-
Download the required boilerplate: Download the boilerplate(s) as a zip file.
-
Update
tsconfig.json: Make sure to extend the workspace-leveltsconfig.base.jsonin your frontend apps.{
"extends": "../../tsconfig.base.json", // Ensure the correct path is used
"compilerOptions": {
// Existing Options
}
} -
Modify
package.jsonscripts: Update your workspace-levelpackage.jsonscripts with your actual application names.{
"frontend:dev": "npm run dev --workspace=frontend-app", // Replace frontend-app with your actual app name
"dashboard:dev": "npm run dev --workspace=dashboard-app" // Replace dashboard-app with your actual app name
}Note: Application name is present in
package.jsonof your Frontend application (It's not the folder-name) -
Modify
project.json: Ensure yourproject.jsonfile within each frontend application contains the necessary configurations to utilize Nx effectively.
๐ Running Your Frontend Applicationsโ
Once you've added your frontend applications to the workspace, follow these steps to run them:
-
Install Dependencies: Make sure you are in the workspace (root) level and run:
$ yarn install
// or
$ npm install -
Start the Frontend Application: Once dependencies are installed, start your frontend application by running:
npm run frontend:dev -
Access the Frontend Application: Your frontend application will be running at its respective URL, typically something like
http://localhost:3002unless otherwise configured.
Your frontend application should now be up and running! ๐