Welcome to the Node Server Boilerplate! This boilerplate provides a simple yet scalable server to build, share, and manage content. Below is an overview of the project structure and its key components.
- src
- main.ts
- utils
- constants.ts
- security.ts
- converter.ts
- config
- config.ts
- events
- schedule.ts
- data
- database.ts
- persistence.ts
- state.managment.ts
- services
- connections
- server.ts
- sockets.ts
- server.items.ts
- sockets.player.ts
- sockets.chat.ts
- models
- player.models.ts
- database.models.ts
- chat.models.ts
- config.models.ts
- .gitignore
- package-lock.json
- package.json
- persistence.json
- tsconfig.json
- tsconfig.paths.json
This is the main entry point for the server. It orchestrates the server setup and initialization of various components.
This folder contains utility modules such as constants.ts
, security.ts
, and converter.ts
.
Configuration settings for the server are defined in config.ts
.
This folder includes event-related functionalities. Currently, it features schedule.ts
for scheduling tasks.
The data
directory encompasses modules for handling data-related tasks, such as database interaction (database.ts
), persistence (persistence.ts
), and state management (state.managment.ts
).
This folder manages server connections and includes server.ts
for general server setup, and sockets.ts
with sub-modules like server.items.ts
, sockets.player.ts
, and sockets.chat.ts
for socket communication.
Model definitions for various components are stored here, including player.models.ts
, database.models.ts
, chat.models.ts
, and config.models.ts
.
- Install dependencies:
npm install
- Build the project:
npm run build
- Start the server:
npm start
For example usage with a private key: npm run start-example -- --k <private-key>
Express
for server setupSocket.IO
for real-time communicationFirebase
for auth and database interactionNode Schedule
for scheduling tasks- And other essential packages listed in
package.json
- TypeScript for code transpilation
- Various
@types
packages for TypeScript type definitions - Other development dependencies specified in
devDependencies
inpackage.json
Feel free to explore, customize, and expand upon this boilerplate for your specific project needs. If you have any questions or need assistance, don't hesitate to reach out!