This is a Next.js project bootstrapped with create-next-app
. It has been extended to support desktop deployment using NW.js.
To run the application in development mode:
yarn dev
Open http://localhost:3000 in your browser to see the result.
You can edit the page by modifying files in the src
directory. The application auto-updates as you edit the files.
Before running the application, initialize the SQLite database:
yarn run setup-db
This will create the necessary database structure and populate initial data.
API routes are used for database interactions. The main API endpoint is accessible at:
This endpoint supports querying class data.
This application has been converted into a desktop application using NW.js. Follow these steps to build and run the desktop version:
-
Build the application:
yarn run build
-
Start the NW.js application:
yarn start
This will start both the local API server and the NW.js application.
Using NW.js provides several benefits compared to other frameworks like Electron:
- Integrated Web and Node.js Context: NW.js allows direct integration of Node.js modules within the browser context, enabling seamless communication between the frontend and backend.
- Simplified Setup: NW.js requires less boilerplate compared to Electron, making it easier to set up and maintain.
- Lightweight: Applications built with NW.js are generally smaller in size compared to Electron-based apps.
- Native Windowing Support: NW.js leverages Chromium's native windowing system, ensuring consistent UI behavior across platforms.
- Single Codebase: Existing web applications can be converted to desktop apps without major changes to the project structure.
To learn more about Next.js and NW.js, take a look at the following resources:
- Next.js Documentation - Learn about Next.js features and APIs.
- NW.js Documentation - Learn how to develop and configure NW.js applications.
Although this application is optimized for desktop use, it can also be deployed as a web application. The easiest way to deploy is by using the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.
- Install dependencies:
yarn install
- Initialize database:
yarn run setup-db
- Start development mode:
yarn run dev
- Build static files:
yarn run build
- Run the application:
yarn start
- List tables:
.tables
- View data:
SELECT * FROM <table_name> LIMIT <n>;
Replace <table_name>
with the name of your table and <n>
with the number of rows to view.