Backend server for the Kanban Board project built with Node.js, Express, MongoDB, and TypeScript.
- Node.js 20.8.1 (LTS)
- MongoDB (local installation or MongoDB Atlas account)
- npm (comes with Node.js)
- Git
git clone [your-repository-url]
cd kanban-server-
Create a new
.envfile in the root directory:cp .env.example .env
-
Configure the following environment variables in
.env:# Server Configuration PORT=5001 NODE_ENV=development # MongoDB Configuration MONGODB_URI=mongodb://localhost:27017/kanban_board DB_NAME=kanban_board # Authentication JWT_SECRET=your_jwt_secret_key GOOGLE_CLIENT_ID=your_google_client_id
Install project dependencies using npm:
npm ci- Make sure MongoDB is running locally or you have a MongoDB Atlas connection string
- The application will automatically create the required collections on first run
For development (with hot reload):
npm run devFor production:
npm run build
npm startThe server will start running on http://localhost:5001 (or the port specified in your .env)
npm run dev- Starts the development server using nodemonnpm start- Runs the production servernpm run build- Compiles TypeScript to JavaScriptnpm run watch- Watches for TypeScript changes and recompilesnpm test- Runs tests (currently not configured)
- Node.js (v20.8.1)
- Express.js
- MongoDB with Mongoose
- TypeScript
- JSON Web Tokens (JWT)
- Google Auth Library
- Cookie Parser
- CORS
- Uses TypeScript for type safety
- Implements Google OAuth for authentication
- JWT for session management
- MongoDB with Mongoose for data persistence
- Express.js for routing and middleware
- JWT-based authentication
- CORS protection
- Cookie security
- Environment variable protection
- Input validation
- Ensure MongoDB is running before starting the server
- The server uses strict TypeScript configuration
- For production deployment, ensure all environment variables are properly set
- The project uses nodemon for development hot-reloading